WO2023274082A1 - 通信方法及装置 - Google Patents

通信方法及装置 Download PDF

Info

Publication number
WO2023274082A1
WO2023274082A1 PCT/CN2022/101247 CN2022101247W WO2023274082A1 WO 2023274082 A1 WO2023274082 A1 WO 2023274082A1 CN 2022101247 W CN2022101247 W CN 2022101247W WO 2023274082 A1 WO2023274082 A1 WO 2023274082A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
data
sequence number
packet
data packets
Prior art date
Application number
PCT/CN2022/101247
Other languages
English (en)
French (fr)
Inventor
刘航
王键
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023274082A1 publication Critical patent/WO2023274082A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/12Wireless traffic scheduling

Definitions

  • the present application relates to the technical field of communication, and in particular to a communication method and device.
  • Short-range communication technologies include Bluetooth technology, Ultra Wide Band (UWB) technology, ZigBee (a low-speed short-range wireless communication technology) and Wireless Fidelity (Wireless Fidelity, WiFi) technology. Due to its low power consumption and low cost, short-distance communication technology is widely used in the connection of mice, keyboards, wearable devices, and true wireless stereo (True Wireless Stereo, TWS) headsets.
  • UWB Ultra Wide Band
  • ZigBee a low-speed short-range wireless communication technology
  • Wireless Fidelity Wireless Fidelity, WiFi
  • a communication method and device which can increase the flexibility of data transmission and improve communication performance.
  • the embodiment of the present application provides a communication method, the method includes: sending at least one data packet to a second device; receiving indication information from the second device, the indication information is used to indicate the at least one first data packet expected by the second device; based on the first data transmission mode, sending one or more data packets to the second device.
  • the first device after the first device determines at least one first data packet expected by the second device, it can determine a packet sent to the second device in combination with the expected situation of the second device and the first data transmission method. Or multiple data packets, instead of simply sending the expected first data packet to the second device, which increases the possibility of the data packet sent by the first device, improves the flexibility of data transmission, and improves the communication performance. Specifically, there are data packets expected to be retransmitted by the second device and data packets waiting to be sent for the first time in the first device, and the sequence numbers of the data packets to be retransmitted are smaller than the sequence numbers of the data packets waiting to be sent for the first time.
  • the one or more data packets sent by the first device based on the first data transmission method may include a data packet with a larger sequence number waiting to be sent for the first time, so that it does not need to wait for the data packet that needs to be retransmitted to be successfully retransmitted or Sending after discarding shortens the waiting time for the first sent packet with a higher sequence number.
  • the one or more data packets sent by the first device based on the first data transmission method may also include data packets that need to be retransmitted, so that the retransmitted data packets will not be waited for by the one with the higher sequence number sent for the first time.
  • the data packet has been preempting the sending opportunity, thereby ensuring the retransmission of the data packet with a smaller sequence number. It can be seen that the method provided by the embodiment of the present application increases the possibility of the data packet sent by the first device, improves the flexibility of data transmission, and improves the communication performance. Further, since the time of waiting for the data packet to be sent is saved, the storage time in the sending end and the receiving end of a data packet is reduced, so the communication method provided by the embodiment of the present application can also save the storage resources and energy of the sending end and the receiving end. consumption, which improves the applicability of low-cost, low-power short-distance communication equipment.
  • the first data transmission mode is a sequential transmission mode;
  • the one or more data packets include multiple second data packets, and the multiple The serial numbers of the second data packets are continuous, and the data packet with the smallest serial number in the plurality of second data packets is the third data packet with the smallest serial number in at least one third data packet; wherein, for any third data packet , the third data packet belongs to the at least one data packet, and the first device has not received confirmation feedback for the third data packet.
  • the latter data packet can be sent out without waiting for the feedback result of the previous data packet, reducing the waiting time for subsequent data packets to be sent;
  • the sequential transmission of data is always guaranteed, and the second device does not need to store more data packets due to waiting for data packet rearrangement, which saves storage resources and energy consumption of the second device.
  • the first data transmission mode is an out-of-order transmission mode
  • the one or more data packets include one or more fourth data packets , the sequence number of any one of the fourth data packets is greater than the sequence number of the third data packet with the largest sequence number in at least one third data packet, the sequence number P of any one of the fourth data packets is the same as that of each third data packet
  • the difference between the sequence numbers M of the packets is less than or equal to K, and the K is preconfigured or defined; wherein, for any third data packet, the third data packet belongs to the at least one data packet, and the first The device has not received confirmation feedback for the third data packet, and P, M, and K are integers greater than or equal to 0.
  • the out-of-sequence sending method can make the first device shuffle the sending order of the data packets, so that waiting for the data packets with a larger sequence number to be sent for the first time does not need to wait for the data packets with a smaller sequence number that need to be retransmitted After being successfully received or discarded, it can be sent, which provides a sending opportunity for the data packet with a large sequence number waiting for the first transmission as soon as possible, and shortens the waiting time for the data packet with a large sequence number waiting for the first transmission.
  • the priority of any one of the fourth data packets is greater than the priority of any one of the third data packets class.
  • the out-of-order transmission can enable the first device to flexibly select the data packets to be sent.
  • the high Priority data packets can be sent without waiting for low-priority data packets to be successfully received or discarded, shortening the waiting time of high-priority data packets, and ensuring that low-priority data packets that need to be retransmitted will not always be High-priority data packets preempt sending opportunities, taking into account the transmission of low-priority data packets and high-priority data, and improving data transmission efficiency.
  • the sequence number of any one of the fourth data packets belongs to the first sequence number segment, and any one of the The sequence number of the third data packet belongs to the second sequence number section, the priority corresponding to the first sequence number section is higher than the priority corresponding to the second sequence number section, and the first sequence number section The sequence number included in the segment is different from the sequence number included in the second sequence number section.
  • sequence numbers of different sequence number segments are assigned priority attributes, which is beneficial to improve the intelligence of decision-making.
  • the method further includes: receiving the first Configuration information, the first configuration information is used to configure the first data transmission mode.
  • the first data transmission mode adopted by the first device may be configured by the second device, which is beneficial to reduce the complexity of the first device, thereby reducing the cost of the first device.
  • the method further includes : Sending first information to the second device, where the first information is used to indicate a data transmission mode expected by the first device or a data transmission mode supported by the first device.
  • the first device can provide the second device with its expected data transmission mode or the data transmission mode supported by it.
  • the K is based on the first The buffer attribute of the device and/or the buffer attribute of the second device are configured or defined; or, the K is based on the sending window size of the first device and/or the receiving window size of the second device configured or defined.
  • an embodiment of the present application provides a communication method, the method comprising: receiving at least one data packet from a first device; based on a first data feedback method, sending indication information to the first device, the The indication information is used to indicate at least one first data packet expected by the second device; receiving one or more data packets from the first device.
  • the second device may determine to feed back one or more expected first data packets to the first device based on the first data feedback manner, instead of simply feeding back ACK or NACK to the first device.
  • the optional range and optional mode of the data packets sent by the first device are increased, so that the first device may send data packets in batches or out of order.
  • a sending opportunity is provided for a data packet with a larger sequence number, so that the data packet with a larger sequence number does not need to wait for the acknowledgment feedback of the data packet with a smaller sequence number. It can be sent. In this way, the data packet with a larger sequence number will not be blocked due to the retransmission of the data packet with a smaller sequence number, which ensures the transmission of the data packet with a larger sequence number and improves user experience.
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a fifth data packet, and the first The five data packets represent the data packet with the smallest sequence number among the unsuccessfully received data packets among the at least one data packet.
  • the receiving end determines the data packet with the smallest sequence number among the unsuccessfully received data packets as the first data packet expected to be received, so that the sending end can retransmit the unsuccessfully received data packets at the receiving end .
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a sixth data packet, and the The priority of the sixth data packet is higher than that of the fifth data packet, and the fifth data packet represents a data packet with the smallest sequence number among the unsuccessfully received data packets among the at least one data packet.
  • the receiving end determines the data packet with a higher priority than the data packet with the smallest sequence number among the unsuccessfully received data packets as the first data packet expected to be received, so that the sending end can send Packets with higher priority.
  • the first data feedback mode is a batch feedback mode; the at least one first data packet includes one or more seventh data packets, The one or more seventh data packets represent unsuccessfully received data packets of the at least one data packet.
  • the receiving end feedbacks the receiving status of the data packets in batches, so that the sending end can continuously send multiple data packets, so that the sending end can take care of waiting for the data packet with a large sequence number sent for the first time and the data packet that needs to be repeated. Transmission of data packets with smaller sequence numbers.
  • the method further includes: sending the first configuration information to the first device , the first configuration information is used to configure a first data transmission mode, and the first data transmission mode is a sequential transmission mode or an out-of-order transmission mode.
  • the method further includes: receiving first information from the first device, the first The information is used to indicate the data transmission mode expected by the first device or the data transmission mode supported by the first device.
  • an embodiment of the present application provides a communication device, the device comprising: a sending module, configured to send at least one data packet to a second device; a receiving module, configured to receive an instruction from the second device information, the indication information is used to indicate at least one first data packet expected by the second device; the sending module is further configured to send one or more data packets to the second device based on the first data transmission mode data pack.
  • the first data transmission mode is a sequential transmission mode;
  • the one or more data packets include a plurality of second data packets, and the The sequence numbers of the plurality of second data packets are continuous, and the data packet with the smallest sequence number among the plurality of second data packets is the third data packet with the smallest sequence number among at least one third data packet; wherein, for any third data packets, the third data packet belongs to the at least one data packet, and the first device has not received confirmation feedback for the third data packet.
  • the first data transmission mode is an out-of-order transmission mode
  • the one or more data packets include one or more fourth data packets , the sequence number of any one of the fourth data packets is greater than the sequence number of the third data packet with the largest sequence number in at least one third data packet, the sequence number P of any one of the fourth data packets is the same as that of each third data packet
  • the difference between the sequence numbers M of the packets is less than or equal to K, and the K is preconfigured or defined; wherein, for any third data packet, the third data packet belongs to the at least one data packet, and the first The device has not received confirmation feedback for the third data packet, and P, M, and K are integers greater than or equal to 0.
  • the priority of any one of the fourth data packets is greater than the priority of any one of the third data packets class.
  • the sequence number of any one of the fourth data packets belongs to the first sequence number segment, and any one of the The sequence number of the third data packet belongs to the second sequence number section, the priority corresponding to the first sequence number section is higher than the priority corresponding to the second sequence number section, and the first sequence number section The sequence number included in the segment is different from the sequence number included in the second sequence number section.
  • the receiving module is further configured to receive a message from the second device First configuration information, where the first configuration information is used to configure the first data transmission mode.
  • the sending module further configured to send first information to the second device, where the first information is used to indicate a data transmission mode expected by the first device or a data transmission mode supported by the first device.
  • the K is based on the first The buffer attribute of the device and/or the buffer attribute of the second device are configured or defined; or, the K is based on the sending window size of the first device and/or the receiving window size of the second device configured or defined.
  • an embodiment of the present application provides a communication device, the device comprising: a receiving module, configured to receive at least one data packet from the first device; a sending module, configured to send to The first device sends indication information, and the indication information is used to indicate at least one first data packet expected by the second device; the receiving module is further configured to receive one or more data packets from the first device Bag.
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a fifth data packet, and the first The five data packets represent the data packet with the smallest sequence number among the unsuccessfully received data packets among the at least one data packet.
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a sixth data packet, and the The priority of the sixth data packet is higher than that of the fifth data packet, and the fifth data packet represents a data packet with the smallest sequence number among the unsuccessfully received data packets among the at least one data packet.
  • the first data feedback manner is a batch feedback manner; the at least one first data packet includes one or more seventh data packets, The one or more seventh data packets represent unsuccessfully received data packets of the at least one data packet.
  • the sending module is further configured to send the first Configuration information, the first configuration information is used to configure a first data transmission mode, and the first data transmission mode is a sequential transmission mode or an out-of-sequence transmission mode.
  • the receiving module is further configured to receive a message from the first device First information, where the first information is used to indicate the data transmission mode expected by the first device or the data transmission mode supported by the first device.
  • the embodiments of the present application provide a communication device, which can implement one or more of the communication methods of the above-mentioned first aspect or multiple possible implementations of the first aspect, or perform the above-mentioned The communication method of the second aspect or one or more of the multiple possible implementation manners of the second aspect.
  • the embodiments of the present application provide a computer program product, including computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are stored in an electronic
  • the processor in the electronic device executes one or more of the communication methods of the above-mentioned first aspect or multiple possible implementations of the first aspect, or executes the above-mentioned second aspect or the second aspect One or several communication methods among various possible implementations.
  • Figure 1a shows a flowchart of a communication method in the related art
  • Figure 1b shows a schematic diagram of changes in SN and NESN in a communication method of the related art
  • Fig. 1c shows a schematic diagram of changes of SN and NESN in the communication method of the related art
  • FIG. 2a shows a schematic diagram of an application scenario of a communication method provided by an embodiment of the present application
  • Fig. 2b shows a schematic diagram of the architecture of the communication system provided by the embodiment of the present application.
  • FIG. 3 shows a schematic structural diagram of an electronic device according to an embodiment of the present application
  • FIG. 4 shows a schematic flowchart of a communication method provided by an embodiment of the present application
  • FIG. 5a shows an exemplary schematic diagram of data packets in the buffer area of the first device in the embodiment of the present application
  • Fig. 5b shows a flow chart of the communication method provided by the embodiment of the present application in the scenario where the sequential sending mode and the batch feedback mode are combined;
  • Fig. 5c shows a flow chart of the communication method provided by the embodiment of the present application in the scenario where the out-of-sequence transmission mode and the single-packet feedback mode are combined;
  • Fig. 5d shows a flow chart of the communication method provided by the embodiment of the present application in the scenario where the out-of-sequence sending mode and the batch feedback mode are combined;
  • FIG. 6 shows a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • FIG. 7 shows a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Short-distance communication devices are generally low-cost, low-power devices. Because a larger buffer area will increase the cost of communication devices and storing more data in the buffer area will cause more power consumption of communication devices, therefore, usually short-distance
  • the buffer area of the distance communication device is smaller, and the number of data packets that can be stored in the buffer area is smaller. Therefore, in the related art, data transmission is generally performed in a sequential transmission manner. For example, in some existing technologies, data packets are sent in the form of sequential transmission, and the data packets are retransmitted through the relationship between the serial number (Serial Number, SN) and the expected serial number (Next Expected Serial Number, NESN) Take control.
  • serial Number Serial Number
  • NESN Next Expected Serial Number
  • an SN is stored and maintained at the sending end
  • an NESN is stored and maintained at the receiving end.
  • the lengths of SN and NESN are both 1 bit (namely 1 bit), that is to say, the selectable values of SN and NESN are 0 and 1.
  • Both the SN stored in the sending end and the NESN stored in the receiving end are initialized to 0.
  • the SN stored in the sending end is used to indicate which data packet the sending end sends
  • the NESN stored in the receiving end is used to indicate which data packet the receiving end expects to receive.
  • the packet header of the data packet sent from the sender to the receiver includes the SN.
  • the feedback information sent by the receiving end to the sending end includes the NESN.
  • Fig. 1a shows a flowchart of a communication method in the related art.
  • the sender sends data packets according to the locally stored SN. For example, when the locally stored SN is 0, the sender sends a data packet with the SN in the packet header being 0; when the locally stored SN is 1, the sender sends A data packet with SN in the packet header as 1. After receiving the data packet from the sending end, the receiving end determines whether the SN in the received data packet is the same as the locally stored NESN.
  • the SN in the received data packet When the SN in the received data packet is the same as the locally stored NESN, it indicates that the receiving end has received the data packet it expects to receive, and the receiving end adds 1 to the locally stored NESN, and according to the locally stored NESN (ie NESN after adding 1) to send feedback information (at this time, the sent feedback information may be called ACK) to instruct the sender to send a new data packet.
  • the sent feedback information may be called ACK
  • the sending end receives the feedback information, and determines whether the NESN in the feedback information is the same as the locally stored SN.
  • the sender keeps the locally stored SN unchanged to resend the data packet; in the received If the NESN in the response message is different from the locally stored SN, it indicates that the previously sent data packet has been successfully received, and the sender adds 1 to the locally stored SN to send a new data packet.
  • the feedback information sent by the receiving end to the sending end may be included in a header (header) of a data packet sent by the receiving end to the sending end.
  • Fig. 1b shows a schematic diagram of changes of SN and NESN in the communication method of the related art.
  • the SN stored locally at the sending end is 0, and the NESN stored locally at the receiving end is 0.
  • the data packets buffered in the buffer area of the sender include: data packet 1 and data packet 2.
  • the SN in the packet header of the data packet 1 (referred to as the data packet 1 for short) is 0, and the SN in the data packet 2 is 1.
  • the sending end sends the data packet 1.
  • step S102 the receiving end receives the data packet 1, and after comparison, it is determined that the SN in the data packet 1 is the same as the locally stored NESN (both are 0), and the receiving end adds 1 to the locally stored NESN. That is to say, the NESN stored locally at the receiving end changes from 0 to 1. At this time, the receiving end may generate feedback information 1 with NESN being 1.
  • step S103 the receiving end sends feedback information 1.
  • the sending end receives the feedback information 1, and determines that the NESN in the feedback information 1 is different from the locally stored SN after comparison (the former is 1, the latter is 0), and the sending end adds 1 to the locally stored SN. That is to say, the SN stored locally in the sender changes from 0 to 1. Therefore, the sender will subsequently send a data packet with SN 1, that is, data packet 2.
  • step S105 the sender sends data packet 2.
  • Fig. 1c shows a schematic diagram of changes of SN and NESN in the communication method of the related art.
  • the sender sends a data packet 1 .
  • the receiving end does not receive the data packet 1 within a certain period of time (can be set as required, such as 30 seconds or 1 minute, etc.), and the receiving end keeps the locally stored NESN unchanged (still 0). At this time, the receiving end may generate feedback information 2 whose NESN is 0.
  • the receiving end sends feedback information 2.
  • step S108 the sender receives the feedback information 2, and determines by comparison that the NESN in the feedback information 2 is the same as the locally stored SN (both are 0) or has not received the feedback information for the data packet 1 within a certain period of time, and sends The end keeps the locally stored SN unchanged (still 0). Therefore, the sender will subsequently send a data packet with SN 0, that is, data packet 1.
  • step S109 the sender sends data packet 1. If the subsequent data packet 1 is still not successfully received by the receiving end, the sending end repeats step S108 and step S109 to retransmit the data packet 1 again. This creates a situation where packet 2 is blocked by packet 1.
  • the sender will not transmit packet 2 until packet 1 is successfully received or packet 1 is discarded due to reaching the maximum number of retransmissions. If the data packet 2 is a data packet of a high-priority service, it is difficult to guarantee the quality of the high-priority service, which affects user experience.
  • the sender unconditionally transmits the high-priority data packet after the high-priority data packet arrives, it will cause the retransmitted data packet to be preempted by the high-priority data packet to send the opportunity, so that the retransmitted data packet will be stored in the server for a long time.
  • the storage resources of the sending end are occupied, which increases the energy consumption of the sending end; at the same time, the high-priority data packets in the receiving end are stored in the buffer of the receiving end for a long time because they are waiting for the retransmission data packets to be sorted, thus occupying the receiving end.
  • the storage resources at the end increase the energy consumption at the receiving end.
  • the first device after the first device determines at least one first data packet expected by the second device, it can determine a packet sent to the second device in combination with the expected situation of the second device and the first data transmission method. Or multiple data packets, instead of simply sending the expected first data packet to the second device, which increases the possibility of the data packet sent by the first device, improves the flexibility of data transmission, and improves the communication performance. Specifically, there are data packets expected to be retransmitted by the second device and data packets waiting to be sent for the first time in the first device, and the sequence numbers of the data packets to be retransmitted are smaller than the sequence numbers of the data packets waiting to be sent for the first time.
  • the one or more data packets sent by the first device based on the first data transmission method may include a data packet with a larger sequence number waiting to be sent for the first time, so that it does not need to wait for the data packet that needs to be retransmitted to be successfully retransmitted or Sending after discarding shortens the waiting time for the first sent packet with a higher sequence number.
  • the one or more data packets sent by the first device based on the first data transmission method may also include data packets that need to be retransmitted, so that the retransmitted data packets will not be waited for by the one with the higher sequence number sent for the first time.
  • the data packet has been preempting the sending opportunity, thereby ensuring the retransmission of the data packet with a smaller sequence number. It can be seen that the method provided by the embodiment of the present application increases the possibility of the data packet sent by the first device, improves the flexibility of data transmission, and improves the communication performance. Further, since the time of waiting for the data packet to be sent is saved, the storage time in the sending end and the receiving end of a data packet is reduced, so the communication method provided by the embodiment of the present application can also save the storage resources and energy of the sending end and the receiving end. consumption, which improves the applicability of low-cost, low-power short-distance communication equipment.
  • the short-distance communication devices involved in the embodiments of this application include but are not limited to mice, keyboards, cameras, wireless headsets, wearable devices, routers, smart home appliances (such as refrigerators, rice cookers, air conditioners and washing machines, etc.), smart sockets and sensors, etc. , Low-power short-range communication equipment.
  • terminal devices such as mobile phones, notebook computers, netbooks, and tablet computers also have short-distance communication functions and can be used as short-distance communication devices for short-distance communication.
  • the communication method provided in the embodiment of the present application may also be applied to these short-distance communication devices.
  • the embodiment of the present application does not limit the short-distance communication manner and short-distance communication equipment.
  • Fig. 2a shows a schematic diagram of an application scenario of the communication method provided by the embodiment of the present application.
  • short-distance wireless communication connections such as Bluetooth can be established among devices such as router 11 , wireless headset 12 , camera 13 , smart watch 14 , tablet computer 15 , mobile phone 16 , and notebook computer 17 .
  • Data packets can be transferred between these devices.
  • the priorities of data packets of different types of services may be different. For example, the priority of the data packets of the voice service is higher than that of the data packets of the data service, the priority of the instant messaging service is higher than that of the webpage service, and so on.
  • the transmission of high-priority data packets and low-priority data packets can be considered.
  • Fig. 2b shows a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • the communication system includes a first device 21 and a second device 22 .
  • the first device 21 may be deployed at the sending end, and the second device 22 may be deployed at the receiving end.
  • the first device 21 may send at least one data packet to the second device 22, receive indication information from the second device 22, and send one or more data packets to the second device 22 based on the first data transmission mode.
  • FIG. 3 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device shown in FIG. 3 can be used as the sending end or receiving end in the communication system provided by the embodiment of the present application, and can be used to deploy the first device 21 shown in FIG. 2b or the second device 22 shown in FIG. 2b.
  • the electronic device may include at least one processor 301 , a memory 302 , and an input and output device 303 .
  • the following is a specific introduction to each component of the electronic device in combination with FIG. 3 :
  • the processor 301 is the control center of the electronic device, and may be one processor, or may be a general term for multiple processing elements.
  • the processor 301 is a CPU, and may also be an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure, for example: one or more microprocessors (Digital Signal Processor, DSP), or, one or more Field Programmable Gate Arrays (Field Programmable Gate Array, FPGA).
  • ASIC Application Specific Integrated Circuit
  • the processor 301 can execute various functions of the electronic device by running or executing software programs stored in the memory 302 and calling data stored in the memory 302 .
  • the processor 301 may include one or more CPUs, such as CPU 0 and CPU 1 shown in the figure.
  • the electronic device may include multiple processors, for example, the processor 301 and the processor 305 shown in FIG. 3 .
  • processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU).
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the memory 302 may be a read-only memory (Read-Only Memory, ROM) or other types of static storage devices that can store static information and instructions, and a random access memory (Random Access Memory, RAM) or other types that can store information and instructions It can also be an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a read-only disc (Compact Disc Read-Only Memory, CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be programmed by a computer Any other medium accessed, but not limited to.
  • the memory 302 may exist independently, and is connected to the processor 301 through the bus 304 .
  • the memory 302 can also be integrated with the processor 301 .
  • the memory may be used to store the first data packet, the second data packet, the third data packet, the fourth data packet, the fifth data packet, the sixth data packet and the seventh data packet, and the SN, NESN and K et al.
  • the input and output device 303 is used for communicating with other devices or a communication network.
  • the communication network may be a possible wireless communication network, especially a short-distance communication network. Further optionally, it can also be used to communicate with communication networks such as Ethernet and radio access network (Radio access network, RAN).
  • the input and output device 303 may include all or part of a baseband processor, and may also optionally include a radio frequency (Radio Frequency, RF) processor.
  • the RF processor is used to send and receive RF signals
  • the baseband processor is used to process the baseband signals converted from RF signals or the baseband signals to be converted into RF signals.
  • the input and output device 303 may include a transmitter and a receiver (or called a transmitting unit and a receiving unit). Wherein, the transmitter is used for sending signals to other devices or communication networks, and the receiver is used for receiving signals sent by other devices or communication networks.
  • the transmitter and receiver can exist independently or be integrated together.
  • the input and output device 303 can be used to send and receive: the first data packet, the second data packet, the third data packet, the fourth data packet, the fifth data packet, the sixth data packet and the seventh data packet , and indication information, first information, first configuration information, and so on. This application does not limit the form of the transmitter and receiver, which can be set independently or integrated.
  • the system can also include a bus 304, which can be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or other possible types of bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the device structure shown in FIG. 3 does not constitute a limitation to the electronic device, and may include more or less components than shown in the illustration, or combine some components, or arrange different components.
  • FIG. 4 shows a schematic flowchart of a communication method provided by an embodiment of the present application. This method can be applied to the communication system shown in Fig. 2b. As shown in Figure 4, the communication method may include:
  • Step S401 the first device sends at least one data packet to the second device.
  • At least one data packet represents a data packet sent by the first device.
  • the at least one data packet may or may not be successfully received by the second device.
  • the first device determines that the confirmation feedback for the data packet is received, indicating that the second device has successfully received the data packet, and the data packet is not retransmitted.
  • the first device determines that the acknowledgment feedback that the data packet has not been received indicates that the second device has not successfully received the data packet, and the data packet needs to be retransmitted.
  • the process of how the first device determines whether the confirmation feedback of a data packet is received will be described below. Take the data packet A sent by the first device to the second device as an example. If the second device successfully receives the data packet A, the second device sends feedback information indicating that the data packet A is successfully received to the first device. If the second device fails to receive the data packet A, the second device will not send feedback information indicating that the data packet A is successfully received to the first device.
  • the second device fails to receive the data packet A, or although the second device successfully receives the data packet A, the feedback sent by the second device to the first device to indicate that the data packet A is successfully received
  • the first device cannot receive the feedback information indicating that the data packet A is successfully received from the second device.
  • the first device After the first device sends the data packet A to the second device, it starts to wait for the feedback information on the data packet A from the second device. If the first device receives feedback information indicating that the data packet A is successfully received before the waiting time reaches the first preset time, the first device may determine that the acknowledgment feedback for the data packet A has been received.
  • the first device may determine that no confirmation feedback for the data packet A has been received.
  • the second device may send a message indicating that the data packet A has not been successfully received to the first device.
  • Feedback when the first device receives the feedback information indicating that the data packet A has not been successfully received, the first device can immediately determine that no acknowledgment feedback for the data packet A has been received, without waiting for the waiting time to reach the first predetermined value. Confirm after setting the time.
  • the feedback information may be carried by physical layer control information, for example, ACK is used to indicate that the data packet is successfully received; NACK is used to indicate that the data packet is not successfully received.
  • the feedback information can also be carried by the protocol layer above the physical layer, for example, included in the packet header of the link layer protocol data unit (Protocol Data Unit, PDU) or the header of the data frame In the frame header; for example, an indicator bit is carried in the link layer PDU header, where 1 indicates that the data packet was successfully received, and 0 indicates that the data packet was not successfully received.
  • PDU Packet Data Unit
  • the first device After the first device sends a data packet, it needs to determine the feedback result of the data packet (including: determining that the acknowledgment feedback for the data packet has been received, or determining that the data packet has not been received. After the confirmation feedback of the package), the subsequent sending work is carried out.
  • At least one data packet includes data packet 1 and data packet 2 .
  • the first device sends data packet 1 to the second device, and determines that the acknowledgment feedback for data packet 1 has been received (ie, determines that the second device has successfully received data packet 1) or determines that the acknowledgment feedback for data packet 1 has not been received (ie, determines When the second device fails to receive the data packet 1), it sends the data packet 2 or retransmits the data packet 1 to the second device. It can be seen that, in this implementation manner, the second device needs to perform single-packet feedback every time a data packet is received.
  • the second device After the second device receives the data packet 1, it needs to send a feedback information for the data packet 1 to indicate that the data packet 1 is successfully received (for example, an ACK corresponding to the sequence number of the data packet 1; Finally, it is necessary to send a feedback information (for example, an ACK corresponding to the sequence number of the data packet 2) for the data packet 2 to indicate that the data packet 2 has been successfully received. In this way, the first device can determine that the confirmation feedback for the data packet 1 has been received Or the acknowledgment feedback of data packet 2.
  • the second device when it expects to receive data packet 1, but does not receive data packet 1 within the second preset time, it can send a message indicating unsuccessful reception to the first device Feedback information of data packet 1 (for example, NACK corresponding to the sequence number of data packet 1), so that the first device can determine that no acknowledgment feedback for data packet 1 has been received as soon as possible without waiting for the first preset time, so that The first device can perform subsequent sending work as soon as possible, thereby improving data transmission efficiency.
  • the first device Feedback information of data packet 1 for example, NACK corresponding to the sequence number of data packet 1
  • first preset time and the second preset time can be set as required, the first preset time can be shorter than the second preset time, for example, the first preset time can be set to 0.1 second, The second preset time may be set to 0.2 seconds, and the embodiment of the present application does not limit the setting manners of the first preset time and the second preset time.
  • the subsequent sending work can be performed without waiting for the feedback result of the physical layer of the data packet, that is to say, the first device can continuously send at least one data packet .
  • the number of data packets to be sent continuously may be preset in the first device.
  • the first device may continuously send 4 data packets at a time, namely: data packet 1, data packet 2, data packet 3 and data packet 4.
  • the first device After the first device sends data packet 1 to the second device, it can send data packet 2 without determining whether it has received the confirmation feedback for data packet 1; after sending data packet 2, it also does not need to determine whether it has received the confirmation feedback for data packet 2 acknowledgment feedback for data packet 3 can be sent; after data packet 3 is sent, data packet 4 can be sent without determining whether the acknowledgment feedback for data packet 3 is received.
  • the second device may perform unified batch feedback on the receiving conditions of multiple data packets.
  • the batch feedback performed by the second device on the reception of multiple data packets is: the second device performs batch feedback on the data packets received within the third preset time.
  • the indication information in the feedback information sent by the second device may simultaneously indicate the reception status of multiple data packets.
  • the second device needs to generate indication information in combination with the data transmission mode adopted by the first device when sending at least one data packet.
  • the data transmission mode adopted by the first device may be a sequential transmission mode or an out-of-sequence transmission mode.
  • the third preset time can be set as required, and the timing start time of the third preset time can be the time when the feedback information was sent last time, or the time when the data packet was received for the first time after the feedback information was sent last time, etc.
  • the embodiment of the present application does not limit the setting manner of the third preset time.
  • the data transmission mode used by the first device to send at least one data packet is a sequential transmission mode.
  • each bit of the indication information (that is, a bit, which may be called an indication bit) may represent a Received data packets.
  • the first bit of the indication information represents the reception of the first data packet in the data packets continuously sent by the first device
  • the second bit of the indication information represents the reception of the second data packet in the data packets continuously sent by the first device Condition.
  • the number of data packets sent continuously by the first device can be preset in the first device and the second device, and the number of data packets continuously sent by the first device can also be pre-agreed between the first device and the second device according to the buffer size and other information. quantity.
  • the first device continuously sends data packet 1, data packet 2, data packet 3 and data packet 4 to the second device, and the second device receives data packet 1 and data packet 3 within a third preset time, And the data packet 2 and the data packet 4 are not received, the value of each bit of the indication information in the feedback information sent by the second device to the first device may be 1010.
  • the first device continuously sends data packet 1, data packet 2, data packet 3 and data packet 4 to the second device, and the second device receives data packet 1, data packet 3 and data packet within the third preset time.
  • packet 4 and the data packet 2 is not received
  • the value of each bit of the indication information in the feedback information sent by the second device to the first device may be 1011.
  • the first device After the first device receives the indication information, it can determine the data packets represented by each bit in the indication information according to the order in which it sends the data packets, and then determine the receiving status of each sent data packet.
  • the data transmission mode used by the first device to send at least one data packet is an out-of-sequence transmission mode.
  • the indication information may include the sequence of data packets received within the third preset time No.
  • the first device continuously sends data packet 1, data packet 2, data packet 3 and data packet 4 to the second device, and the second device receives data packet 1 and data packet 3 within a third preset time, If the data packet 2 and the data packet 4 are not received, the indication information in the feedback information sent by the second device to the first device may include the sequence number of the data packet 1 and the sequence number of the data packet 3 .
  • the first device continuously sends data packet 1, data packet 2, data packet 3, and data packet 4 to the second device, and the second device receives data packet 1, data packet 3, and data packet within the third preset time.
  • packet 4 the indication information in the feedback information sent by the second device to the first device may include the sequence number of data packet 1, the sequence number of data packet 3, and the sequence number of data packet 4.
  • the first device may determine the receiving status of each sent data packet.
  • the first device can send at least one data packet in a sequential sending manner, or send at least one data packet in an out-of-order sending manner, therefore, in this embodiment of the application, the method of sending at least one data packet in step S401 No restrictions.
  • the specific implementation process of the sequential sending method and the out-of-order sending method it will be described in detail in the following content.
  • Step S402 the second device receives at least one data packet from the first device.
  • the second device may determine the expected first data packet according to the receiving situation of the data packet.
  • the NESN or SN may consist of multiple bits. Taking 2 bits as an example, the value ranges of NESN and SN are 0, 1, 2 and 3.
  • the NESN stored or maintained in the second device represents the sequence number of a data packet it expects to receive (or the sequence number of the data packet with the smallest sequence number among multiple data packets it expects to receive). Assume that the NESN stored or maintained in the second device is 1.
  • the second device can determine that the data packet whose SN is 1 has not been successfully received, and can determine the data packet whose SN is 1 as an expected first data packet, and at the same time, the second device can update the stored or maintained NESN to 1 .
  • the second device may determine that the data packet with an SN of 1 and the data packet with an SN of 2 A data packet with an SN of 2 is an expected first data packet, and meanwhile, the second device may keep the stored or maintained NESN at 1.
  • the second device may update the stored or maintained NESN to 4.
  • Step S403 the second device sends indication information to the first device based on the first data feedback manner, where the indication information is used to indicate at least one first data packet expected by the second device.
  • the first data feedback mode may indicate a data feedback mode adopted by the second device, and the first data feedback mode is a single-packet feedback mode or a batch feedback mode.
  • the single-packet feedback mode means feeding back the receiving situation of one data packet through one indication information. Specifically, feedback information (for example, may be an ACK) is sent every time a data packet is received.
  • feedback information is sent once (for example, it may be NACK).
  • the batch feedback mode indicates that the reception status of multiple data packets is simultaneously fed back through one instruction message.
  • each bit of the indication information represents the reception status of a data packet.
  • the indication information includes sequence numbers of data packets received within the third preset time.
  • the first data feedback manner may be obtained through negotiation between the first device and the second device.
  • the first data feedback manner may be preconfigured or defined in the second device.
  • the second device can skip the process of determining the first data feedback mode from the single-packet feedback mode and the batch feedback mode, and directly send data to the first device after receiving at least one data packet from the first device. Send instructions. In this way, it is beneficial to reduce the equipment cost.
  • the first data packet may represent a data packet expected by the second device. There may be one or more first data packets. The first data packet may be determined according to the receiving situation of the current data packet.
  • the first data packet may include one or more data packets that were not successfully received.
  • the first data packet may include a next data packet of the successfully received data packets.
  • the data packet next to the successfully received data packet refers to a data packet whose sequence number is greater than that of the successfully received data packet, and whose sequence number is continuous with the sequence number of the successfully received data packet.
  • the serial number can take values 0,1,2,3. Considering that the sequence number of the data packet is increasing sequentially, so the second device successfully receives the data packet with the sequence number 1, then the next data packet of the successfully received data packet is the data packet with the sequence number 2.
  • the serial numbers may be cyclically rolled.
  • the next data packet is the data packet with the sequence number 0.
  • the serial numbers of the data packet with the serial number 0 and the data packet with the serial number 3 are consecutive, and the serial number of the data packet with the serial number 0 is greater than the serial number of the data packet with the serial number 3 .
  • the sequence number of the data packet with the sequence number 1 is also greater than the sequence number of the data packet with the sequence number 3.
  • the first data packet is a data packet not successfully received by the second device or a next data packet of a data packet successfully received by the second device.
  • the sequence numbers of the data packet 2 and the data packet 3 are consecutive, and the sequence number of the data packet 2 is smaller than the sequence number of the data packet 3 . If the second device does not receive the data packet 2 successfully, then the first data packet expected by the second device is the data packet 2 . The second device successfully receives the data packet 2 , and the first data packet expected by the second device is data packet 3 .
  • the first data packet is one or more data packets not successfully received by the second device.
  • the sequence numbers of data packet 1, data packet 2, data packet 3 and data packet 4 are consecutive and increase sequentially.
  • the first device sent data packet 1, data packet 2 and data packet 3 to the second device. If the second device fails to receive the data packet 1 and the data packet 2 but successfully receives the data packet 3 , the first data packet expected by the second device includes the data packet 1 and the data packet 2 . If the second device fails to receive the data packet 4 but successfully receives the data packet 1 , data packet 2 and data packet 3 , then the first data packet expected by the second device includes the data packet 4 .
  • the one or more first data packets expected by the second device may be indicated by an expected sequence number. For example, if the first device sends a data packet with a sequence number of 1, and the second device successfully receives the data packet with a sequence number of 1, then the indication information can use a sequence number 2 to indicate that the second device expects to receive a data packet with a sequence number of 1. 2 packets.
  • the first device sends packets with sequence numbers 1, 2, and 3, and the second device fails to receive packets with sequence numbers 1 and 2, but successfully receives
  • the indication information may use sequence numbers "1" and "2" to indicate that the second device expects to receive a data packet with a sequence number of 1 and a data packet with a sequence number of 2. Bag.
  • the indication information may be included in the control information of the physical layer, and may also be included in the packet header of other protocol layers above the physical layer (such as the link control layer or the MAC layer).
  • the data transmission mode adopted by the first device is the sequential transmission mode
  • the second device if the second device expects multiple first data packets, only one first data packet may be indicated, and the data packet is a serial number The smallest packet that was not successfully received. In this way, the amount of data indicating information can be saved.
  • the first device sends data packets with sequence number 1, sequence number 2 and sequence number 3, the second device fails to receive the data packets with sequence number 1 and sequence number 3, but successfully receives the sequence number If the packet number is 2, then the sequence number 1 can be used in the indication information to indicate that the second device expects to receive the packet with the sequence number 1 and one or more next packets.
  • indicating that the second device expects one or more first data packets may also be indicated by using a plurality of indicating bits, such as a bitmap (bitmap).
  • bitmap a bitmap
  • the first device sends data packet 1, data packet 2, data packet 3, and data packet 4, the second device successfully receives data packet 3, data packet 4, but fails to receive data packet 1, data packet 2, then at this time "0011" can be used to indicate that the second device expects data packet 1 and data packet 2, wherein the first "0" corresponds to data packet 1, indicating that data packet 1 was not successfully received; the second "0” corresponds to data packet 2 , indicating that data packet 2 was not successfully received; the first "1” corresponds to data packet 3, indicating that data packet 3 was successfully received; the second "1” corresponds to data packet 4, indicating that data packet 4 was successfully received.
  • one or more first data packets expected by the second device may be indicated by feedback information indicating whether the reception is successful or not.
  • Step S404 the first device receives indication information from the second device.
  • the first device may determine at least one first data packet expected by the second device according to the indication information.
  • the indication information sent by the second device to the first device may include a sequence number of the first data packet.
  • the first device may determine the first data packet expected by the second device according to the sequence number therein.
  • the indication information sent by the second device to the first device may include a plurality of bits, called indication bits, such as a bitmap (bitmap).
  • indication bits such as a bitmap (bitmap).
  • bitmap bitmap
  • Each indicator bit corresponds to the reception of a data packet. When the indicator bit is 0, it means that the corresponding data packet has not been successfully received, and when the indicator bit is 1, it means that the corresponding data packet has been successfully received.
  • the two indication methods can also be exchanged, that is, 0 indicates that the reception is successful, and 1 indicates that the reception fails, which is not specifically limited in this application.
  • the first device After the first device receives the indication information, it can determine which data packets have been successfully received by the second device and which data packets have not been successfully received by the second device according to the receiving situation indicated by each indication bit, that is to say, it can determine which data packets have been received.
  • the acknowledgment feedback and which data packets have not been received acknowledgment feedback, based on which the first data packet expected by the second device can be determined. It can be understood that, in the case that the reception indicated by each indicator bit is successfully received, the first device may determine that the first data packet expected by the second device is one or more data packets with a sequence number greater than that of the data packet already sent. data pack. In the case that the results indicated by one or several indication bits are unsuccessfully received, the first device may determine that the first data packet expected by the second device is one or more data packets not received successfully.
  • the indication information sent by the second device to the first device may include the sequence numbers of one or more first data packets, and after receiving the indication information, the first device, The first data packet expected by the second device can be determined according to the sequence number in the indication information.
  • the second device can also determine which data packets have been successfully received by the second device according to the sequence numbers in the indication information, that is to say, can determine which data packets have received confirmation feedback.
  • the indication information may include the sequence numbers of all the expected first data packets, or may only include the sequence of the data packet with the smallest sequence number among all the expected first data packets No.
  • the second device expects a plurality of first data packets, the indication information includes a sequence number of a data packet, and the data packet is an unsuccessfully received data packet with the smallest sequence number.
  • the first device sends packets with sequence numbers 0, 1, 2, and 3, and the second device successfully receives packets with sequence numbers 0 and 2, but fails to receive packets with sequence numbers 1 and 2. If the packet number is 3, the second device may send indication information including the sequence number "1" to the first device.
  • the first device determines that the data packet with the sequence number 1 is the first data packet expected by the second device.
  • the first device may also determine all data packets with sequence numbers greater than 1 as the first data packets expected by the second device. This situation corresponds to the sequential transmission method.
  • the second device expects a plurality of first data
  • the indication information may include sequence numbers of the plurality of first data packets.
  • the first device sends packets with sequence numbers 0, 1, 2, and 3, and the second device successfully receives packets with sequence numbers 0 and 2, but fails to receive packets with sequence numbers 1 and 2. If the packet number is 3, the second device may send indication information including the sequence number "1" and the sequence number "3" to the first device.
  • the first device determines that the data packet with the sequence number 1 and the data packet with the sequence number 3 are the data packets expected by the second device.
  • the first device may also determine all data packets with sequence numbers greater than 3 as the first data packets expected by the second device. This situation corresponds to the out-of-order sending method.
  • the second device may determine to feed back one or more expected first data packets to the first device based on the first data feedback manner, instead of simply feeding back ACK or NACK to the first device.
  • the optional range and optional mode of the data packets sent by the first device are increased, so that the first device may send data packets in batches or out of order.
  • a sending opportunity is provided for a data packet with a larger sequence number, so that the data packet with a larger sequence number does not need to wait for the acknowledgment feedback of the data packet with a smaller sequence number. It can be sent. In this way, the data packet with a larger sequence number will not be blocked due to the retransmission of the data packet with a smaller sequence number, which ensures the transmission of the data packet with a larger sequence number and improves user experience.
  • Step S405 the first device sends one or more data packets to the second device based on the first data transmission mode.
  • the first data transmission mode may indicate a data transmission mode adopted by the first device, and the first data transmission mode is a sequential transmission mode or an out-of-sequence transmission mode.
  • the sequential sending mode means that the serial numbers are sent in ascending order, and the serial numbers of the sent data packets are continuous.
  • the out-of-sequence sending mode means that the data packets are not sent in a sequential manner from small to large sequence numbers.
  • the out-of-sequence transmission mode specifically indicates It is not necessary to send the sequence numbers in ascending order, and the sequence numbers of the sent data packets can be discontinuous.
  • the out-of-sequence transmission mode specifically means that the sequence numbers of the transmitted data packets are sent in order of sequence numbers from small to large Can be discontinuous.
  • the one or more data packets include a plurality of second data packets, the sequence numbers of the plurality of second data packets are continuous, and the plurality of second data packets have The data packet with the smallest sequence number is the third data packet with the smallest sequence number among at least one third data packet; wherein, for any third data packet, the third data packet belongs to the at least one data packet, and the first The device has not received acknowledgment feedback for the third data packet.
  • the third data packet belongs to at least one data packet sent by the first device to the second device in step S401, and the first device has not received confirmation feedback for the third data packet. That is to say, the third data packet is a data packet sent by the first device but unsuccessfully received by the second device.
  • the number of the third data packets is one or more. Therefore, each third data packet belongs to at least one first data packet expected by the second device, and each third data packet needs to be retransmitted.
  • the first device needs to send data packets in order of sequence numbers from small to large, and the sequence numbers of the sent data packets need to be continuous.
  • the first device needs to start sending the data packet with the smallest sequence number among the data packets to be retransmitted (that is, the third data packet with the smallest sequence number among the at least one third data packet), and sequentially send the data packet with the same sequence number as the previous one. Packets that have sent packets with consecutive sequence numbers that are higher than the sequence number of the previous sent packet. In this way, it not only gives a chance to send a data packet with a sequence number larger than the sequence number of the data packet that needs to be retransmitted, but also enables the data packet that needs to be retransmitted to be resent once, taking into account the data packet with a larger sequence number sent for the first time and the data packet that needs to be retransmitted.
  • step S401 the first device sends a data packet 1, a data packet 2, a data packet 3 and a data packet 4 to the second device, and their sequence numbers are 1, 2, 3 and 4 respectively.
  • the first device determines that the acknowledgment feedback of the data packet 1 and the data packet 3 has been received, and determines that the acknowledgment feedback of the data packet 2 and the data packet 3 has not been received, therefore, the first device determines that the data packet 2 and the data packet 4 are the first There are three data packets, and the third data packet with the smallest sequence number in the third data packet is data packet 2.
  • the data packet with the smallest sequence number among the plurality of second data packets is the third data packet with the smallest sequence number among the third data packets, therefore, the data packet with the smallest sequence number among the plurality of second data packets is data packet 2 . That is to say, in this step, the data packet with the smallest sequence number among the plurality of second data packets sent by the first device to the second device is data packet 2 . Therefore, in this step, the first device may send data packet 2, data packet 3, data packet 4, and data packet 5 (the sequence number of which is 5) to the second device in sequence.
  • the data packet 5 with a larger sequence number waiting for the first transmission and the data packets 2 and 4 with a smaller sequence number that need to be retransmitted can be sent without waiting for the confirmation feedback of other data packets, which saves waiting time and storage resources and improve the user experience.
  • the first device continues to send data packets with larger sequence numbers such as data packet 6 (with a sequence number of 6) and data packet 7 (with a sequence number of 7) after sending the data packet 5, if In the case that the data packet 2 needs to be retransmitted again, the data packet 2 needs to wait for a long time before getting a sending opportunity for retransmission.
  • the sequence number of the second data packet sent in this step is limited.
  • the difference between the sequence number N of each second data packet among the plurality of second data packets and the sequence number M of the data packet with the smallest sequence number among the third data packets is less than or equal to K.
  • N, M and K are integers greater than or equal to 0.
  • the sequence number N of data packet 6 has a value of 6
  • the sequence number M of the packet with the smallest sequence number in the third packet has a value of 2.
  • the difference between the two The value of 4 is greater than K, therefore, the first device will not send the data packet 6 temporarily after sending the data packet 5 . In this way, if there is a data packet that needs to be retransmitted among the data packets 2 to 5, the retransmission can be performed without waiting too long.
  • the difference between the sequence number N of each second data packet in the plurality of second data packets and the sequence number M of the data packet with the smallest sequence number in the third data packet can be abs(N-M), that is, the absolute value of N-M .
  • the one or more data packets include one or more fourth data packets, and the sequence number of any one of the fourth data packets is greater than that of at least one third data packet
  • the sequence number of the third data packet with the largest sequence number, the difference between the sequence number P of any one of the fourth data packets and the sequence number M of any one of the third data packets is less than or equal to K, and the K is pre- Configured or defined; P, M and K are integers greater than or equal to 0.
  • the sequence number of a fourth data packet is greater than the sequence number of a third data packet includes: the batch of the fourth data packet is after the batch of the third data packet (for example The batch number of the fourth data packet is greater than the batch number of the third data packet).
  • the difference between the sequence number P of any fourth data packet and the sequence number M of the third data packet with the largest sequence number among the third data packets may be abs(P-M), ie the absolute value of P-M.
  • the parameter of batch number may not exist in the actual scene, but the device can determine the sequence of batches.
  • the third data packet belongs to at least one first data packet expected by the second device, and needs to be retransmitted.
  • the number of the third data packets may be one or more.
  • the sequence number of the data packet sent by the first device may not be continuous with the sequence number of the data packet sent next. Therefore, the first device may skip data packets with smaller sequence numbers that need to be retransmitted, and send data packets with larger sequence numbers that are waiting to be sent for the first time.
  • the first device needs to determine whether the confirmation feedback for the data packet is received before sending a subsequent data packet every time it sends a data packet. Therefore, when the second device adopts the single-packet feedback mode as the data feedback mode, one or more data packets sent by the first device in this step include a fourth data packet, and the sequence number of the fourth data packet needs to be greater than that of the first The serial number of the third data packet with the largest sequence number in the three data packets, so that the data packet with a larger sequence number waiting to be sent for the first time will not be blocked by any retransmission of the third data packet, and the sending opportunity is obtained.
  • the sequence number of the fourth data packet is limited.
  • the Determine the data packet as the fourth data packet When the difference between the sequence number P of a data packet and the sequence number M of each third data packet is less than or equal to K, the Determine the data packet as the fourth data packet.
  • the third data packet with a smaller sequence number that needs to be retransmitted will not always be preempted by the data packet with a larger sequence number waiting to be sent for the first time. It can be seen that in the embodiment of the present application, the transmission of the data packet with a larger sequence number waiting to be sent for the first time and the data packet with a smaller sequence number that needs to be retransmitted are taken into account. For example, suppose K is 3.
  • the first device sends a data packet 1 with a sequence number of 1 to the second device, and determines that no acknowledgment feedback for the data packet 1 has been received, that is, the data packet 1 is the third data packet, and the value of M is 1 .
  • the first device may send the data packet 2 to the second device.
  • the first device may send a data packet 3 with a sequence number 3 and a data packet 4 with a sequence number 4.
  • the first device retransmits the data packet 1 without continuing to send the data packet 5 .
  • the first device may continuously send multiple data packets. Therefore, when the second device adopts the batch feedback method as the data feedback method, the one or more data packets sent by the first device in this step may include one or more fourth data packets, and any sequence of the fourth data packets The number needs to be greater than the sequence number of the third data packet, so that the data packet with a larger sequence number waiting to be sent for the first time will not be blocked by the retransmission of the third data packet, and the sending opportunity is obtained. At the same time, in the embodiment of the present application, the sequence number of the fourth data packet is limited.
  • the The data packet is determined to be the fourth data packet. In this way, the third data packet with a smaller sequence number that needs to be retransmitted will not always be preempted by the data packet with a larger sequence number waiting to be sent for the first time.
  • the one or more data packets sent to the second device in this step include one or more fourth
  • one or more third data packets may also be included.
  • the indication information in step S404 includes a sequence number
  • the sending sequence of the data packets is not limited.
  • the indication information in the step S404 included an indication bit when sending one or more data packets, first sent a small data packet with a sequence number, and then sent a large data packet with a sequence number, so that it can improve Accuracy of Feedback Results.
  • K is pre-configured or defined, including but not limited to, K is stipulated in a protocol, or K is configured by the second device for the first device through configuration information.
  • K may be configured or defined based on the buffer attribute of the first device and the buffer attribute of the second device; or, K may be based on the sending The window size and the receiving window size of the second means are configured or defined.
  • the sending end always maintains a sending window during the sending process, and only data packets (or data frames) falling within the sending window are allowed to be sent; at the same time, the receiving end also maintains a A receiving window, only data packets (or data frames) falling within the receiving window are allowed to be received.
  • the sending window size represents the maximum number of data packets that the sending end is allowed to send
  • the receiving window size represents the maximum number of data packets that the receiving end is allowed to receive.
  • the attributes of the cache area include one or more of capacity, upper limit, position, and mark.
  • the capacity represents the maximum number of data packets that the buffer area can hold. This capacity is a fixed value set when the buffer is created.
  • the upper bound represents the number of packets actually stored in the buffer.
  • the position represents the index of the next packet to be read or written.
  • a marker represents a memo location, and the marker is undefined before setting, the marker can be set as a position, and the position can also be set as a marker.
  • K is determined through negotiation between the first device and the second device.
  • the first device may determine K according to the protocol.
  • the first device may determine the minimum value of K determined through negotiation and K specified in the protocol as the K to be used.
  • K may be determined according to the length of the serial number.
  • K 2 ⁇ (L-1), where L is the length of SN.
  • L is the length of SN.
  • K 2 ⁇ (L-1)
  • L is the length of SN.
  • K 2
  • the value range of SN is an integer of 0-7
  • the value range of SN is an integer of 0-15
  • the priority of any one of the fourth data packets is greater than the priority of any one of the third data packets.
  • the out-of-order transmission method is adopted. In this way, when a low priority data packet needs to be retransmitted, a sending opportunity can be provided for a high priority data packet, and at the same time, it is ensured that the low priority data packet will not always be preempted by a high priority data packet, thereby Taking into account the transmission of high-priority data packets and low-priority data packets.
  • the priority of the data packet with a larger sequence number that needs to be sent for the first time is the same as the priority of the data packet with a smaller sequence number that needs to be retransmitted, since the data packets have the same priority, the data packet with a larger sequence number needs to be sent
  • the priority is to wait for the data packet with a smaller sequence number that needs to be retransmitted before retransmitting, so the impact of retransmission is small, so the data packet with a larger sequence number needs to be sent for the first time before the data packet with a smaller sequence number that needs to be retransmitted After the retransmission, the transmission is performed again.
  • the sequence number of any one of the fourth data packets belongs to the first sequence number section
  • the sequence number of any one of the third data packets belongs to the second sequence number section
  • the sequence number of the first The priority corresponding to a serial number section is higher than the priority corresponding to the second serial number section
  • the serial number included in the first serial number section is the same as the sequence number included in the second serial number section number is different.
  • high-priority data packets and low-priority data packets can be distinguished by the sequence number, so that when the sequence numbers of the data packets belong to different sequence number segments, the data packets are sent in an out-of-order transmission mode, thereby Provide sending opportunities for high-priority data packets to improve user experience of high-priority services.
  • the first device taking the value range of the serial number from 0 to 7 as an example, 0 to 3 may be determined as the second serial number segment, and 4 to 7 may be determined as the first serial number segment.
  • the first device can use the data packet 4 as the fourth data packet instead of the data packet 2 and the data packet 3 as the fourth data packet, thereby ensuring the transmission of high-priority data packets.
  • the first device will not use data packet 5 as the fourth data packet.
  • the communication method provided by the embodiment of the present application can take into account the transmission of high-priority data packets and low-priority data packets. At the same time, the data transmission efficiency is improved.
  • the first data transmission manner may be determined by the first device.
  • the first device may determine the first data transmission according to one or more of its own buffer attributes (such as buffer size, send data buffer size, etc.), energy consumption requirements of the first device, etc. Way.
  • the first device may also combine the attributes of the buffer area of the second device sent to it by the second device (for example, the size of the buffer area, the size of the received data buffer area, etc.), the energy consumption requirements of the second device, etc.
  • One or more of determines the first data transfer method For example, in a scenario where the buffer area is small and the energy saving requirements of the device are high, the first device may use the sequential sending method; otherwise, the out-of-order sending method may be used.
  • the first device may send first information to the second device, where the first information is used to indicate a data transmission mode expected by the first device or a data transmission mode supported by the first device.
  • the master node refers to the party that can search for other communication devices and actively establish a connection, while the slave node cannot actively establish a connection and can only wait for the master node to connect itself.
  • a master node can connect multiple slave nodes.
  • the first data transmission manner may be configured by the second device.
  • the first data transmission mode adopted by the first device is configured by the second device through the first configuration information.
  • the second device may determine the first data transmission mode according to one or more items of buffer properties and energy consumption requirements, and send the first configuration information including the first data transmission mode to the first device.
  • the process of the second device determining the first data transmission mode according to one or more items of buffer attributes, energy consumption requirements, etc. The process will not be repeated here.
  • the first device may send first information to the second device, where the first information is used to indicate a data transmission mode expected by the first device or a data transmission mode supported by the first device.
  • the second device may determine the first data transmission manner based on the first information.
  • the second device may send the first configuration information indicating the first data transmission manner to the first device.
  • the first device receives the first configuration information from the second device, and determines a first data transmission mode based on the first configuration information.
  • the second device may determine the sequential transmission mode as the first data transmission mode.
  • the second device may determine the out-of-order transmission mode as the first data transmission mode.
  • the first device supports both the in-order transmission mode and the out-of-order transmission mode.
  • the second device may determine the first data transmission mode, for example, determine the first data transmission mode according to the first data feedback mode.
  • the second device may determine the out-of-order transmission mode as the first data transmission mode, so as to take into account the need to wait for the data packet with a larger sequence number to be sent for the first time. Retransmission of packets with lower sequence numbers.
  • the first data feedback mode is batch feedback
  • the second device may determine the sequential sending mode as the first data transmission mode; if the buffer area of the second device is relatively large, Then the second device may determine the out-of-sequence transmission mode as the first data transmission mode.
  • the second device can also determine and configure the first data transmission mode in other ways, for example, the above-mentioned buffer attributes based on the second device (for example, buffer size, received data buffer size, etc.), the second device's Energy consumption requirements, etc., are not limited in this embodiment of the present application.
  • the first data transmission manner may be preconfigured or defined in the first device.
  • the first device does not need to select, but sends one or more data packets to the second device according to the first data transmission mode. In this way, it is beneficial to reduce the equipment cost.
  • Step S406 the second device receives one or more data packets from the first device.
  • the first device after the first device determines at least one first data packet expected by the second device, it can determine one or Multiple data packets, instead of simply sending the expected first data packet to the second device, increases the possibility of data packets sent by the first device, improves the flexibility of data transmission, and improves communication performance. For example, when the second device expects the first device to retransmit the first data packet with a smaller sequence number, if there is a data packet with a larger sequence number to be transmitted, the first device sends a data packet based on the first data transmission method.
  • One or more data packets can include a data packet with a larger sequence number, so that the data packet with a larger sequence number is not blocked by the data packet with a smaller sequence number that needs to be retransmitted, and the data packet with a larger sequence number is guaranteed. Packet transmission, thus improving the user experience. It can be seen that in this process, the possibility of data packets sent by the first device is increased, the flexibility of data transmission is improved, and the communication performance is improved. In addition, when the second device expects the first device to retransmit the first data packet with a smaller sequence number, if there is a data packet with a larger sequence number to be transmitted, the first device sends one or more data packets based on the first data transmission method.
  • a data packet can still include a data packet with a smaller sequence number that needs to be retransmitted, so that the retransmitted data packet with a smaller sequence number will not be preempted by the data packet with a larger sequence number, thereby ensuring the sequence number.
  • the retransmission of smaller data packets saves storage resources and energy consumption at the sending end (i.e. the first device) and the receiving end (i.e. the second device), and improves the short-distance communication equipment with low cost and low power consumption. applicability.
  • the first data transmission mode includes a sequential transmission mode and an out-of-order transmission mode
  • the first data feedback mode includes a single-packet feedback mode and a batch feedback mode.
  • four combinations are produced, namely: the combination of sequential sending mode and single-packet feedback mode, the combination of sequential sending mode and batch feedback mode, the combination of out-of-order sending mode and single-packet feedback mode, and the combination of out-of-order sending mode and A combination of batch feedback methods.
  • the sequential sending method and the single-packet feedback method are adopted (see Fig. 1a, Fig. 1b and Fig. 1c). Packets with higher sequence numbers cannot be sent, so packets with higher sequence numbers waiting to be sent first are blocked by packets with lower sequence numbers that need to be resent.
  • two methods of batch feedback and out-of-order transmission are proposed. Through batch feedback, the first device can send subsequent data packets without the need for the sent data packets to be successfully received or discarded.
  • providing a sending opportunity for a data packet with a larger sequence number; sending out of sequence can cause the first device to disrupt the sending order, and also provide a sending opportunity for a data packet with a larger sequence number. It can be seen that both batch feedback and out-of-sequence transmission can reduce the situation that a data packet with a larger sequence number waiting to be sent for the first time will be blocked by a data packet with a smaller sequence number that needs to be retransmitted.
  • the communication method provided by the embodiment of the present application can realize the combination of the sequential sending method and the batch feedback method, the combination of the out-of-order sending method and the single-packet feedback method, and the combination of the out-of-order sending method and the batch feedback method .
  • the first data transmission mode is a sequential transmission mode
  • the first data feedback mode is a batch feedback mode
  • the at least one first data packet expected by the second device includes one or more seventh data packets.
  • the one or more seventh data packets represent at least one data packet sent by the first device in step S401, which is unsuccessfully received by the second device.
  • the one or more data packets sent by the first device to the second device include multiple second data packets.
  • the sequence numbers of the multiple second data packets are continuous, and the data packet with the smallest sequence number among the multiple second data packets is the third data packet.
  • the third data packet belongs to at least one data packet sent by the first device in step S401, and the first device has not received confirmation feedback for the third data packet.
  • the difference between the sequence number N of each second data packet in the at least one second data packet and the sequence number M of each third data packet is less than or equal to K.
  • K is pre-configured or defined.
  • N, M and K are integers greater than or equal to 0.
  • the sequence number of the next batch of data packets may be smaller than the sequence number of the previous batch of data packets. Therefore, in a possible implementation manner, the difference between the sequence number N of the second data packet and the sequence number M of the third data packet may be expressed as abs(N-M), that is, the absolute value of N-M.
  • K is stipulated in a protocol, or K is configured for the first device by the second device through configuration information.
  • the fact that the first device has not received the acknowledgment feedback for the third data packet includes that the first device has received a NACK for the first data packet or that the first device has not received an ACK for the first data packet within a certain period of time.
  • Fig. 5a shows an exemplary schematic diagram of data packets in the cache area of the first device in the embodiment of the present application.
  • the SNs corresponding to packet 0, packet 1, packet 2, packet 3, packet 4, packet 5, packet 6, and packet 7 are 0, 1, 2, 3, 4, 5, 6 and 7.
  • K is 3.
  • Fig. 5b shows a flow chart of the communication method provided by the embodiment of the present application in the scenario of combining the sequential sending mode and the batch feedback mode.
  • the communication method includes:
  • step S501 the first device sends data packet 0, data packet 1, data packet 2 and data packet 3 to the second device.
  • step S502 the second device has received data packet 0 and data packet 2, but has not received data packet 1 and data packet 3.
  • step S503 the second device sends indication information to the first device, and the indication information is 1010.
  • step S504 after receiving the indication information from the second device, the first device confirms that the data packet 1 and the data packet 3 are the first data packets expected by the second device.
  • step S505 the first device determines that the data packet 1, the data packet 2, the data packet 3 and the data packet 4 are the second data packets.
  • the first device can determine that the data packet 1 and the data packet 3 are the first data packets expected by the second device.
  • the indication information received by the first device is 1010, indicating that the second device has not successfully received the data packet 1 and the data packet 3 .
  • the first device may determine that the confirmation feedback for the data packet 1 and the data packet 3 has not been received. Therefore, the first device can confirm that the data packet 1 and the data packet 3 are the third data packet.
  • the sequence number of the third data packet includes 1 and 3, and the data packet with the smallest sequence number in the third data packet is data packet 1.
  • the data packet with the smallest sequence number among the multiple second data packets is the data packet with the smallest sequence number among the third data packets, and each of the at least one second data packets
  • the difference between the sequence number N of the second data packet and the sequence number M of the third data packet with the smallest sequence number among the third data packets is less than or equal to K. Since the data packet 1 is the data packet with the smallest sequence number among the third data packets, the data packet 1 is the data packet with the smallest sequence number among the plurality of second data packets.
  • the first device can determine the plurality of second data packets as: data packet 1, data packet 2, data packet 3, and data packet 4.
  • step S506 the first device sends data packet 1, data packet 2, data packet 3 and data packet 4 to the second device.
  • the first device although the second device expects data packet 1 and data packet 3, the first device not only sends data packet 1 and data packet 3 to the second device, but also sends data packet 4 and data Pack 5. In this way, a sending opportunity is provided for the data packet 4 with a larger sequence number, so that the data packet 4 is not blocked due to the retransmission of the data packet 1 and the data packet 3. At the same time, by still sending the data packet 1 and the data packet 3, a guarantee is provided for the retransmission of the data packet that needs to be retransmitted, so that the sending opportunity will not be preempted by the data packet with a larger sequence number.
  • the transmission of the data packet with a larger sequence number waiting to be sent for the first time and the data packet with a smaller sequence number that needs to be retransmitted are taken into account.
  • this method does not disrupt the sending sequence of data, and the second device does not need to store more data packets due to waiting for data packet rearrangement, which saves storage resources and energy consumption of the second device.
  • data packet 4 when the priority of data packet 4 is higher than that of data packet 1 and data packet 3, data packet 4 does not need to wait for data packet 1 and data packet 3 to be retransmitted before sending, ensuring high priority Level data packet transmission.
  • the low-priority data packet will not always be preempted by the high-priority data packet, thereby ensuring the transmission of the low-priority data packet.
  • the first data transmission mode is an out-of-sequence transmission mode
  • the first data feedback mode is a single-packet feedback mode
  • the at least one first data packet expected by the second device includes a fifth data packet.
  • the fifth data packet represents the data packet with the smallest sequence number among the at least one data packet sent by the first device in step S401 but not successfully received by the second device.
  • the one or more data packets sent by the first device to the second device include a fourth data packet, and the sequence number of the fourth data packet is greater than the sequence number in at least one third data packet
  • the sequence number of the third data packet with the largest number, the difference between the sequence number P of any one of the fourth data packets and the sequence number M of each third data packet is less than or equal to K.
  • the third data packet belongs to at least one data packet sent in step S401, and the first device has not received confirmation feedback for the third data packet.
  • Fig. 5c shows a flow chart of a communication method provided by an embodiment of the present application in a scenario where an out-of-sequence sending manner and a single-packet feedback manner are combined.
  • the communication method includes:
  • step S601 the first device sends data packet 0 and data packet 1 to the second device.
  • step S602 the second device has received data packet 0, but has not received data packet 1.
  • step S603 the second device sends indication information to the first device, and the sequence number in the indication information is 1.
  • step S604 after receiving the indication information from the second device, the first device determines that the data packet 1 is the first data packet expected by the second device.
  • data packet 1 is the first data packet expected by the second device.
  • the indication information sent by the second device to the first device may include the sequence number of the data packet 1, that is, 1.
  • the first device may determine that no acknowledgment feedback for data packet 1 has been received. Therefore, the first device can confirm that the data packet 1 is the third data packet. At this time, the sequence number of the third data packet is 1.
  • the difference between the sequence number P of any fourth data packet and the sequence number M of the third data packet is less than or equal to K. Since the sequence number of the third data packet is 1, the sequence number of the fourth data packet needs to be greater than 1. For data packet 2, its sequence number (being 2) is greater than the sequence number (being 1) of the third data packet with the largest sequence number in the third data packet, and its sequence number P (being 2) is the same as every third data packet.
  • the data packet 2 can be used as the fourth data packet.
  • the data packet 3 and the data packet 4 may also be used as the fourth data packet. Data packet 5, data packet 6 and data packet 7 cannot be used as the fourth data packet. Therefore, the second device may take the data packet 2, the data packet 3 and the data packet 4 as the fourth data packet.
  • step S605 the first device determines that the data packet 2, the data packet 3 and the data packet 4 are the fourth data packet.
  • step S606 the first device sends data packet 1 to the second device after sending data packet 2, data packet 3, and data packet 4 to the second device.
  • the first data transmission mode is an out-of-order transmission mode
  • the first data feedback mode is a batch feedback mode
  • the at least one first data packet expected by the second device includes one or more seventh data packets.
  • the one or more seventh data packets represent at least one data packet sent by the first device in step S401, which is unsuccessfully received by the second device.
  • the one or more data packets sent by the first device to the second device include a plurality of fourth data packets, the sequence numbers of the fourth data packets are greater than the sequence numbers of the third data packets , the difference between the sequence number P of the fourth data packet and the sequence number M of the third data packet is less than or equal to K.
  • the third data packet belongs to at least one data packet sent in step S401, and the first device has not received confirmation feedback for the third data packet.
  • K is preconfigured or defined.
  • P, M and K are integers greater than or equal to 0.
  • Fig. 5d shows a flow chart of the communication method provided by the embodiment of the present application in the scenario where the out-of-sequence sending mode and the batch feedback mode are combined.
  • the communication method includes:
  • step S701 the first device sends data packet 0, data packet 1, data packet 2 and data packet 3 to the second device.
  • step S702 the second device has received data packet 0 and data packet 2, but has not received data packet 1 and data packet 3.
  • step S703 the second device sends indication information to the first device, and the indication information is 1010.
  • step S704 after receiving the indication information from the second device, the first device confirms that the data packet 1 and the data packet 3 are the first data packets expected by the second device.
  • step S705 the first device determines that the data packet 4 is the fourth data packet.
  • data packet 1 and data packet 3 are the first data packets expected by the second device.
  • the indication information sent by the second device to the first device is 1010, which indicates that the second device has failed to receive the data packet 1 and the data packet 3 .
  • the first device may determine that no acknowledgment feedback for the data packet 1 and the data packet 3 has been received. Therefore, the first device can confirm that the data packet 1 and the data packet 3 are the third data packet.
  • the sequence number of the third data packet includes 1 and 3.
  • the sequence number of any fourth data packet is greater than the sequence number of the third data packet with the largest sequence number in at least one third data packet
  • the sequence number P of any fourth data packet and the sequence of each third data packet The difference of number M is less than or equal to K. Since the sequence number of the third data packet includes 1 and 3, the sequence number of the fourth data packet needs to be greater than 3. For data packets 0 to 3, their sequence numbers are less than 3, so they cannot be used as the fourth data packet. For data packet 4, its sequence number (being 4) is greater than the sequence number M (including 1 and 3) of the third data packet, and its sequence number P (being 4) is the same as the sequence number M (including 1 and 3) of the third data packet 3) The difference is less than or equal to K (3).
  • data packet 4 can be used as the fourth data packet.
  • data packet 5 the difference between its serial number P (which is 5) and the serial number M (including 1 and 3) of the third data packet is greater than K (which is 3), therefore, data packet 5 cannot be used as the fourth data pack.
  • data packet 6 and data packet 7 cannot be used as the fourth data packet.
  • the first device may only use the sequence number of the data packet with the smallest sequence number among the at least one third data packet and the sequence number of any fourth data packet to perform an operation to determine which data packets can be used as the fourth data packet. data pack.
  • step S706 the first device sends data packet 1, data packet 3, data packet 4 and data packet 5 to the second device.
  • the number of data packets that the first device can continuously transmit to the second device is 4, the number of the fourth data packets is smaller than the data packets that the first device can continuously transmit to the second device, and therefore, the first device transmits data packets to the second device.
  • the one or more data packets sent by the second device may also include data packets "data packet 1" and "data packet 3" that need to be retransmitted.
  • Data packets may also include data packets 5 .
  • the second device although the second device expects the data packet 1 and the data packet 3, the first device sends the data packet 4 and the data packet 5 to the second device.
  • a data packet with a larger sequence number is provided with an opportunity to be sent.
  • the priority of the data packet with a larger sequence number is relatively high, it provides a sending opportunity for the data packet with a higher priority, and provides guarantee for the high priority service.
  • one or more data packets sent by the first device to the second device need their serial numbers to meet certain conditions, such as satisfying that the difference between the serial numbers of the third data packet and the third data packet is less than or equal to K, satisfying continuity, satisfying Greater than the sequence number of the third packet, etc.
  • This mode belongs to the data packet sent under the control of the first device.
  • the first device may completely send at least one first data packet expected by the second device. This possible implementation is described below.
  • the at least one first data packet expected by the second device includes a sixth data packet, wherein the sixth data packet represents a priority higher than the priority of the fifth packet.
  • the one or more data packets sent by the first device to the second device include a sixth data packet, which is the sixth data packet indicated in the indication information.
  • the second device determines whether the expected data packet is a retransmitted data packet or a high-priority data packet. In this way, both low-priority data packets and high-priority data packets can be considered.
  • step S401 when the first device sends at least one data packet to the second device, the data packet carries a sequence number of a high-priority data packet. In this way, the second device can know whether there is a high-priority data packet when receiving any data packet, so as to decide whether to resend the data packet or send the high-priority data packet first.
  • 0 to 3 can be determined as the second serial number section
  • 4 to 7 can be determined as the first serial number section
  • the first serial number section The priority corresponding to the segment is higher than the priority corresponding to the second serial number segment, and the serial number included in the first serial number segment is different from the serial number included in the second serial number segment.
  • the second device If the second device expects to receive a high-priority data packet, it can set NESN to 4, so that the first device will send a high-priority data packet in the next transmission. At this time, the first device does not need to determine the data packet with a sequence number of 4 Whether the serial number meets certain conditions. If the second device does not expect to receive high priority data packets, it may set NESN to 2 (ie the sequence number of the next data packet). In this way, through the flexible selection of the second device, both the transmission of low-priority data packets and high-priority data packets can be considered.
  • the NESN stored in the second device may be kept as the smallest sequence number of the unreceived data packet, and the data packet may be discarded after a certain period of time. Increment NESN by 1. Or the smallest sequence number to add to the next unreceived packet.
  • FIG. 6 shows a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device may be the first device 21 shown in FIG. 2 b , and the communication device may be deployed in the electronic device shown in FIG. 3 .
  • the communication device 80 may include: a sending module 81, configured to send at least one data packet to a second device; a receiving module 82, configured to receive indication information from the second device, the indication information It is used to indicate at least one first data packet expected by the second device; the sending module 81 is also used to send one or more data packets to the second device based on the first data transmission mode.
  • the first device after the first device determines at least one first data packet expected by the second device, it can determine a packet sent to the second device in combination with the expected situation of the second device and the first data transmission method. Or multiple data packets, instead of simply sending the expected first data packet to the second device, which increases the possibility of the data packet sent by the first device, improves the flexibility of data transmission, and improves the communication performance. Specifically, there are data packets expected to be retransmitted by the second device and data packets waiting to be sent for the first time in the first device, and the sequence numbers of the data packets to be retransmitted are smaller than the sequence numbers of the data packets waiting to be sent for the first time.
  • the one or more data packets sent by the first device based on the first data transmission method may include a data packet with a larger sequence number waiting to be sent for the first time, so that it does not need to wait for the data packet that needs to be retransmitted to be successfully retransmitted or Sending after discarding shortens the waiting time for the first sent packet with a higher sequence number.
  • the one or more data packets sent by the first device based on the first data transmission method may also include data packets that need to be retransmitted, so that the retransmitted data packets will not be waited for by the one with the higher sequence number sent for the first time.
  • the data packet has been preempting the sending opportunity, thereby ensuring the retransmission of the data packet with a smaller sequence number. Therefore, the communication method provided by the embodiment of the present application can take into account the transmission of the data packet with a larger sequence number waiting for the first transmission and the data packet with a smaller sequence number that needs to be retransmitted. Further, since the time of waiting for the data packet to be sent is saved, the storage time in the sending end and the receiving end of a data packet is reduced, so the communication method provided by the embodiment of the present application can also save the storage resources and energy of the sending end and the receiving end. consumption, which improves the applicability of low-cost, low-power short-distance communication equipment.
  • the first data transmission mode is a sequential transmission mode;
  • the one or more data packets include multiple second data packets, the sequence numbers of the multiple second data packets are continuous, and the The data packet with the smallest sequence number among the plurality of second data packets is the third data packet with the smallest sequence number among at least one third data packet; wherein, for any third data packet, the third data packet belongs to the at least one third data packet. one data packet, and the first device has not received an acknowledgment feedback for the third data packet.
  • the difference between the sequence number N of each second data packet in the at least one second data packet and the sequence number M of each third data packet is less than or equal to K, and the K is preconfigured or As defined, N, M and K are integers greater than or equal to 0.
  • the first data transmission mode is an out-of-order transmission mode;
  • the one or more data packets include one or more fourth data packets, and any sequence of the fourth data packets number is greater than the sequence number of the third data packet with the largest sequence number in at least one third data packet, and the difference between the sequence number P of any one of the fourth data packets and the sequence number M of each of the third data packets is less than Or equal to K, the K is pre-configured or defined; wherein, for any third data packet, the third data packet belongs to the at least one data packet, and the first device has not received the third data packet for the third The acknowledgment feedback of the data packet, P, M and K are integers greater than or equal to 0.
  • the priority of any one of the fourth data packets is greater than the priority of any one of the third data packets.
  • the sequence number of any one of the fourth data packets belongs to the first sequence number section
  • the sequence number of any one of the third data packets belongs to the second sequence number section
  • the sequence number of the first The priority corresponding to a serial number section is higher than the priority corresponding to the second serial number section
  • the serial number included in the first serial number section is the same as the sequence number included in the second serial number section number is different.
  • the sending module is further configured to send first information to the second device, where the first information is used to indicate the desired data transmission mode of the first device or the first device Supported data transfer methods.
  • the receiving module is further configured to receive first configuration information from the second device, where the first configuration information is used to configure the first data transmission manner.
  • the K is configured or defined based on the buffer attribute of the first device and the buffer attribute of the second device; or, the K is configured or defined based on the buffer attribute of the first device
  • the transmit window size and the receive window size of the second means are configured or defined.
  • FIG. 7 shows a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device may be the second device 22 shown in FIG. 2 b , and the communication device may be deployed on the electronic device shown in FIG. 3 .
  • the communication device 90 may include: a receiving module 91, configured to receive at least one data packet from the first device; a sending module 92, configured to send the packet to the first device based on the first data feedback mode.
  • indication information the indication information is used to indicate at least one first data packet expected by the second device; the receiving module 91 is further configured to receive one or more data packets from the first device.
  • the second device may determine to feed back one or more expected first data packets to the first device based on the first data feedback manner, instead of simply feeding back ACK or NACK to the first device.
  • the optional range and optional mode of the data packets sent by the first device are increased, so that the first device may send data packets in batches or out of order.
  • a sending opportunity is provided for a data packet with a larger sequence number, so that the data packet with a larger sequence number does not need to wait for the acknowledgment feedback of the data packet with a smaller sequence number. It can be sent. In this way, the data packet with a larger sequence number will not be blocked due to the retransmission of the data packet with a smaller sequence number, which ensures the transmission of the data packet with a larger sequence number and improves user experience.
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a fifth data packet, and the fifth data packet represents the at least one data packet The packet with the lowest sequence number among the unsuccessfully received packets.
  • the first data feedback method is a batch feedback method; the at least one first data packet includes one or more seventh data packets, and the one or more seventh data packets represent Unsuccessfully received data packets in the at least one data packet.
  • the first data feedback mode is a single-packet feedback mode; the at least one first data packet includes a sixth data packet, and the priority of the sixth data packet is higher than that of the The priority of the fifth packet.
  • the receiving module is further configured to receive first information from the first device, where the first information is used to indicate the data transmission mode expected by the first device or the first A data transmission method supported by the device.
  • the sending module is further configured to send first configuration information to the first device, where the first configuration information is used to configure a first data transmission mode, and the first data transmission mode Send in order or out of order.
  • An embodiment of the present application provides a communication device, including: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions.
  • An embodiment of the present application also provides a communication device, including: at least one processor and an interface circuit, wherein the at least one processor is configured to implement the above method through the interface circuit.
  • An embodiment of the present application provides an electronic device, including: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions.
  • An embodiment of the present application also provides a terminal, including: at least one processor and an interface circuit, wherein the at least one processor is configured to implement the foregoing method through the interface circuit.
  • the terminal includes but is not limited to smart manufacturing devices, smart wearable devices, smart transportation devices, or smart home devices.
  • smart manufacturing equipment can be CNC machine tools and smart welding machines, etc.
  • smart wearable devices can be sports watches, smart glasses, and Bluetooth headsets, etc.
  • smart transportation equipment can be For smart sockets, smart TVs, smart refrigerators and smart washing machines, etc.
  • An embodiment of the present application provides a non-volatile computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is realized.
  • An embodiment of the present application provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium bearing computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer-readable storage media include: portable computer disk, hard disk, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), erasable Electrically Programmable Read-Only-Memory (EPROM or flash memory), Static Random-Access Memory (Static Random-Access Memory, SRAM), Portable Compression Disk Read-Only Memory (Compact Disc Read-Only Memory, CD -ROM), Digital Video Disc (DVD), memory sticks, floppy disks, mechanically encoded devices such as punched cards or raised structures in grooves with instructions stored thereon, and any suitable combination of the foregoing .
  • RAM Random Access Memory
  • ROM read only memory
  • EPROM or flash memory erasable Electrically Programmable Read-Only-Memory
  • Static Random-Access Memory SRAM
  • Portable Compression Disk Read-Only Memory Compact Disc Read-Only Memory
  • CD -ROM Compact Disc Read-Only Memory
  • DVD Digital Video Disc
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented with hardware (such as circuits or ASIC (Application Specific Integrated Circuit, application-specific integrated circuit)), or can be implemented with a combination of hardware and software, such as firmware.
  • hardware such as circuits or ASIC (Application Specific Integrated Circuit, application-specific integrated circuit)
  • firmware such as firmware

Landscapes

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

Abstract

本申请涉及一种通信方法及装置,所述方法包括:第一装置向第二装置发送至少一个数据包;第一装置接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;第一装置基于顺序发送方式或者乱序发送方式,向所述第二装置发送一个或多个数据包。本申请实施例提供的通信方法及装置能够兼顾第二装置的期望接收情况以及不同的发送方式进行数据包的传输,提高了数据传输的灵活性,改善了通信性能。

Description

通信方法及装置
本申请要求于2021年07月02日提交中国专利局、申请号为202110750224.4、申请名称为“通信方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种通信方法及装置。
背景技术
通信技术在人们的日常生活中发挥着重要的作用。以短距离通信业务为例,在智能终端、智能家居、智能制造以及智能汽车等领域都有短距离通信的需求。短距离通信技术包括蓝牙技术、超宽带(Ultra Wide Band,UWB)技术、ZigBee(一种低速的短距离无线通信技术)以及无线保真(Wireless Fidelity,WiFi)技术等。短距离通信技术由于其低功耗、低成本的特点,在鼠标、键盘、可穿戴设备,以及真无线立体声(True Wireless Stereo,TWS)耳机等的连接方面有着广泛应用。
在实际的通信中,通信设备上可能存在多种不同类型的业务,例如短信业务、通话业务和歌曲业务等,如何兼顾各种业务的传输需求,同时提高通信系统的灵活性以及通信性能是亟需解决的技术问题。
发明内容
有鉴于此,提出了一种通信方法及装置,能够提高数据传输的灵活性,改善通信性能。
第一方面,本申请的实施例提供了一种通信方法,所述方法包括:向第二装置发送至少一个数据包;接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;基于第一数据传输方式,向所述第二装置发送一个或多个数据包。
在本申请实施例中,在第一装置确定了第二装置所期望的至少一个第一数据包后,可以结合第二装置的期望情况以及第一数据传输方式,确定向第二装置发送的一个或多个数据包,而不是简单的向第二装置发送其所期望的第一数据包,增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。具体的,第一装置中同时存在第二装置期望重传的数据包,以及等待首次发送的数据包,且需要重传的数据包的序列号小于等待首次发送的数据包的序列号。一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中可以包括等待首次发送的序列号较大的数据包,从而使其无需等待需要重传的数据包重传成功或者丢弃后再发送,缩短了等待首次发送的序列号较大的数据包的等待时间。另一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中还可以包括需要重传的数据包,从而使重传数据包不会被等待首次发送的序列号较大的数据包一直抢占发送机会,从而保障了序列号较小的数据包的重传。可见,本申请实施例提供的方法增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。进一步的,由于节省了数据包等待发送的时间,因此减少了一个数据包发送端和接收端中的存储时间,因此本申请实施例提供的通信方法还可以节省发送端和接收端的存储资源和能耗,提高了对低成本、低功耗的短 距离通信设备的适用性。
根据第一方面,在所述通信方法的第一种可能的实现方式中,第一数据传输方式为顺序发送方式;所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
在本申请实施例中,一方面,通过连续发送多个第二数据包,使得后一数据包无需等待前一数据包的反馈结果即可发送出去,减少了后续数据包的等待发送的时间;另一方面,始终保障了数据的顺序发送,第二装置不用因等待数据包重排而存储较多的数据包,节省了第二装置的存储资源和能耗。
根据第一方面,在所述通信方法的第二种可能的实现方式中,所述第一数据传输方式为乱序发送方式;所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;其中,对于任意一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈,P、M和K为大于或者等于0的整数。
在本申请实施例中,采用乱序发送方式可以使第一装置打乱数据包的发送顺序,使得等待首次发送的序列号较大的数据包无需等待需要重传的序列号较小的数据包被成功接收或者被丢弃后即可进行发送,尽快为等待首次发送的序列号较大的数据包提供了发送机会,缩短了等待首次发送的序列号较大的数据包的等待时间。同时,通过限制在重传序列号较小的数据包之前,可发送的数据包的序列号的范围,使得需要重传的数据包不会一直被序列号较大的数据包抢占发送机会,为需要重传的数据包提供了发送机会。因此,本申请实施例中,可以兼顾序列号较小的数据包和序列号较大的数据包的传输,提高数据传输效率。
根据第一方面的第二种可能的实现方式,在所述通信方法的第三种可能的实现方式中,任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。
在本申请实施例中,通过乱序发送可以使第一装置灵活选择发送的数据包,在同时存在需要重传的低优先级的数据包与等待首次发送的高优先级的数据包时,高优先级数据包无需等待低优先级的数据包被成功接收或者被丢弃即可发送,缩短了高优先级的数据包的等待时间,同时保障需要重传的低优先级的数据包不会一直被高优先级的数据包抢占发送机会,兼顾了低优先级的数据包和高优先级的数据的传输,提高了数据传输效率。
根据第一方面的第三种可能的实现方式,在所述通信方法的第四种可能的实现方式中,任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。
在本申请实施例中,通过为不同优先级的数据包分配不同序列号区段的序列号,使得序列号具有优先级属性,有利于提升决策的智能性。
根据第一方面,或者以上第一方面的任意一种可能的实现方式,在所述通信方法的第五种可能的实现方式中,所述方法还包括:接收来自所述第二装置的第一配置信息,所述第一配置信息用于配置所述第一数据传输方式。
在本申请实施例中,第一装置采用的第一数据传输方式,可以是由第二装置配置的,这样,有利于降低第一装置的复杂度,从而降低第一装置的成本。
根据第一方面,或者第一方面的第一种可能的实现方式至第五种可能的实现方式中任意一种,在所述通信方法的第六种可能的实现方式中,所述方法还包括:向所述第二装置发送第一信息,所述第一信息用于指示第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
在本申请实施例中,第一装置可以向第二装置提供其所期望的数据传输方式或者其所支持的数据传输方式,一方面有利于第二装置确定合适的第一数据反馈方式,另一方面有利于第二装置为第一装置确定合适的第一数据传输方式,进而为数据传输提供了保障。
根据第一方面的第二种可能的实现方式至第四种可能的实现方式中的任意一种,在所述通信方法的第七种可能的实现方式中,所述K为基于所述第一装置的缓存区属性和/或所述第二装置的缓存区属性配置或者定义的;或者,所述K为基于所述第一装置的发送窗大小和/或所述第二装置的接收窗大小配置或者定义的。
第二方面,本申请的实施例提供了一种通信方法,所述方法包括:接收来自第一装置的至少一个数据包;基于第一数据反馈方式,向所述第一装置发送指示信息,所述指示信息用于指示第二装置所期望的至少一个第一数据包;接收来自所述第一装置的一个或多个数据包。
在本申请实施例中,第二装置可以基于第一数据反馈方式确定向第一装置反馈一个或多个期望的第一数据包,而不是简单的向第一装置反馈ACK或者NACK。在本申请实施例中,通过灵活的数据反馈,增加了第一装置发送的数据包的可选范围以及可选方式,使得第一装置具有批量发送或者乱序发送数据包的可能性。在序列号较小的数据包需要重传的情况下,为序列号较大的数据包提供了发送机会,使得序列号较大的数据包无需等待对序列号较小的数据包的确认反馈即可进行发送,这样,序列号较大的数据包不会因序列号较小的数据包的重传而阻断,保障了序列号较大的数据包的发送,提升了用户体验。
根据第二方面,在所述通信方法的第一种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括第五数据包,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
在本申请实施例中,接收端将未成功接收的数据包中序列号最小的数据包确定为期望接收到的第一数据包,使得发送端可以对接收端未成功接收的数据包进行重传。
根据第二方面,在所述通信方法的第二种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括一个第六数据包,所述第六数据包的优先级高于第五数据包的优先级,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
在本申请实施例中,接收端将优先级比未成功接收的数据包中序列号最小的数据包的优先级高的数据包确定为期望接收到的第一数据包,使得发送端可以优先发送优先级较高的数据包。
根据第二方面,在所述通信方法的第三种可能的实现方式中,所述第一数据反馈方式为批量反馈方式;所述至少一个第一数据包包括一个或多个第七数据包,所述一个或多个第七数据包表示所述至少一个数据包中未成功接收的数据包。
在本申请实施例中,接收端批量对数据包的接收情况进行反馈,使得发送端可以连续发 送多个数据包,从而使得发送端可以兼顾等待首次发送的序列号较大的数据包和需要重传的序列号较小的数据包的传输。
根据第二方面或者以上第二方面的任意一种可能的实现方式,在所述通信方法的第四种可能的实现方式中,所述方法还包括:向所述第一装置发送第一配置信息,所述第一配置信息用于配置第一数据传输方式,所述第一数据传输方式为顺序发送方式或者乱序发送方式。
根据第二方面的第四种可能的实现方式,在所述通信方法的第五种可能的实现方式中,所述方法还包括:接收来自所述第一装置的第一信息,所述第一信息用于指示所述第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
第三方面,本申请的实施例提供了一种通信装置,所述装置包括:发送模块,用于向第二装置发送至少一个数据包;接收模块,用于接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;所述发送模块,还用于基于第一数据传输方式,向所述第二装置发送一个或多个数据包。
根据第三方面,在所述通信装置的第一种可能的实现方式中,所述第一数据传输方式为顺序发送方式;所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
根据第三方面,在所述通信装置的第二种可能的实现方式中,所述第一数据传输方式为乱序发送方式;所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈,P、M和K为大于或者等于0的整数。
根据第三方面的第二种可能的实现方式,在所述通信装置的第三种可能的实现方式中,任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。
根据第三方面的第三种可能的实现方式,在所述通信装置的第四种可能的实现方式中,任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。
根据第三方面,或者以上第三方面的任意一种可能的实现方式,在所述通信装置的第五种可能的实现方式中,所述接收模块,还用于接收来自所述第二装置的第一配置信息,所述第一配置信息用于配置所述第一数据传输方式。
根据第三方面,或者第三方面的第一种可能的实现方式至第五种可能的实现方式中的任意一种,在所述通信装置的第六种可能的实现方式中,所述发送模块,还用于向所述第二装置发送第一信息,所述第一信息用于指示第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
根据第三方面的第二种可能的实现方式至第四种可能的实现方式中的任意一种,在所述通信装置的第七种可能的实现方式中,所述K为基于所述第一装置的缓存区属性和/或所述第二装置的缓存区属性配置或者定义的;或者,所述K为基于所述第一装置的发送窗大小和/ 或所述第二装置的接收窗大小配置或者定义的。
第四方面,本申请的实施例提供了一种通信装置,所述装置包括:接收模块,用于接收来自第一装置的至少一个数据包;发送模块,用于基于第一数据反馈方式,向所述第一装置发送指示信息,所述指示信息用于指示第二装置所期望的至少一个第一数据包;所述接收模块,还用于接收来自所述第一装置的一个或多个数据包。
根据第四方面,在所述通信装置的第一种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括第五数据包,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
根据第四方面,在所述通信装置的第二种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括一个第六数据包,所述第六数据包的优先级高于第五数据包的优先级,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
根据第四方面,在所述通信装置的第三种可能的实现方式中,所述第一数据反馈方式为批量反馈方式;所述至少一个第一数据包包括一个或多个第七数据包,所述一个或多个第七数据包表示所述至少一个数据包中未成功接收的数据包。
根据第四方面的或者以上第四方面的任意一种可能的实现方式,在所述通信装置的第四种可能的实现方式中,所述发送模块,还用于向所述第一装置发送第一配置信息,所述第一配置信息用于配置第一数据传输方式,所述第一数据传输方式为顺序发送方式或者乱序发送方式。
根据第四方面,或者以上第四方面的任意一种可能的实现方式,在所述通信装置的第五种可能的实现方式中,所述接收模块,还用于接收来自所述第一装置的第一信息,所述第一信息用于指示所述第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
第五方面,本申请的实施例提供了一种通信装置,该通信装置可以执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的通信方法,或者执行上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的通信方法。
第六方面,本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的通信法,或者执行上述第二方面或者第二方面的多种可能的实现方式中的一种或几种的通信方法。
本申请的这些和其他方面在以下(多个)实施例的描述中会更加简明易懂。
附图说明
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本申请的示例性实施例、特征和方面,并且用于解释本申请的原理。
图1a示出相关技术中通信方法的流程图;
图1b示出相关技术的通信方法中SN和NESN的变化示意图;
图1c示出相关技术的通信方法中SN和NESN的变化示意图;
图2a示出本申请实施例提供的通信方法的应用场景示意图;
图2b示出本申请实施例提供的通信系统的架构示意图;
图3示出本申请实施例的电子设备的结构示意图;
图4示出本申请实施例提供的通信方法的流程示意图;
图5a示出本申请实施例中第一装置的缓存区中数据包的示例性示意图;
图5b示出顺序发送方式和批量反馈方式相结合的场景下本申请实施例提供的通信方法的流程图;
图5c示出乱序发送方式和单包反馈方式相结合的场景下本申请实施例提供的通信方法的流程图;
图5d示出乱序发送方式和批量反馈方式相结合的场景下本申请实施例提供的通信方法的流程图;
图6示出本申请实施例提供的通信装置的结构示意图;
图7示出本申请实施例提供的通信装置的结构示意图。
具体实施方式
以下将参考附图详细说明本申请的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
另外,为了更好的说明本申请,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本申请同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本申请的主旨。
短距离通信设备一般为低成本、低功耗的设备,由于较大的缓存区会增加通信设备的成本且在缓存区存储较多的数据会导致通信设备耗电量较多,因此,通常短距离通信设备的缓存区较小,缓存区中可存储数据包的数量较小。因此,相关技术中通常采用顺序发送的方式进行数据传输。例如,在某些现有技术中,数据包采用顺序发送的形式进行发送,并通过序列号(Serial Number,SN)和期望序列号(Next Expected Serial Number,NESN)的相互关系对数据包重传进行控制。
具体的,发送端中存储并维护一个SN,接收端中存储并维护一个NESN。其中,SN和NESN的长度均为1比特位(即1bit),也就是说,SN和NESN的可选取值为0和1。发送端中存储的SN和接收端中存储的NESN均初始化为0。发送端中存储的SN用于指示发送端发送哪个数据包,接收端中存储的NESN用于指示接收端期待接收哪个数据包。发送端向接收端发送的数据包的包头中包括SN。接收端向发送端发送的反馈信息中包括NESN。
图1a示出相关技术中通信方法的流程图。如图1a所示,发送端按照本地存储的SN发送数据包,例如,本地存储的SN为0时,发送端发送包头中SN为0的数据包;本地存储的SN为1时,发送端发送包头中SN为1的数据包。接收端接收到来自发送端的数据包后,确定接收到的数据包中的SN与本地存储的NESN是否相同。在接收到的数据包中的SN与本地存储的NESN相同的情况下,表明接收端接收到了其期望接收到的数据包,接收端将本地存储的NESN 加1,并按照本地存储的NESN(即加1后的NESN)发送反馈信息(此时,发送的反馈信息可以称为ACK),以指示发送端发送新的数据包。在接收到的数据包中的SN与本地存储的NESN不同的情况下,表明接收端未接收到其期望接收到的数据包,接收端保持本地存储的NESN不变,并按照本地存储的NESN(即保持不变的NESN)发送反馈信息(此时,发送的反馈信息可以称为NACK),以指示发送端重传数据包。发送端接收反馈信息,确定反馈信息中的NESN与本地存储的SN是否相同。在接收到的反馈信息中的NESN与本地存储的SN相同的情况下,表明之前发送的数据包未被成功接收,发送端保持本地存储的SN不变,以重发数据包;在接收到的响应消息中的NESN与本地存储的SN不同的情况下,表明之前发送的数据包已被成功接收,发送端将本地存储的SN加1,以发送新的数据包。
在一种可选的是实现方式中,接收端向发送端发送的反馈信息可以包含在接收端向发送端发送的数据包的包头(header)中。
图1b示出相关技术的通信方法中SN和NESN的变化示意图。初始时,发送端本地存储的SN为0,接收端本地存储的NESN为0。发送端的缓存区中缓存的数据包有:数据包1和数据包2。其中,数据包1的包头中(简称为数据包1中)的SN为0,数据包2中的SN为1。如图1b所示,由于发送端本地存储的SN为0,数据包1中的SN为0,因此,在步骤S101中,发送端发送数据包1。在步骤S102中,接收端接收数据包1,经比较确定数据包1中的SN与本地存储的NESN相同(均为0),接收端将本地存储的NESN加1。也就是说,接收端中本地存储的NESN由0变为了1。此时,接收端可以生成NESN为1的反馈信息1。在步骤S103中,接收端发送反馈信息1。在步骤S104中,发送端接收反馈信息1,经比较确定反馈信息1中的NESN与本地存储的SN不同(前者为1,后者为0),发送端将本地存储的SN加1。也就是说,发送端中本地存储的SN由0变为了1。因此,发送端后续会发送SN为1的数据包,即数据包2。在步骤S105中,发送端发送数据包2。
图1c示出相关技术的通信方法中SN和NESN的变化示意图。如图1c所示,在步骤S101中,发送端发送数据包1。在步骤S106中,接收端在一定时间(可以按照需要进行设置,例如可以为30秒或者1分钟等)内未接收到数据包1,接收端保持本地存储的NESN不变(仍为0)。此时,接收端可以生成NESN为0的反馈信息2。在步骤S107中,接收端发送反馈信息2。在步骤S108中,发送端接收到反馈信息2,经比较确定反馈信息2中的NESN与本地存储的SN相同(均为0)或者在一定时间内未接收到针对数据包1的反馈信息,发送端保持本地存储的SN不变(仍为0)。因此,发送端后续会发送SN为0的数据包,即数据包1。在步骤S109中,发送端发送数据包1。若后续数据包1仍然未成功被接收端接收,则发送端则重复执行步骤S108和步骤S109,再次进行数据包1的重传。这就出现了数据包2被数据包1阻断的情况。这种情况下,发送端在数据包1被成功接收或者数据包1因达到最大重传次数被丢弃之后,才会传输数据包2。如果数据包2是高优先级业务的数据包,则难以保障高优先级业务的质量,影响用户体验。
由此可见,在相关技术中采用的顺序发送的方式中,当发送端正在重传数据包时,若有高优先级的数据包到来,发送端需要等待重传数据包被成功接收或者重传数据包因达到最大重传次数被丢弃之后,再传输该高优先级的数据包。这就出现了高优先级数据包被重传数据包阻断的情况,难以保障高优先级数据的传输,也就难以保障高优先级服务的质量,影响用户体验。另外,如果在高优先级数据包到来之后,发送端无条件传输高优先级数据包,又会 造成重传数据包被高优先级数据包一直抢占发送机会,从而出现重传数据包长时间存储在发送端的缓存中,占用发送端的存储资源,增加发送端的能耗的情况;同时,接收端中高优先级数据包因等待重传数据包进行排序而长时间存储在接收端的缓存中,从而出现占用接收端的存储资源,增加接收端的能耗的情况。
在本申请实施例中,在第一装置确定了第二装置所期望的至少一个第一数据包后,可以结合第二装置的期望情况以及第一数据传输方式,确定向第二装置发送的一个或多个数据包,而不是简单的向第二装置发送其所期望的第一数据包,增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。具体的,第一装置中同时存在第二装置期望重传的数据包,以及等待首次发送的数据包,且需要重传的数据包的序列号小于等待首次发送的数据包的序列号。一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中可以包括等待首次发送的序列号较大的数据包,从而使其无需等待需要重传的数据包重传成功或者丢弃后再发送,缩短了等待首次发送的序列号较大的数据包的等待时间。另一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中还可以包括需要重传的数据包,从而使重传数据包不会被等待首次发送的序列号较大的数据包一直抢占发送机会,从而保障了序列号较小的数据包的重传。可见,本申请实施例提供的方法增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。进一步的,由于节省了数据包等待发送的时间,因此减少了一个数据包发送端和接收端中的存储时间,因此本申请实施例提供的通信方法还可以节省发送端和接收端的存储资源和能耗,提高了对低成本、低功耗的短距离通信设备的适用性。
本申请实施例涉及的短距离通信设备包括且不限于鼠标、键盘、摄像头、无线耳机、可穿戴设备、路由器、智能家电(如冰箱、电饭煲、空调和洗衣机等)、智能插座以及传感器等低成本、低功耗的短距离通信设备。当然,手机、笔记本电脑、上网本和平板电脑等终端设备也具有短距离通信功能,可以作为短距离通信设备进行短距离通信。本申请实施例提供的通信方法也可以应用于这些短距离通信设备。本申请实施例对短距离通信的方式以及短距离通信设备不做限制。
图2a示出本申请实施例提供的通信方法的应用场景示意图。如图2a所示,路由器11、无线耳机12、摄像头13、智能手表14、平板电脑15、手机16以及笔记本电脑17等设备之间可以建立蓝牙等短距离无线通信连接。这些设备之间可以传输数据包。不同类型的业务的数据包的优先级可以不同。例如,语音业务的数据包的优先级高于数据业务的数据包的优先级,即时通信业务的优先级高于网页业务的优先级等。本申请实施例提供的通信方法,在上述设备之间传输数据包时,可以兼顾高优先级的数据包和低优先级的数据包的传输。
图2b示出本申请实施例提供的通信系统的架构示意图。如图2b所示,该通信系统包括第一装置21和第二装置22。其中,第一装置21可以部署在发送端,第二装置22可以部署在接收端。第一装置21可以向第二装置22发送至少一个数据包,接收来自第二装置22的指示信息,并基于第一数据传输方式,向第二装置22发送一个或多个数据包。
图3示出本申请实施例的电子设备的结构示意图。图3所示的电子设备可以作为本申请实施例提供的通信系统中的发送端或者接收端,可以用于部署图2b所示的第一装置21或者图2b所示的第二装置22。如图3所示,电子设备可以包括至少一个处理器301,存储器302、输入输出设备303。下面结合图3对电子设备的各个构成部件进行具体的介绍:
处理器301是电子设备的控制中心,可以是一个处理器,也可以是多个处理元件的统称。例如,处理器301是一个CPU,也可以是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本公开实施例的一个或多个集成电路,例如:一个或多个微处理器(Digital Signal Processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)。
其中,处理器301可以通过运行或执行存储在存储器302内的软件程序,以及调用存储在存储器302内的数据,执行电子设备的各种功能。
在具体的实现中,作为一种实施例,处理器301可以包括一个或多个CPU,例如图中所示的CPU 0和CPU 1。
在具体实现中,作为一种实施例,电子设备可以包括多个处理器,例如图3中所示的处理器301和处理器305。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
存储器302可以是只读存储器(Read-Only Memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(Random Access Memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器302可以是独立存在,通过总线304与处理器301相连接。存储器302也可以和处理器301集成在一起。在本公开实施例中,存储器可以用于存储第一数据包、第二数据包、第三数据包、第四数据包、第五数据包、第六数据包和第七数据包,以及SN、NESN和K等。
输入输出设备303,用于与其他设备或通信网络通信。其中,通信网络可以为可能的无线通信网络,尤其可以为短距离通信网络。进一步可选的,还可以用于与以太网,无线接入网(Radio access network,RAN)等通信网络通信。相应的,输入输出设备303可以包括基带处理器的全部或部分,以及还可选择性地包括无线射频(Radio Frequency,RF)处理器。RF处理器用于收发RF信号,基带处理器则用于实现由RF信号转换的基带信号或即将转换为RF信号的基带信号的处理。
在具体实现中,作为一种实施例,输入输出设备303可以包括发射器和接收器(或者称为发射单元和接收单元)。其中,发射器用于向其他设备或通信网络发送信号,接收器用于接收其他设备或通信网络发送的信号。发射器和接收器可以独立存在,也可以集成在一起。在本公开实施例中,输入输出设备303可以用于收发:第一数据包、第二数据包、第三数据包、第四数据包、第五数据包、第六数据包和第七数据包,以及指示信息、第一信息和第一配置信息等。本申请不限制发射器和接收器的形态,可以独立设置或者集成设置。
可选的,系统还可以包含总线304,可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线或者其他可能类型的总线等。为便于表示,图3中仅用一条粗线表示,但并不表示仅有一根总线 或一种类型的总线。
图3中示出的设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
图4示出本申请实施例提供的通信方法的流程示意图。该方法可以应用于图2b所示的通信系统。如图4所示,该通信方法可以包括:
步骤S401,第一装置向第二装置发送至少一个数据包。
在本步骤中,至少一个数据包表示的是第一装置已发送的数据包。这至少一个数据包可能被第二装置成功接收,也可能未被第二装置成功接收。
在本申请实施例中,第一装置向第二装置发送一个数据包之后,第一装置确定接收到了针对该数据包的确认反馈表示第二装置成功接收了该数据包,该数据包没有重传需求;第一装置确定未接收到该数据包的确认反馈表示第二装置未成功接收该数据包,该数据包有重传需求。
下面对第一装置如何确定是否接收到了一个数据包的确认反馈的过程进行说明。以第一装置向第二装置发送数据包A为例。若第二装置成功接收到了数据包A,则第二装置向第一装置发送用于表示成功接收数据包A的反馈信息。若第二装置未成功接收数据包A,则第二装置不会向第一装置发送用于表示成功接收数据包A的反馈信息。由此可见,在第二装置未成功接收数据包A的情况下,或者在第二装置虽然成功接收到了数据包A但是第二装置向第一装置发送的用于表示成功接收数据包A的反馈信息丢失的情况下,第一装置均无法接收到来自第二装置的用于表示成功接收数据包A的反馈信息。第一装置向第二装置发送数据包A之后,开始等待来自第二装置的针对数据包A的反馈信息。若等待时间达到第一预设时间之前,第一装置接收到了用于表示成功接收数据包A的反馈信息,则第一装置可以确定接收到了针对数据包A的确认反馈。若等待时间达到了第一预设时间,第一装置仍然未接收到用于表示成功接收数据包A的反馈信息,则第一装置可以确定未接收到针对数据包A的确认反馈。可选的,在第二装置期望接收到数据包A,但在第二预设时间内未接收到数据包A时,第二装置可以向第一装置发送用于表示未成功接收数据包A的反馈信息。相应的,第一装置在接收到用于表示未成功接收数据包A的反馈信息时,第一装置可以立即确定未接收到针对数据包A的确认反馈,而无需在等待时间达到了第一预设时间后再确定。
在一种可能的实现方式中,反馈信息可以是通过物理层控制信息来携带的,例如,ACK用来标识成功接收数据包;NACK用来标识未成功接收数据包。
在另外一种可能的实现方式中,反馈信息也可以是通过物理层之上的协议层来携带的,例如,包含在链路层协议数据单元(Protocol Data Unit,PDU)的包头或数据帧的帧头中;例如,在链路层PDU包头中携带指示位,其中1标识成功接收数据包,0标识未能成功接收到数据包。
在一种可能的实现方式中,第一装置发送一个数据包之后,需要在确定该数据包的反馈结果(包括:确定接收到针对该数据包的确认反馈,或者,确定未接收到针对该数据包的确认反馈)之后,再进行后续的发送工作。
举例来说,至少一个数据包包括数据包1和数据包2。第一装置向第二装置发送数据包1,并确定接收到了针对数据包1的确认反馈(即确定第二装置成功接收了数据包1)或者确定未接收到数据包1的确认反馈(即确定第二装置未成功接收数据包1)的情况下,再向第二 装置发送数据包2或者重传数据包1。由此可见,在这种实现方式中,第二装置每收到一个数据包需要进行一次单包反馈。举例来说,第二装置接收到数据包1后,需要针对数据包1发送一个用于表示成功接收数据包1的反馈信息(例如,与数据包1的序列号对应ACK;接收到数据包2后,需要针对数据包2发送一个用于表示成功接收数据包2的反馈信息(例如,与数据包2的序列号对应ACK)。这样,第一装置才能确定接收到了针对数据包1的确认反馈或者数据包2的确认反馈。可选的,第二装置期望接收到数据包1,但在第二预设时间内未接收到数据包1时,可以向第一装置发送用于表示未成功接收数据包1的反馈信息(例如,与数据包1的序列号对应的NACK),这样,第一装置无需等待第一预设时间而能够尽快确定未接收到针对数据包1的确认反馈,从而使得第一装置可以尽快进行后续的发送工作,提高数据传输效率。
需要说明的是,第一预设时间和第二预设时间可以根据需要进行设置,第一预设时间可以小于第二预设时间,举例来说,第一预设时间可以设置为0.1秒,第二预设时间可以设置为0.2秒,本申请实施例对第一预设时间和第二预设时间的设置方式不做限制。
在一种可能的实现方式中,第一装置发送一个数据包之后,无需等待该数据包的物理层反馈结果即可进行后续的发送工作,也就是说,第一装置可以连续发送至少一个数据包。
第一装置中可以预先设置连续发送的数据包的数量。举例来说,第一装置可以一次连续发送4个数据包,分别为:数据包1、数据包2、数据包3和数据包4。第一装置向第二装置发送数据包1后,无需确定是否接收到了针对数据包1的确认反馈,即可发送数据包2;在发送数据包2之后,同样无需确定是否接收到了针对数据包2的确认反馈,即可发送数据包3;在发送数据包3之后,同样无需确定是否接收到了针对数据包3的确认反馈,即可发送数据包4。在这种情况下,第二装置可以针对多个数据包的接收情况进行统一的批量反馈。
第二装置针对多个数据包的接收情况进行批量反馈就是:第二装置对第三预设时间内接收到的数据包进行批量反馈。在批量反馈的场景下,第二装置发送的反馈信息中的指示信息可以同时指示多个数据包的接收情况。第二装置需要结合第一装置的在发送至少一个数据包时采用的数据传输方式,生成指示信息。第一装置采用的数据传输方式可以为顺序发送方式,也可以为乱序发送方式。其中,第三预设时间可以根据需要进行设置,第三预设时间的计时起始时刻可以为上一次发送反馈信息的时刻,或者上一次发送反馈信息之后第一次接收到数据包的时刻等,本申请实施例对第三预设时间的设置方式不做限制。
在一种可能的实现方式中,第一装置发送至少一个数据包采用的数据传输方式为顺序发送方式,此时,指示信息的每一位(即比特位,可以称为指示位)可以代表一个数据包的接收情况。例如,指示信息的第一位代表第一装置连续发送的数据包中第一个数据包的接收情况,指示信息的第二位代表第一装置连续发送的数据包中第二个数据包的接收情况。第一装置与第二装置中可以预先设置第一装置连续发送的数据包的数量,第一装置与第二装置之间也可以根据缓冲区大小等信息预先约定第一装置连续发送的数据包的数量。可选的,当指示信息的某一位的取值为“1”时,代表该位对应的数据包成功接收,当指示信息的某一位的取值为“0”时,代表该位对应的数据包未成功接收。举例来说,第一装置连续向第二装置发送了数据包1、数据包2、数据包3和数据包4,第二装置在第三预设时间内接收到了数据包1和数据包3,且未接收到数据包2和数据包4,则第二装置向第一装置发送的反馈信息中指示信息的各位的取值可以为1010。再例如,第一装置连续向第二装置发送了数据包1、数据包 2、数据包3和数据包4,第二装置在第三预设时间内接收到了数据包1和数据包3和数据包4,且未接收到数据包2,则第二装置向第一装置发送的反馈信息中指示信息的各位的取值可以为1011。第一装置接收到指示信息之后,可以根据自身发送数据包的顺序,确定指示信息中各位代表的数据包,进而确定出各个已发送的数据包的接收情况。
在另一种可能的实现方式中,第一装置发送至少一个数据包采用的数据传输方式为乱序发送方式,此时,指示信息可以包括在第三预设时间内接收到的数据包的序列号。举例来说,第一装置连续向第二装置发送了数据包1、数据包2、数据包3和数据包4,第二装置在第三预设时间内接收到了数据包1和数据包3,且未接收到数据包2和数据包4,则第二装置向第一装置发送的反馈信息中指示信息可以包括数据包1的序列号和数据包3的序列号。再例如,第一装置连续向第二装置发送了数据包1、数据包2、数据包3和数据包4,第二装置在第三预设时间内接收到了数据包1、数据包3和数据包4,则第二装置可以向第一装置发送的反馈信息中指示信息可以包括数据包1的序列号、数据包3的序列号和数据包4的序列号。第一装置接收到指示信息之后,可以确定出各个已发送的数据包的接收情况。
考虑到,第一装置可以以顺序发送方式发送至少一个数据包,也可以以乱序发送方式发送至少一个数据包,因此,在本申请实施例中,对步骤S401中发送至少一个数据包的方式不做限制。至于顺序发送方式和乱序发送方式的具体实施过程会在后续内容中进行详细说明。
步骤S402,第二装置接收来自第一装置的至少一个数据包。
可以理解的是,第一装置发送的至少一个数据包中可能有的数据包被第二装置成功接收,而有的数据包未被第二装置成功接收。第二装置可以根据数据包的接收情况,确定所期望的第一数据包。
在一种可能的实现方式中,NESN或SN可能由多个比特位组成。以2个比特位为例,NESN和SN的取值范围为0、1、2和3。第二装置中存储或者维护的NESN代表了其期望接收到的一个数据包的序列号(或者其期望接收到的多个数据包中序列号最小的数据包的序列号)。假设第二装置中存储或维护的NESN为1。在一个示例中,若第二装置接收到了SN为2的数据包或者第二装置在一定时间(上述第二预设时间或者上述第三预设时间)内未接收到SN为1的数据包,则第二装置可以确定SN为1的数据包未成功接收,可以将SN为1的数据包确定为所期望的一个第一数据包,同时,第二装置可以将存储或者维护的NESN更新为1。在另一个示例中,若第二装置未接收到SN为1的数据包以及SN为2的数据包时,接收到了SN为3的数据包,则第二装置可以确定SN为1的数据包以及SN为2的数据包为所期望的一个第一数据包,同时,第二装置可以将存储或者维护的NESN保持在1。在又一示例中,若第二装置在一定时间(上述第二预设时间或者上述第三预设时间)内接收到了SN为1的数据包、SN为2的数据包以及SN为3的数据包,则第二装置可以确定SN为1的数据包、SN为2的数据包以及SN为3的数据包成功接收,可以将SN为4的数据包确定为所期望的一个第一数据包,同时,第二装置可以将存储或者维护的NESN更新为4。
步骤S403,第二装置基于第一数据反馈方式,向第一装置发送指示信息,所述指示信息用于指示第二装置所期望的至少一个第一数据包。
其中,第一数据反馈方式可以表示第二装置采用的数据反馈方式,第一数据反馈方式为单包反馈方式或者批量反馈方式。其中,单包反馈方式表示通过一个指示信息反馈一个数据包的接收情况。具体的,每收到一个数据包发送一次反馈信息(例如,可以为ACK)。可选的, 在单包反馈方式中,若在第二预设时间内未接收到本地存储或者维护的NESN所代表的数据包,则发送一次反馈信息(例如,可以为NACK)。批量反馈方式表示通过一个指示信息同时反馈多个数据包的接收情况。具体的,一次反馈第三预设时间内接收到的数据包的情况。在一个示例,批量反馈时,指示信息的每一位代表一个数据包的接收情况。在又一示例中,批量反馈时,指示信息中包括第三预设时间内接收到的数据包的序列号。
在一种可能的实现方式中,第一数据反馈方式可以由第一装置和第二装置协商得到。在一种可能的实现方式中,第一数据反馈方式可以预先配置或者定义在第二装置中。这样,在实施中,第二装置可以跳过从单包反馈方式和批量反馈方式中确定出第一数据反馈方式的过程,在接收来自第一装置的至少一个数据包之后,直接向第一装置发送指示信息。这样,有利于降低设备成本。
第一数据包可以表示第二装置所期望的数据包。第一数据包的数量可以有一个或多个。第一数据包可以根据当前数据包的接收情况确定。
在一种可能的实现方式中,第一数据包可以包括未成功接收到的一个或多个数据包。
在另外一种可能的实现方式中,第一数据包可以包括成功接收到的数据包的下一个数据包。需要说明的是,成功接收的数据包的下一个数据包指的是序列号大于成功接收的数据包的序列号,且序列号与成功接收的数据包的序列号连续的数据包。例如,假定序列号可选取值为0,1,2,3。考虑到数据包的序列号是顺序递增的,因此第二装置成功接收到序列号为1的数据包,则成功接收到的数据包的下一个数据包为序列号为2的数据包。当然,可以理解的是,序列号可能是循环滚动的。例如,第二装置在成功接收到序列号为3的数据包之后,下一数据包为序列号为0的数据包。这种情况下,也可以理解为序列号为0的数据包和序列号为3的数据包的序列号连续,且序列号为0的数据包序列号大于序列号为3的数据包的序列号。可以理解的是,假定序列号为0的数据包之后是序列号为1的数据包,则序列号为1的数据包的序列号也是大于序列号为3的数据包的序列号的。
对于单包反馈方式,第一数据包为第二装置未成功接收的数据包或者第二装置成功接收的数据包的下一个数据包。举例来说,数据包2和数据包3序列号连续,且数据包2的序列号小于数据包3的序列号。第二装置未成功接收数据包2,则第二装置所期望的第一数据包为数据包2。第二装置成功接收了数据包2,则第二装置所期望的第一数据包为数据包3。
对于批量反馈方式,第一数据包为第二装置未成功接收的一个或多个数据包。举例来说,数据包1、数据包2、数据包3和数据包4的序列号连续且依次增大。第一装置向第二装置发送了数据包1、数据包2和数据包3。若第二装置未成功接收数据包1和数据包2,成功接收了数据包3,则第二装置所期望的第一数据包包括数据包1和数据包2。若第二装置未成功接收数据包4,成功接收了数据包1、数据包2和数据包3,则第二装置所期望的第一数据包包括数据包4。
在一种可能的实现方式中,指示第二装置所期望的一个或者多个第一数据包可以通过期望的序列号来指示。例如,第一装置发送序列号为1的数据包,第二装置成功接收了序列号为1的数据包,则此时指示信息中可以用序列号2来指示第二装置期望接收到序列号为2的数据包。又如,第一装置发送序列号为1、序列号为2和序列号为3的数据包,第二装置未成功接收序列号为1的数据包以及序列号为2的数据包,成功接收了序列号为3的数据包,则此时指示信息中可以用序列号“1”和序列号“2”来指示第二装置期望接收到序列号为1 的数据包,以及序列号为2的数据包。可选的,指示信息可以包含在物理层控制信息,也可以包含在物理层之上的其他协议层(例如链路控制层或者MAC层)数据包包头中。
需要说明的是,在第一装置采用的数据传输方式为顺序发送方式时,在第二装置期望多个第一数据包的情况下,可以只指示一个第一数据包,该数据包为序列号最小的未被成功接收的数据包。这样,可以节省指示信息的数据量。例如,第一装置发送序列号为1、序列号为2和序列号为3的数据包,第二装置未成功接收序列号为1的数据包以及序列号为3的数据包,成功接收了序列号为2的数据包,则此时指示信息中可以用序列号1来指示第二装置期望接收到序列号为1的数据包,以及其下一个或多个数据包。
在另外一种可能的实现方式中,指示第二装置所期望的一个或者多个第一数据包也可以采用多个指示位来指示,例如位图(bitmap)。例如,第一装置发送数据包1、数据包2、数据包3、数据包4,第二装置成功接收了数据包3、数据包4,未成功接收数据包1、数据包2,则此时可以使用“0011”来指示第二装置期望数据包1和数据包2,其中,第一个“0”对应数据包1,表示未成功接收数据包1;第二个“0”对应数据包2,表示未成功接收数据包2;第一个“1”对应数据包3,表示成功接收数据包3;第二个“1”对应数据包4,表示成功接收数据包4。
在另外一种可能的实现方式中,可以通过指示接收成功与否的反馈信息来指示第二装置所期望的一个或者多个第一数据包。
步骤S404,第一装置接收来自第二装置的指示信息。
第一装置接收到指示信息后,可以根据指示信息确定第二装置所期待的至少一个第一数据包。
在一种可能的是实现方式中,对于单包反馈方式,第二装置向第一装置发送的指示信息中可以包括一个第一数据包的序列号。第一装置接收到该指示信息后,可以按其中的序列号确定第二装置所期望的第一数据包。
在一种可能的实施方式中,对于批量反馈方式,第二装置向第一装置发送的指示信息中可以包括多个比特位,称为指示位,例如位图(bitmap)。每个指示位对应一个数据包的接收情况。指示位为0时表示未成功接收对应的数据包,指示位为1时表示成功接收了对应的数据包。当然,两种指示方式也可以交换,即0表示接收成功,1表示接收失败,本申请不做具体限定。第一装置接收到该指示信息后,可以按照各个指示位指示的接收情况,确定第二装置成功接收了哪些数据包,未成功接收哪些数据包,也就是说,可以确定接收到了哪些数据包的确认反馈以及未接收到哪些数据包确认反馈,基于此可以确定第二装置所期望的第一数据包。可以理解的是,在各个指示位指示的接收情况均为成功接收的情况下,第一装置可以确定第二装置所期望的第一数据包为序列号大于已经发送的数据包的一个或多个数据包。在某个或某几个指示位指示的结果均为未成功接收的情况下,第一装置可以确定第二装置所期望的第一数据包为未成功接收的一个或多个数据包。
在另外一种可能的实施方式中,对于批量反馈方式,第二装置向第一装置发送的指示信息可以包含一个或者多个第一数据包的序列号,第一装置接收到该指示信息后,可以按指示信息中的序列号确定第二装置所期望的第一数据包。当然,第二装置还可以按指示信息中的序列号确定第二装置成功接收了哪些数据包,也就是说可以确定接收到了哪些数据包的确认反馈。
对于第二装置期望多个第一数据包的情况,指示信息中可以包括所有期望的第一数据包的序列号,也可以仅包括所有期望的第一数据包中序列号最小的数据包的序列号。
在一个示例中,第二装置期望多个第一数据包,指示信息包含一个数据包的序列号,且该数据包为序列号最小的未被成功接收的数据包。例如,第一装置发送序列号为0、1、2、3的数据包,其中第二装置成功接收到了序列号为0和序列号为2的数据包,未能成功接收序列号为1和序列号为3的数据包,则第二装置可以向第一装置发送包括序列号“1”的指示信息。第一装置接收到该指示信息后,确定序列号为1的数据包为第二装置期望的第一数据包。同时,第一装置还可以将序列号大于1的数据包均确定为第二装置期望的第一数据包。这一情形,对应于顺序发送方式。
在又一示例中,第二装置期望多个第一数据,指示信息可以包含多个第一数据包的序列号。例如,第一装置发送序列号为0、1、2、3的数据包,其中第二装置成功接收到了序列号为0和序列号为2的数据包,未能成功接收序列号为1和序列号为3的数据包,则第二装置可以向第一装置发送包括序列号“1”和序列号“3”的指示信息。第一装置接收到该指示信息后,确定序列号为1的数据包以及序列号为3的数据包为第二装置期望的数据包。同时,第一装置还可以将序列号大于3的数据包均确定为第二装置期望的第一数据包。这一情形,对应于乱序发送方式。
在本申请实施例中,第二装置可以基于第一数据反馈方式确定向第一装置反馈一个或多个期望的第一数据包,而不是简单的向第一装置反馈ACK或者NACK。在本申请实施例中,通过灵活的数据反馈,增加了第一装置发送的数据包的可选范围以及可选方式,使得第一装置具有批量发送或者乱序发送数据包的可能性。在序列号较小的数据包需要重传的情况下,为序列号较大的数据包提供了发送机会,使得序列号较大的数据包无需等待对序列号较小的数据包的确认反馈即可进行发送,这样,序列号较大的数据包不会因序列号较小的数据包的重传而阻断,保障了序列号较大的数据包的发送,提升了用户体验。
步骤S405,第一装置基于第一数据传输方式,向第二装置发送一个或多个数据包。
其中,第一数据传输方式可以表示第一装置采用的数据传输方式,第一数据传输方式为顺序发送方式或者乱序发送方式。其中,顺序发送方式表示按照序列号由小到大的顺序发送,且发送的数据包的序列号连续。乱序发送方式表示不按照序列号由小到大且连续的方式发送数据包。在第二装置采用的数据反馈方式为单包反馈方式的情况下,或者,在在第二装置采用的数据反馈方式为批量反馈且指示信息中包括序列号的情况下,乱序发送方式具体表示不需要按照序列号由小到大的顺序发送,且发送的数据包的序列号可以不连续。在第二装置采用的数据反馈方式为批量反馈方式且指示信息中包括多个指示位的情况下,乱序发送方式具体表示按照序列号由小到大的顺序发送但发送的数据包的序列号可以不连续。
在第一数据传输方式为顺序发送方式时,所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;其中,针对任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
第三数据包属于步骤S401中第一装置向第二装置发送的至少一个数据包,并且第一装置尚未接收到针对第三数据包的确认反馈。也就是说,第三数据包为第一装置已发送的,且第二装置未成功接收的数据包。第三数据包的数量为一个或多个。因此,各第三数据包均属于 第二装置所期望的至少一个第一数据包,需要进行重传各第三数据包。考虑到在顺序发送方式中,第一装置需要按照序列号由小到大的顺序进行数据包的发送,且发送的数据包的序列号需要是连续的。因此,第一装置需要从需要重传的数据包中序列号最小的数据包(即至少一个第三数据包中序列号最小的第三数据包)开始发送,并依次发送序列号与前一个已发送的数据包的序列号连续且序列号比前一个已发送的数据包的序列号大的数据包。这样,既给了序列号比需要重传的数据包序列号大的数据包发送机会,又使得需要重传的数据包能够被重新发送一次,兼顾了首次发送的序列号较大的数据包以及需要重传的序列号较小的数据包的发送。举例来说,在步骤S401中,第一装置向第二装置发送了数据包1、数据包2、数据包3和数据包4,其序列号分别为1、2、3和4。之后,第一装置确定接收到了数据包1和数据包3的确认反馈,且确定未接收到数据包2和数据包3的确认反馈,因此,第一装置确定数据包2和数据包4为第三数据包,且第三数据包中序列号最小的第三数据包为数据包2。由于多个第二数据包中序列号最小的数据包为第三数据包中序列号最小的第三数据包,因此,多个第二数据包中序列号最小的数据包为数据包2。也就是说,在本步骤中,第一装置向第二装置发送的多个第二数据包中序列号最小的数据包为数据包2。因此,在本步骤中,第一装置可以依次向第二装置发送数据包2、数据包3和数据包4和数据包5(其序列号为5)等。可见,等待首次发送的序列号较大的数据包5以及需要重传的序列号较小的数据包2和数据包4无需等待其他数据包的确认反馈即可进行发送,节省了等待时间和存储资源,提高了用户体验。
在上述示例中,如果第一装置发送完数据包5之后,继续发送数据包6(其序列号为6)、数据包7(其序列号为7)等后续序列号较大的数据包,若出现数据包2需要再次重传的情况,则数据包2需要等待较多的时间才能得到发送机会进行重传。为了缩短需要重传的数据包等待的时间,尽快为需要重传的数据包提供重传机会,在本申请实施例中,对本步骤中发送的第二数据包的序列号进行限制。可选的,所述多个第二数据包中每个第二数据包的序列号N与第三数据包中序列号最小的数据包的序列号M的差值小于或等于K。其中,N、M和K为大于或者等于0的整数。以K为3为例,在上述示例中,数据包6的序列号N的取值为6,第三数据包中序列号最小的数据包的序列号M的取值为2,两者的差值为4大于K,因此,第一装置在发送数据包5之后,暂时不会发送数据包6。这样,若出现数据包2至数据包5中出现有需要重传的数据包,则不需要等待太久,即可进行重传。
由于序列号可能是连续滚动的。因此,多个第二数据包中每个第二数据包的序列号N与第三数据包中序列号最小的数据包的序列号M的差值可以是abs(N-M),即N-M的绝对值。
在第一数传输方式为乱序发送方式时,所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与任一个所述第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;P、M和K为大于或者等于0的整数。
考虑到序列号可能是连续滚动的。因此,在一种可能的实现方式中,一个第四数据包的序列号大于一个第三数据包的序列号包括:该第四数据包的批次在该第三数据包的批次之后(例如该第四数据包的批次号大于该第三数据包的批次号)。任一个第四数据包的序列号P与第三数据包中序列号最大的第三数据包的序列号M的差值可以是abs(P-M),即P-M的绝对值。需要说明的是,实际的场景中未必存在批次号这个参数,但是装置可以确定批次的先后。
如前所述,第三数据包属于第二装置所期望的至少一个第一数据包,需要进行重传。第三数据包的数量可以为一个或多个。在乱序发送方式下,第一装置前一个发送的数据包的序列号和后一个发送的数据包的序列号可以不连续。因此,第一装置可以跳过需要重传的序列号较小的数据包,而发送等待首次发送的序列号较大的数据包。
由于在第二装置采用单包反馈方式作为数据反馈方式时,第一装置每发送一个数据包,需要在确定是否接收到了针对该数据包的确认反馈之后,才能进行后续发送工作。因此,在第二装置采用单包反馈方式作为数据反馈方式时,本步骤中第一装置发送的一个或多个数据包包括一个第四数据包,且该第四数据包的序列号需要大于第三数据包中序列号最大的第三数据包的序列号,这样,等待首次发送的序列号较大的数据包不会被任一个第三数据包的重传阻断,得到了发送机会。同时,在本申请实施例中,对第四数据包的序列号进行了限制,在一个数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K时,才将该数据包确定为第四数据包。这样,需要重传的序列号较小的第三数据包不会一直被等待首次发送的序列号较大的数据包抢占发送机会。可见,在本申请实施例中,兼顾了等待首次发送的序列号较大的数据包和需要重传的序列号较小的数据包的传输。举例来说,假设K为3。第一装置向第二装置发送了序列号为1的数据包1,并确定未接收到针对数据包1的确认反馈,也就是说,数据包1为第三数据包,M的取值为1。对于序列号为2的数据包2,其序列号P取值为2,P与M的差值为1,小于3。此时,第一装置可以向第二装置发送数据包2。同理,之后,第一装置可以发送序列号为3的数据包3和序列号为4的数据包4。对于序列号为5的数据包5,其序列号P的取值为5,P与M的差值为1,大于3。此时,第一装置重传数据包1,而不会继续发送数据包5。
在第二装置采用批量反馈方式作为数据反馈方式时,第一装置可以连续发送多个数据包。因此,在第二装置采用批量反馈方式作为数据反馈方式时,本步骤中第一装置发送的一个或多个数据包可以包括一个或多个第四数据包,且任一个第四数据包的序列号需要大于第三数据包的序列号,这样,等待首次发送的序列号较大的数据包不会被第三数据包的重传阻断,得到了发送机会。同时,在本申请实施例中,对第四数据包的序列号进行了限制,在一个数据包的序列号P与第三数据包的序列号M的差值小于或者等于K时,才将该数据包确定为第四数据包。这样,需要重传的序列号较小的第三数据包不会一直被等待首次发送的序列号较大的数据包抢占发送机会。
需要说明的是,当第四数据包的数量小于第一装置一次可连续发送的数据包的数量时,本步骤中向第二装置发送的一个或多个数据包除了包括一个或多个第四数据包以外,还可以包括一个或多个第三数据包。另外,在步骤S404中的指示信息包括的是序列号的情况下,本步骤在发送一个或多个数据包时,不限制数据包的发送顺序。在步骤S404中的指示信息包括的是指示位的情况下,本步骤在发送一个或多个数据包时,先发送序列号小的数据包,再发送序列号大的数据包,这样,可以提高反馈结果的准确性。
可以理解的是,K为预先配置或定义的,包括但不限于,K是协议约定的,或者,K是第二装置通过配置信息为第一装置配置的。
在一种可能的实现方式中,K可以为基于所述第一装置的缓存区属性和所述第二装置的缓存区属性配置或者定义的;或者,K可以为基于所述第一装置的发送窗大小和所述第二装置的接收窗大小配置或者定义的。
其中,可以理解的是,通常情况下,发送端在发送的过程中始终保持着一个发送窗口,只有落在发送窗口内的数据包(或者数据帧)才允许被发送;同时接收端也维持着一个接收窗口,只有落在接收窗口内的数据包(或者数据帧)才允许接收。发送窗大小代表了发送端最多允许发送的的数据包的数量,接收窗大小代表了接收端最多允许接收的数据包的数量。
其中,缓存区属性包括容量(capacity)、上界(limit)、位置(position)或和标记(mark)中的一个或多个。其中,容量表示缓存区能够容纳的数据包的最大数量。这一容量在缓存区创建时被设定的固定值。上界表示缓存区中实际存储的数据包的数量。位置表示下一个要被读或者写的数据包的索引。标记表示一个备忘位置,标记在设定前是未被定义的,标记可以被设置成位置,位置也可以被设置成标记。这四个属性之间的关系为0<=标记<=位置<=上界<=容量。
在一个示例中,第一装置与第二装置之间通过协商确定K。在一个示例中,第一装置可以按照协议规定确定K。在一种可能的实现方式中,第一装置可以协商确定的K和协议规定的K中的最小值确定为要使用的K。
在一种可能的实现方式中,K可以根据序列号的长度确定。在一个示例中,K=2^(L-1),其中,L为SN的长度。举例来说,SN的长度为2位时,SN的取值范围为0-3的整数,L=2,K=2;SN的长度为3时,SN的取值范围为0-7的整数,L=3,K=4;SN的长度为4位时,SN的取值范围为0-15的整数,L=4,K=8。本申请实施例,对K的确定方式不做限制。
在一种可能的实现方式中,任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。在本申请实施例中,在首次需要发送序列号较大的数据包的优先级大于需要重传的序列号较小的数据包的优先级时,采用乱序发送方式。这样,可以在低优先级的数据包需要重传时,为高优先级的数据包提供发送机会,同时又保证低优先级的数据包不会一直被高优先级的数据包抢占发送机会,从而兼顾了高优先级的数据包和低优先级的数据包的传输。
在首次需要发送序列号较大的数据包的优先级与需要重传的序列号较小的数据包的优先级相同时,由于数据包的优先级相同,需要发送序列号较大的数据包的优先级等待需要重传的序列号较小的数据包重传之后再进行发送带来的影响较小,因此首次需要发送序列号较大的数据包在需要重传的序列号较小的数据包重传之后,再进行传输。
在一种可能的实现方式中,任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。这样,可以通过序列号区分高优先级的数据包和低优先级的数据包,从而在数据包的序列号属于不同的序列号区段时,再以乱序发送方式进行数据包的发送,从而为高优先级数据包提供发送机会,提升高优先级业务的用户体验。
在一个示例中,以序列号的取值范围为0至7为例,可以将0至3确定为第二序列号区段,将4至7确定为第一序列号区段。这样,第一装置可以将数据包4作为第四数据包,而不会将数据包2和数据包3作为第四数据包,从而保障了高优先级数据包的传输。同时,第一装置不会将数据包5作为第四数据包,在第一装置发送数据包4之后,不会发送数据包5,而重传数据包1,保障了低优先级数据包的传输。因此,本申请实施例提供的通信方法,可以兼顾高优先级的数据包和低优先级的数据包的传输。同时,提高了数据传输效率。
在一种可能的实现方式中,第一数据传输方式可以由第一装置确定。在一个示例中,第 一装置可以根据自己的缓存区属性(例如,缓存区大小、发送数据缓存区大小等)、第一装置的能耗需求等中的一项或多项确定第一数据传输方式。在又一示例中,第一装置还可以结合第二装置向其发送的第二装置的缓存区属性(例如,缓存区大小,接收数据缓存区大小等)、第二装置的能耗需求等中的一项或多项确定第一数据传输方式。举例来说,在缓存区较小,对装置节能要求较高的场景下,第一装置可以采用顺序发送方式;否则采用乱序发送方式。
在一种可能的实施方式中,第一装置可以向第二装置发送第一信息,其中,所述第一信息用于指示第一装置期望的数据传输方式或者第一装置支持的数据传输方式。
在短距离通信中,通信双方(即第一装置和第二装置)之间进行通信时,一个是主节点,一个是从节点。其中,主节点指能够搜索到其他通信设备并主动建立连接的一方,从节点则不能主动建立连接,只能等待主节点连接自身。一个主节点可以连接多个从节点。在一种可能的实现方式中,在第一装置为从节点、第二装置为主节点的情况下,第一数据传输方式可以由第二装置配置。第一装置采用的第一数据传输方式由第二装置通过第一配置信息进行配置。在一个示例中,第二装置可以根据缓存区属性、能耗需求中的一项或多项等确定第一数据传输方式,并向第一装置发送包括第一数据传输方式的第一配置信息。其中,第二装置根据缓存区属性、能耗需求等中的一项或多项确定第一数据传输方式的过程可以参照第一装置根据缓存区属性、能耗需求等确定第一数据传输方式的过程,这里不再赘述。在另一示例中,第一装置可以向第二装置发送第一信息,其中,所述第一信息用于指示第一装置期望的数据传输方式或者第一装置支持的数据传输方式。可选的,第二装置可以基于第一信息,确定第一数据传输方式。之后,第二装置可以向第一装置发送指示第一数据传输方式的第一配置信息。第一装置接收来自第二装置的第一配置信息,并基于第一配置信息确定第一数据传输方式。
在一个示例中,在第一装置期望的数据传输方式为顺序发送方式时,第二装置可以将顺序发送方式确定为第一数据传输方式。在第一装置期望的数据传输方式为乱序发送方式时,第二装置可以将乱序发送方式确定为第一数据传输方式。在又一示例中,在第一装置既支持顺序发送方式又支持乱序发送方式的情况下。第二装置可以确定第一数据传输方式,例如根据第一数据反馈方式确定所述第一数据传输方式。举例来说,在第一数据反馈方式为单包反馈的情况下,第二装置可以将乱序发送方式确定为第一数据传输方式,以兼顾等待首次发送的序列号较大的数据包和需要重传的序列号较小的数据包的传输。在第一数据反馈方式为批量反馈的情况下,若第二装置的缓存区较小,则第二装置可以将顺序发送方式确定为第一数据传输方式;若第二装置的缓存区较大,则第二装置可以将乱序发送方式确定为第一数据传输方式。当然,第二装置还可以通过其他方式确定和配置第一数据传输方式,例如,上述的基于第二装置的缓存区属性(例如,缓存区大小、接收数据缓存区大小等)、第二装置的能耗需求等,对此本申请实施例不做限制。
在一种可能的实现方式中,第一数据传输方式可以预先配置或者定义在第一装置中。这样,在实施中,第一装置无需选择,而是根据第一数据传输方式向第二装置发送一个或多个数据包。这样,有利于降低设备成本。
步骤S406,第二装置接收来自第一装置的一个或多个数据包。
在本申请实施例中,在第一装置确定了第二装置所期望的至少一个第一数据包后,可以结合第二装置的情况以及第一数据传输方式,确定向第二装置发送的一个或多个数据包,而 不是简单的向第二装置发送其所期望的第一数据包,增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。举例来说,在第二装置期望第一装置重传序列号较小的第一数据包时,若有序列号较大的数据包需要传输,则第一装置基于第一数据传输方式发送的一个或多个数据包中可以包括序列号较大的数据包,从而使序列号较大的数据包不受需要重传的序列号较小的数据包的阻断,保障了序列号较大的数据包的传输,从而提升了用户体验。可见,这一过程中增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。另外,在第二装置期望第一装置重传序列号较小的第一数据包时,若有序列号较大的数据包需要传输,则第一装置基于第一数据传输方式发送的一个或多个数据包中仍然可以包括序列号较小的需要重传的数据包,从而使序列号较小的重传数据包不会被序列号较大的数据包一直抢占发送机会,从而保障了序列号较小的数据包的重传,从而节省发送端(即第一装置)和接收端(即第二装置)的存储资源和能耗,提高了对低成本、低功耗的短距离通信设备的适用性。
在本申请实施例中,第一数据传输方式包括顺序发送方式和乱序发送方式,第一数据反馈方式包括单包反馈方式和批量反馈方式。这样就产生了四种组合,分别为:顺序发送方式和单包反馈方式的组合,顺序发送方式和批量反馈方式的组合,乱序发送方式和单包反馈方式的组合,以及乱序发送方式和批量反馈方式的组合。
相关技术中,采用的是顺序发送方式以及单包反馈方式(参见图1a、图1b和图1c),这种方式在序列号较小的数据包未被成功接收或者未被丢弃的情况下,序列号较大的数据包无法发送,因此,等待首次发送的序列号较大的数据包会被需要重发的序列号较小的数据包阻断。为了解决这一问题,本申请实施例中,提出了批量反馈和乱序发送两种方式,通过批量反馈可以使第一装置无需已发数据包被成功接收或者被丢弃即可发送后续的数据包,为序列号较大的数据包提供了发送机会;通过乱序发送可以使第一装置打乱发送顺序,同样为序列号较大的数据包提供了发送机会。由此可见,批量反馈和乱序发送两种方式均可以减少等待首次发送的序列号较大的数据包会被需要重发的序列号较小的数据包阻断的情况的出现。本申请实施例提供了的通信方法可以实现顺序发送方式和批量反馈方式相结合的场景,乱序发送方式和单包反馈方式相结合的场景,以及乱序发送方式和批量反馈方式相结合的场景。
下面对顺序发送方式和批量反馈方式相结合的场景进行说明。
在该场景下,第一数据传输方式为顺序发送方式,第一数据反馈方式为批量反馈方式。
在该场景下,在步骤S403中,第二装置所期望的至少一个第一数据包包括一个或多个第七数据包。其中,所述一个或多个第七数据包表示在步骤S401中第一装置发送的至少一个数据包中第二装置未成功接收的数据包。
在该场景下,在步骤S405中,第一装置向第二装置发送的一个或多个数据包包括多个第二数据包。其中,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为第三数据包。第三数据包属于步骤S401中第一装置发送的至少一个数据包,且第一装置尚未接收到针对第三数据包的确认反馈。
可选的,至少一个第二数据包中每个第二数据包的序列号N与每个第三数据包的序列号M的差值小于或等于K。其中,K为预先配置或者定义的。N、M和K为大于或者等于0的整数。
考虑到序列号可能是连续滚动的,下一批次的数据包的序列号可能小于上一批次的数据 包的序列号。因此,在一种可能的实现方式中,第二数据包的序列号N与第三数据包的序列号M的差值可以表示为abs(N-M),即N-M的绝对值。
可以理解的,K为预先配置或定义可以包括但是不限于是:K是协议约定的,或者,K是第二装置通过配置信息为第一装置配置的。
其中,第一装置尚未接收到针对第三数据包的确认反馈包括第一装置接收到了针对第一数据包的NACK或者第一装置在一定时间内未接收到针对第一数据包的ACK。
图5a示出本申请实施例中第一装置的缓存区中数据包的示例性示意图。如图5a所示,数据包0、数据包1、数据包2、数据包3、数据包4、数据包5、数据包6和数据包7对应的SN分别为0、1、2、3、4、5、6和7。假设K为3。
图5b示出顺序发送方式和批量反馈方式相结合的场景下本申请实施例提供的通信方法的流程图。在图5a的基础上,如图5b所示,该通信方法包括:
在步骤S501中,第一装置向第二装置发送数据包0、数据包1、数据包2和数据包3。
在步骤S502中,第二装置接收到了数据包0和数据包2,未接收到数据包1和数据包3。
在步骤S503中,第二装置向第一装置发送指示信息,所述指示信息为1010。
在步骤S504中,第一装置接收来自第二装置的指示信息后,确认数据包1和数据包3为第二装置所期望的第一数据包。
在步骤S505中,第一装置确定数据包1、数据包2、数据包3和数据包4为第二数据包。
由于数据包1和数据包3属于步骤S501中已发送且步骤S502中第二装置未接收到的数据包。因此,第一装置可以确定数据包1和数据包3为第二装置所期望的第一数据包。第一装置接收到的指示信息为1010,表明第二装置未成功接收到数据包1和数据包3。此时,第一装置可以确定尚未接收到针对数据包1和数据包3的确认反馈。因此,第一装置可以确认数据包1和数据包3为第三数据包。此时,第三数据包的序列号包括1和3,第三数据包中序列号最小的数据包为数据包1。
考虑到多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为第三数据包中序列号最小的数据包,且至少一个第二数据包中每个第二数据包的序列号N与第三数据包中序列号最小的第三数据包的序列号M的差值小于或等于K。由于数据包1为第三数据包中序列号最小的数据包,因此,数据包1为多个第二数据包中序列号最小的数据包。对于数据包2,其序列号(为2)与第二数据包“数据包1”的序列号(为1)连续,且其序列号N(为2)与第三数据包中序列号最小的数据包的序列号M(为1)的差值小于K(为3),因此,数据包2可以作为第二数据包。同理,数据包3也可以作为第二数据包。对于数据包4,其与第二数据包“数据包3”的序列号连续,且其序列号N(为4)与第三数据包中序列号最小的数据包的序列号M(为1)的差值等于K(为3),因此,数据包4可以作为第二数据包。对于数据包5,其序列号N(为5)与第三数据包中序列号最小的数据包的序列号M(为1)的差值存在大于K(为3),因此,数据包5不能作为第二数据包。相应的,与数据包5序列号连续的数据包6也不能作为第二数据包。由此可见,第一装置可以确定多个第二数据包分别为:数据包1、数据包2、数据包3和数据包4。
在步骤S506中,第一装置向第二装置发送数据包1、数据包2、数据包3和数据包4。
在本申请实施例中,虽然第二装置所期望的是数据包1和数据包3,但是第一装置向第二装置不仅发送了数据包1和数据包3,还发送了数据包4和数据包5。这样,为序列号较大 的数据包4提供了发送机会,使得数据包4没有因数据包1和数据包3的重传而被阻断。同时,通过仍然发送数据包1和数据包3,为需要重传的数据包的重传提供了保障,使其不会被序列号较大的数据包抢占发送机会。因此,兼顾了等待首次发送的序列号较大的数据包和需要重传的序列号较小的数据包的传输。另外,这种方式没有打乱数据的发送顺序,第二装置不用因等待数据包重排而存储较多的数据包,节省了第二装置的存储资源和能耗。特别的,在数据包4的优先级高于数据包1和数据包3的优先级的情况下,数据包4不需要等待数据包1和数据包3重传成功之后再发送,保障了高优先级的数据包的传输。同时,通过仍然发送数据包1和数据包3,可以使低优先级数据包不会一直被高优先级数据包抢占发送时机,保障了低优先级的数据包的传输。
下面对乱序发送方式和单包反馈方式相结合的场景进行说明。
在该场景下,第一数据传输方式为乱序发送方式,第一数据反馈方式为单包反馈方式。
在该场景下,在步骤S403中,第二装置所期望的至少一个第一数据包包括一个第五数据包。其中,所述一个第五数据包表示在步骤S401中第一装置发送的至少一个数据包中的第二装置未成功接收的数据包中序列号最小的数据包。
在该场景下,在步骤S405中,第一装置向第二装置发送的一个或多个数据包包括一个第四数据包,所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K。第三数据包属于步骤S401中发送的至少一个数据包,且第一装置尚未收到针对第三数据包的确认反馈。图5c示出乱序发送方式和单包反馈方式相结合的场景下本申请实施例提供的通信方法的流程图。在图5a的基础上,如图5c所示,该通信方法包括:
在步骤S601中,第一装置向第二装置发送数据包0和数据包1。
在步骤S602中,第二装置接收到了数据包0,未接收到数据包1。
在步骤S603中,第二装置向第一装置发送指示信息,所述指示信息中的序列号为1。
在步骤S604中,第一装置接收来自第二装置的指示信息后,确定数据包1为第二装置所期望的第一数据包。
由于数据包1属于步骤S601中已经发送的数据包,且步骤S602中未成功接收到的数据包中序列号最小的数据包。因此,数据包1为第二装置所期望的第一数据包。第二装置向第一装置发送的指示信息中可以包括数据包1的序列号,即1。第一装置接收到该指示信息后,可以确定未接收到针对数据包1的确认反馈。因此,第一装置可以确认数据包1为第三数据包。此时,第三数据包的序列号为1。
考虑到第四数据包的序列号大于第三数据包的序列号,任一个第四数据包的序列号P与第三数据包的序列号M的差值小于或者等于K。由于第三数据包的序列号为1,因此,第四数据包的序列号需要大于1。对于数据包2,其序列号(为2)大于第三数据包中序列号最大的第三数据包的序列号(为1),且其序列号P(为2)与每个第三数据包的序列号M的差值均小于K(为3),因此,数据包2可以作为第四数据包。同理,数据包3和数据包4也可以作为第四数据包。数据包5、数据包6和数据包7不能作为第四数据包。因此,第二装置可以将数据包2、数据包3和数据包4作为第四数据包。
在步骤S605中,第一装置确定数据包2、数据包3和数据包4为第四数据包。
在步骤S606中,第一装置在向第二装置发送数据包2、数据包3和数据包4之后,向第 二装置发送数据包1。
下面对乱序发送方式和批量反馈方式相结合的场景进行说明。
在该场景下,第一数据传输方式为乱序发送方式,第一数据反馈方式为批量反馈方式。
在该场景下,在步骤S403中,第二装置所期望的至少一个第一数据包包括一个或多个第七数据包。其中,所述一个或多个第七数据包表示在步骤S401中第一装置发送的至少一个数据包中第二装置未成功接收的数据包。
在该场景下,在步骤S405中,第一装置向第二装置发送的一个或多个数据包包括多个第四数据包,所述第四数据包的序列号大于第三数据包的序列号,所述第四数据包的序列号P与第三数据包的序列号M的差值小于或者等于K。第三数据包属于步骤S401中发送的至少一个数据包,且第一装置尚未收到针对第三数据包的确认反馈。K为预先配置或者定义的。P、M和K为大于或者等于0的整数。
图5d示出乱序发送方式和批量反馈方式相结合的场景下本申请实施例提供的通信方法的流程图。在图5a的基础上,如图5d所示,该通信方法包括:
在步骤S701中,第一装置向第二装置发送数据包0、数据包1、数据包2和数据包3。
在步骤S702中,第二装置接收到了数据包0和数据包2,未接收到数据包1和数据包3。
在步骤S703中,第二装置向第一装置发送指示信息,所述指示信息为1010。
在步骤S704中,第一装置接收来自第二装置的指示信息后,确认数据包1和数据包3为第二装置所期望的第一数据包。
在步骤S705中,第一装置确定数据包4为第四数据包。
由于数据包1和数据包3属于步骤S501中已发送的数据包,且步骤S502中第二装置未接收到的数据包。因此,数据包1和数据包3为第二装置所期望的第一数据包。第二装置向第一装置发送的指示信息为1010,以表明第二装置未成功接收到数据包1和数据包3。第一装置接收到该指示信息后,可以确定未接收到针对数据包1和数据包3的确认反馈。因此,第一装置可以确认数据包1和数据包3为第三数据包。此时,第三数据包的序列号包括1和3。
考虑到任一个第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个第四数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K。由于第三数据包的序列号包括1和3,因此,第四数据包的序列号需要大于3。对于数据包0至数据包3,其序列号小于3,因此不能作为第四数据包。对于数据包4,其序列号(为4)大于第三数据包的序列号M(包括1和3),且其序列号P(为4)与第三数据包的序列号M(包括1和3)的差值小于或者等于K(为3)。因此,数据包4可以作为第四数据包。对于数据包5,其序列号P(为5)与第三数据包的序列号M(包括1和3)的差值存在大于K(为3)的情况,因此,数据包5不能作为第四数据包。同理,数据包6和数据包7也不能作为第四数据包。
可以理解的,为了简单,第一装置可以仅使用至少一个第三数据包中序列号最小的数据包的序列号与任一第四数据包的序列号进行运算判断确定哪些数据包可以作为第四数据包。
在步骤S706中,第一装置向第二装置发送数据包1、数据包3、数据包4和数据包5。
在第一装置能够向第二装置连续发送的数据包的数量为4的情况下,第四数据包的数量小于第一装置能够向第二装置连续发送的数据包,因此,第一装置向第二装置发送的一个或 多个数据包除了被确定为第四数据包的“数据包4”以外,还可以包括需要重传的数据包“数据包1”和“数据包3”。由于需要重传的数据包的数量加上第四数据包的数量仍然小于第一装置能够向第二装置连续发送的数据包的数量,因此,第一装置向第二装置发送的一个或多个数据包还可以包括数据包5。
在本申请实施例中,虽然第二装置所期望的是数据包1和数据包3,但是第一装置向第二装置发送了数据包4和数据包5。这样,为序列号较大的数据包提供了发送机会。特别是对于序列号较大的数据包的优先级又比较高的情况,就是为优先级较高的数据包提供了发送机会,为高优先级的业务提供了保障。
在上述过程中,第一装置向第二装置发送的一个或多个数据包需要其序列号满足一定的条件,例如满足与第三数据包的序列号差值小于或者等于K,满足连续,满足大于第三数据包的序列号等。这种方式属于由第一装置控制发送的数据包。在本申请实施例的一种可能的实现方式中,可以第一装置完全按照第二装置期待的至少一个第一数据包进行发送。下面对这一可能的实施方式进行说明。
在乱序发送方式和单包反馈方式相结合的场景下,在步骤S403中,第二装置所期望的至少一个第一数据包包括一个第六数据包,其中,所述第六数据包表示优先级高于第五数据包的优先级。在步骤S405中,第一装置向第二装置发送的一个或多个数据包包括一个第六数据包,即为指示信息中指示的第六数据包。由第二装置决定期待的数据包是重发的数据包还是高优先级的数据包。这样,可以兼顾低优先级的数据包和高优先级的数据包。在步骤S401中,第一装置在向第二装置发送至少一个数据包时,在数据包中携带高优先级数据包的序列号。这样,第二装置收到任意一个数据包都能知道是否有高优先级的数据包,从而决定是重发数据包还是先发高优先级的数据包。
举例来说,以序列号的取值范围为0至7为例,可以将0至3确定为第二序列号区段,将4至7确定为第一序列号区段,第一序列号区段对应的优先级高于第二序列号区段对应的优先级,第一序列号区段中包括的序列号与第二序列号区段中包括的序列号不同。当第二装置成功接收到序列号为1的数据包且该数据包中指示了第一装置中存在序列号为4的数据包,则第二装置可以根据自己的需求确定NESN的值。如果第二装置期望接收高优先级数据包,则其可以设置NESN为4,从而在下次发送中使得第一装置发送高优先级数据包,此时第一装置不必判定序列号为4的数据包的序列号是否满足一定的条件。如果第二装置不期望接收高优先级数据包,则其可以设置NESN为2(即下一个数据包的序列号)。这样,通过第二装置的灵活选择,可以兼顾低优先级的数据包和高优先级的数据包的传输。
需要说明的是,在本申请实施例中,第二装置中存储的NESN可以保持为未接收到数据包的最小的序列号,当超过一定时间可以丢弃该数据包。将NESN加1。或者加到下一个未接收到的数据包的最小的序列号。
图6示出本申请实施例提供的通信装置的结构示意图。该通信装置可以为图2b所示的第一装置21,该通信装置可以部署在图3所示的电子设备中。如图6所示,该通信装置80可以包括:发送模块81,用于向第二装置发送至少一个数据包;接收模块82,用于接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;所述发送模块81还用于基于第一数据传输方式,向所述第二装置发送一个或多个数据包。
在本申请实施例中,在第一装置确定了第二装置所期望的至少一个第一数据包后,可以 结合第二装置的期望情况以及第一数据传输方式,确定向第二装置发送的一个或多个数据包,而不是简单的向第二装置发送其所期望的第一数据包,增加了第一装置发送的数据包的可能性,提高了数据传输的灵活性,改善了通信性能。具体的,第一装置中同时存在第二装置期望重传的数据包,以及等待首次发送的数据包,且需要重传的数据包的序列号小于等待首次发送的数据包的序列号。一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中可以包括等待首次发送的序列号较大的数据包,从而使其无需等待需要重传的数据包重传成功或者丢弃后再发送,缩短了等待首次发送的序列号较大的数据包的等待时间。另一方面,第一装置基于第一数据传输方式发送的一个或多个数据包中还可以包括需要重传的数据包,从而使重传数据包不会被等待首次发送的序列号较大的数据包一直抢占发送机会,从而保障了序列号较小的数据包的重传。因此,本申请实施例提供的通信方法可以兼顾等待首次发送的序列号较大的数据包与需要重传的序列号较小的数据包的传输。进一步的,由于节省了数据包等待发送的时间,因此减少了一个数据包发送端和接收端中的存储时间,因此本申请实施例提供的通信方法还可以节省发送端和接收端的存储资源和能耗,提高了对低成本、低功耗的短距离通信设备的适用性。
在一种可能的实现方式中,第一数据传输方式为顺序发送方式;所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
可选的,,所述至少一个第二数据包中每个第二数据包的序列号N与每个第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的,N、M和K为大于或者等于0的整数。
在一种可能的实现方式中,所述第一数据传输方式为乱序发送方式;所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个所述第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈,P、M和K为大于或者等于0的整数。
在一种可能的实现方式中,任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。
在一种可能的实现方式中,任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。
在一种可能的实现方式中,所述发送模块,还用于向所述第二装置发送第一信息,所述第一信息用于指示第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
在一种可能的实现方式中,所述接收模块,还用于接收来自所述第二装置的第一配置信息,所述第一配置信息用于配置所述第一数据传输方式。
在一种可能的实现方式中,所述K为基于所述第一装置的缓存区属性和所述第二装置的 缓存区属性配置或者定义的;或者,所述K为基于所述第一装置的发送窗大小和所述第二装置的接收窗大小配置或者定义的。
图7示出本申请实施例提供的通信装置的结构示意图。该通信装置可以为图2b所示的第二装置22,该通信装置可以部署在图3所示的电子设备上。如图7所示,该通信装置90可以包括:接收模块91,用于接收来自第一装置的至少一个数据包;发送模块92,用于基于第一数据反馈方式,向所述第一装置发送指示信息,所述指示信息用于指示第二装置所期望的至少一个第一数据包;所述接收模块91还用于接收来自所述第一装置的一个或多个数据包。
在本申请实施例中,第二装置可以基于第一数据反馈方式确定向第一装置反馈一个或多个期望的第一数据包,而不是简单的向第一装置反馈ACK或者NACK。在本申请实施例中,通过灵活的数据反馈,增加了第一装置发送的数据包的可选范围以及可选方式,使得第一装置具有批量发送或者乱序发送数据包的可能性。在序列号较小的数据包需要重传的情况下,为序列号较大的数据包提供了发送机会,使得序列号较大的数据包无需等待对序列号较小的数据包的确认反馈即可进行发送,这样,序列号较大的数据包不会因序列号较小的数据包的重传而阻断,保障了序列号较大的数据包的发送,提升了用户体验。
在一种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括一个第五数据包,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
在一种可能的实现方式中,所述第一数据反馈方式为批量反馈方式;所述至少一个第一数据包包括一个或多个第七数据包,所述一个或多个第七数据包表示所述至少一个数据包中未成功接收的数据包。
在一种可能的实现方式中,所述第一数据反馈方式为单包反馈方式;所述至少一个第一数据包包括一个第六数据包,所述第六数据包的优先级高于所述第五数据包的优先级。
在一种可能的实现方式中,所述接收模块还用于接收来自所述第一装置的第一信息,所述第一信息用于指示所述第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
在一种可能的实现方式中,所述发送模块还用于向所述第一装置发送第一配置信息,所述第一配置信息用于配置第一数据传输方式,所述第一数据传输方式为顺序发送方式或者乱序发送方式。
本申请的实施例提供了一种通信装置,包括:处理器以及用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述方法。
本申请的实施例还提供了一种通信装置,包括:至少一个处理器以及接口电路,其中,所述至少一个处理器被配置为通过所述接口电路实现上述方法。
本申请的实施例提供了一种电子设备,包括:处理器以及用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述方法。
本申请的实施例还提供了一种终端,包括:至少一个处理器以及接口电路,其中,所述至少一个处理器被配置为通过所述接口电路实现上述方法。
在一种可能的实现方式中,所述终端包括但不限于智能制造设备、智能穿戴设备、智能运输设备或者智能家居设备等。举例来说,智能制造设备可以为数控机床和智能电焊机等,智能穿戴设备可以为运动手表、智能眼镜和蓝牙耳机等,智能运输设备可以为智能传送机和智能搬运机等,智能家居设备可以为智能插座、智能电视、智能冰箱和智能洗衣机等。
本申请的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。
本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Electrically Programmable Read-Only-Memory,EPROM或闪存)、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。
这里参照根据本申请实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
附图中的流程图和框图显示了根据本申请的多个实施例的装置、系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。
也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行相应的功能或动作的硬件(例如电路或ASIC(Application Specific Integrated Circuit,专用集成电路))来实现,或者可以用硬件和软件的组合,如固件等来实现。
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其它变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其它单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
以上已经描述了本申请的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (31)

  1. 一种通信方法,其特征在于,所述方法包括:
    向第二装置发送至少一个数据包;
    接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;
    基于第一数据传输方式,向所述第二装置发送一个或多个数据包。
  2. 根据权利要求1所述的方法,其特征在于,所述第一数据传输方式为顺序发送方式;
    所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;
    其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
  3. 根据权利要求1所述的方法,其特征在于,所述第一数据传输方式为乱序发送方式;
    所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个所述第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;
    其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈,P、M和K为大于或者等于0的整数。
  4. 根据权利要求3所述的方法,其特征还在于,
    任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。
  5. 根据权利要求4所述的方法,其特征还在于,
    任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述方法还包括:
    接收来自所述第二装置的第一配置信息,所述第一配置信息用于配置所述第一数据传输方式。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法还包括:
    向所述第二装置发送第一信息,所述第一信息用于指示第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
  8. 根据权利要求3至5中任意一项所述的方法,其特征在于,
    所述K为基于所述第一装置的缓存区属性和/或所述第二装置的缓存区属性配置或者定义的;
    或者,
    所述K为基于所述第一装置的发送窗大小和/或所述第二装置的接收窗大小配置或者定义的。
  9. 一种通信方法,其特征在于,所述方法包括:
    接收来自第一装置的至少一个数据包;
    基于第一数据反馈方式,向所述第一装置发送指示信息,所述指示信息用于指示第二装 置所期望的至少一个第一数据包;
    接收来自所述第一装置的一个或多个数据包。
  10. 根据权利要求9所述的方法,其特征在于,所述第一数据反馈方式为单包反馈方式;
    所述至少一个第一数据包包括第五数据包,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
  11. 根据权利要求9所述的方法,其特征在于,所述第一数据反馈方式为单包反馈方式;
    所述至少一个第一数据包包括一个第六数据包,所述第六数据包的优先级高于第五数据包的优先级,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
  12. 根据权利要求9所述的方法,其特征在于,所述第一数据反馈方式为批量反馈方式;
    所述至少一个第一数据包包括一个或多个第七数据包,所述一个或多个第七数据包表示所述至少一个数据包中未成功接收的数据包。
  13. 根据权利要求9至12中任一项所述的方法,其特征在于,所述方法还包括:
    向所述第一装置发送第一配置信息,所述第一配置信息用于配置第一数据传输方式,所述第一数据传输方式为顺序发送方式或者乱序发送方式。
  14. 根据权利要求9至13中任一项所述的方法,其特征在于,所述方法还包括:
    接收来自所述第一装置的第一信息,所述第一信息用于指示所述第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
  15. 一种通信装置,其特征在于,所述装置包括:
    发送模块,用于向第二装置发送至少一个数据包;
    接收模块,用于接收来自所述第二装置的指示信息,所述指示信息用于指示所述第二装置所期望的至少一个第一数据包;
    所述发送模块,还用于基于第一数据传输方式,向所述第二装置发送一个或多个数据包。
  16. 根据权利要求15所述的装置,其特征在于,所述第一数据传输方式为顺序发送方式;
    所述一个或多个数据包包括多个第二数据包,所述多个第二数据包的序列号连续,所述多个第二数据包中序列号最小的数据包为至少一个第三数据包中序列号最小的第三数据包;
    其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈。
  17. 根据权利要求15所述的装置,其特征在于,所述第一数据传输方式为乱序发送方式;
    所述一个或多个数据包包括一个或多个第四数据包,任一个所述第四数据包的序列号大于至少一个第三数据包中序列号最大的第三数据包的序列号,任一个所述第四数据包的序列号P与每个第三数据包的序列号M的差值小于或者等于K,所述K是预先配置或者定义的;
    其中,对于任一个第三数据包,所述第三数据包属于所述至少一个数据包,且第一装置尚未接收到针对所述第三数据包的确认反馈,P、M和K为大于或者等于0的整数。
  18. 根据权利要求17所述的装置,其特征还在于,
    任一个所述第四数据包的优先级大于任一个所述第三数据包的优先级。
  19. 根据权利要求18所述的装置,其特征还在于,
    任一个所述第四数据包的序列号属于第一序列号区段,任一个所述第三数据包的序列号属于第二序列号区段,所述第一序列号区段对应的优先级高于所述第二序列号区段对应的优 先级,所述第一序列号区段中包括的序列号与所述第二序列号区段中包括的序列号不同。
  20. 根据权利要求15至19中任一项所述的装置,其特征在于,
    所述接收模块,还用于接收来自所述第二装置的第一配置信息,所述第一配置信息用于配置所述第一数据传输方式。
  21. 根据权利要求15至20中任一项所述的装置,其特征在于,
    所述发送模块,还用于向所述第二装置发送第一信息,所述第一信息用于指示第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
  22. 根据权利要求17至19中任一项所述的装置,其特征在于,
    所述K为基于所述第一装置的缓存区属性和/或所述第二装置的缓存区属性配置或者定义的;
    或者,
    所述K为基于所述第一装置的发送窗大小和/或所述第二装置的接收窗大小配置或者定义的。
  23. 一种通信装置,其特征在于,所述装置包括:
    接收模块,用于接收来自第一装置的至少一个数据包;
    发送模块,用于基于第一数据反馈方式,向所述第一装置发送指示信息,所述指示信息用于指示第二装置所期望的至少一个第一数据包;
    所述接收模块,还用于接收来自所述第一装置的一个或多个数据包。
  24. 根据权利要求23所述的装置,其特征在于,所述第一数据反馈方式为单包反馈方式;
    所述至少一个第一数据包包括第五数据包,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
  25. 根据权利要求23所述的装置,其特征在于,所述第一数据反馈方式为单包反馈方式;
    所述至少一个第一数据包包括一个第六数据包,所述第六数据包的优先级高于第五数据包的优先级,所述第五数据包表示所述至少一个数据包中未成功接收的数据包中序列号最小的数据包。
  26. 根据权利要求23所述的装置,其特征在于,所述第一数据反馈方式为批量反馈方式;
    所述至少一个第一数据包包括一个或多个第七数据包,所述一个或多个第七数据包表示所述至少一个数据包中未成功接收的数据包。
  27. 根据权利要求23至26中任一项所述的装置,其特征在于,
    所述发送模块,还用于向所述第一装置发送第一配置信息,所述第一配置信息用于配置第一数据传输方式,所述第一数据传输方式为顺序发送方式或者乱序发送方式。
  28. 根据权利要求23至27中任一项所述的装置,其特征在于,
    所述接收模块,还用于接收来自所述第一装置的第一信息,所述第一信息用于指示所述第一装置期望的数据传输方式或所述第一装置支持的数据传输方式。
  29. 一种通信装置,其特征在于,包括:
    至少一个处理器;
    接口电路;
    其中,所述至少一个处理器被配置为通过所述接口电路实现权利要求1至8中任意一项所述的方法,或者实现权利要求9至14中任意一项所述的方法。
  30. 一种非易失性计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至8中任意一项所述的方法,或者,实现权利要求9至14中任意一项所述的方法。
  31. 一种终端,包括:
    至少一个处理器;
    接口电路;
    其中,所述至少一个处理器被配置为通过所述接口电路实现权利要求1至8中任意一项所述的方法,或者实现权利要求9至14中任意一项所述的方法。
PCT/CN2022/101247 2021-07-02 2022-06-24 通信方法及装置 WO2023274082A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110750224.4 2021-07-02
CN202110750224.4A CN115499932B (zh) 2021-07-02 2021-07-02 通信方法及装置

Publications (1)

Publication Number Publication Date
WO2023274082A1 true WO2023274082A1 (zh) 2023-01-05

Family

ID=84465216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/101247 WO2023274082A1 (zh) 2021-07-02 2022-06-24 通信方法及装置

Country Status (2)

Country Link
CN (1) CN115499932B (zh)
WO (1) WO2023274082A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895378A (zh) * 2009-03-23 2010-11-24 捷讯研究有限公司 将上行链路数据块传输与搭载的ack/nack比特映射字段一起分配和传输的系统和方法
US20180004705A1 (en) * 2016-06-29 2018-01-04 Mellanox Technologies Ltd. Selective acknowledgment of RDMA packets
CN110546985A (zh) * 2017-03-24 2019-12-06 捷开通讯(深圳)有限公司 蜂窝无线系统技术领域的第二层架构
CN112913277A (zh) * 2018-11-02 2021-06-04 中兴通讯股份有限公司 数据传输与测量技术

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8913748B2 (en) * 2011-07-05 2014-12-16 Texas Instruments Incorporated Methods to improve bluetooth low energy performance
CN109392012B (zh) * 2017-08-11 2020-12-04 华为技术有限公司 一种数据处理方法及相关设备
CN111740808B (zh) * 2019-03-25 2022-07-22 华为技术有限公司 一种数据传输方法及装置
CN111865503A (zh) * 2019-04-30 2020-10-30 华为技术有限公司 一种发送、接收反馈信息的方法及设备
US11275648B2 (en) * 2020-03-03 2022-03-15 Qualcomm Incorporated Empty data packet hard align
CN112771821A (zh) * 2020-04-23 2021-05-07 深圳市大疆创新科技有限公司 数据传输方法、装置、系统、终端设备和存储介质
CN113346982B (zh) * 2021-05-31 2023-10-20 合肥中感微电子有限公司 数据传输方法、发送方法、接收方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895378A (zh) * 2009-03-23 2010-11-24 捷讯研究有限公司 将上行链路数据块传输与搭载的ack/nack比特映射字段一起分配和传输的系统和方法
US20180004705A1 (en) * 2016-06-29 2018-01-04 Mellanox Technologies Ltd. Selective acknowledgment of RDMA packets
CN110546985A (zh) * 2017-03-24 2019-12-06 捷开通讯(深圳)有限公司 蜂窝无线系统技术领域的第二层架构
CN112913277A (zh) * 2018-11-02 2021-06-04 中兴通讯股份有限公司 数据传输与测量技术

Also Published As

Publication number Publication date
CN115499932A (zh) 2022-12-20
CN115499932B (zh) 2023-07-18

Similar Documents

Publication Publication Date Title
JP6005710B2 (ja) 無線通信システムの状態情報送信方法及び受信装置
US20170164231A1 (en) Data transmission method and base station
JP5037633B2 (ja) 移動通信システムにおけるrlcpdu送信方法、無線リソース割当方法、及び移動通信システムのrlcエンティティ
MX2011001464A (es) Metodo y aparato para reportar un estado de la memoria intermedia.
WO2020156569A1 (zh) 发送rlc状态报告的方法、设备和存储介质
WO2020220885A1 (zh) 直通链路传输方法和终端
WO2018228477A1 (zh) 通信方法、网络设备和终端
WO2020220316A1 (zh) 一种反馈信息的确定方法及装置、终端
JP2022528316A (ja) サービス伝送およびサービス構成送信の方法ならびにデバイス、記憶媒体、端末、ならびに基地局
EP3490182B1 (en) Hybrid automatic repeat request method and system
WO2011052201A1 (ja) 通信端末および通信方法
WO2021233192A1 (zh) 一种无线链路控制状态报告的方法及对应装置
WO2023274082A1 (zh) 通信方法及装置
TWI486030B (zh) 無線通訊系統查詢資料傳輸狀況的方法及其相關裝置
WO2020147768A1 (zh) 处理数据的方法和处理数据的装置
WO2017177438A1 (zh) 一种控制信息的传输方法及装置
CN113455044B (zh) 用于使用配置授权的通信的装置、方法和计算机程序
WO2020199174A1 (zh) 通信方法、终端设备和网络设备
WO2024109556A1 (zh) 一种通信方法及装置
WO2024037254A1 (zh) 一种通信方法及装置
WO2023279359A1 (zh) 通信方法和装置
WO2024032354A1 (zh) 数据处理方法及装置
WO2024000533A1 (zh) 人工智能应用管理方法、装置及通信设备
WO2022257140A1 (zh) 数据发送的方法和通信装置
US20230262809A1 (en) Methods and Apparatus for Logical Channel Aggregation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831896

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22831896

Country of ref document: EP

Kind code of ref document: A1