WO2024027674A1 - 通信方法、设备及存储介质 - Google Patents

通信方法、设备及存储介质 Download PDF

Info

Publication number
WO2024027674A1
WO2024027674A1 PCT/CN2023/110463 CN2023110463W WO2024027674A1 WO 2024027674 A1 WO2024027674 A1 WO 2024027674A1 CN 2023110463 W CN2023110463 W CN 2023110463W WO 2024027674 A1 WO2024027674 A1 WO 2024027674A1
Authority
WO
WIPO (PCT)
Prior art keywords
heterogeneous network
network data
data frame
length
window
Prior art date
Application number
PCT/CN2023/110463
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 WO2024027674A1 publication Critical patent/WO2024027674A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Definitions

  • the present application relates to the field of communication, and in particular, to a communication method, device and storage medium.
  • Transmission control protocol is a reliable transmission protocol designed for the Internet, which fully considers bandwidth utilization.
  • TCP as a transmission protocol cannot meet the communication needs and is no longer applicable.
  • the main reasons are as follows: 1. TCP congestion control is static, and the congestion control strategies of different links are the same. However, the ecological application scenarios developed by various manufacturers may require flexible congestion control strategies. 2. TCP is deeply bound to the Internet protocol (IP), and the protocol overhead is relatively large. However, the ecological application scenarios developed by various manufacturers may require protocols with higher data transmission efficiency, which means that the protocol overhead should be smaller. 3. TCP logic is complex, portability is poor, and it cannot be lightweight. However, the ecological application scenarios developed by various manufacturers require lightweight and highly portable protocols, which facilitates deployment by various manufacturers to meet low-level requirements. Latency and high bandwidth network requirements.
  • This application provides a communication method, device and storage medium, which helps to improve communication efficiency and user experience.
  • the first aspect provides a communication method, applied to the sending device, including:
  • the heterogeneous network data frame does not include the network layer protocol frame header, and the length of the heterogeneous network data frame header is smaller than the length of the transport layer protocol frame header;
  • the frame header of the heterogeneous network data frame does not include the network layer protocol frame header, and the length of the frame header of the heterogeneous network data frame is shorter than the traditional transport layer frame header. Therefore, Header overhead can be saved, thereby improving the efficiency of data transmission.
  • the frame header of the heterogeneous network data frame includes a window length indication
  • the window length indication is used to indicate the receiving window length
  • the length of the window length indication is 8 bits.
  • the header overhead of the receive window length can be reduced, thereby improving data transmission efficiency.
  • the first bit of the window length indication is used to indicate whether there is a window amplification factor, and the last 7 bits of the window length indication are used to indicate the base length of the receiving window.
  • the first bit indicated by the window length is used to indicate whether there is a window magnification. Coarse adjustment and fine adjustment of the window can be achieved through the cooperation of the window magnification and the window base length. This can meet the window adjustment needs in different scenarios, thereby improving the performance of the window. transmission efficiency.
  • the receiving window length is determined by the basic length of the receiving window and the window amplification factor, where the window amplification factor is obtained through negotiation between the sending device and the receiving device. .
  • Any window size within the length of 65535 can be represented by 1 byte, which can reduce the size of the window used to represent it. s expenses.
  • the frame header of the heterogeneous network data frame includes at least one of the following:
  • the merge indication is used to indicate whether the current heterogeneous network data frame is merged with the subsequent heterogeneous network data frame.
  • the length of the merge indication is 1 bit;
  • the flow label is used to indicate the address of the receiving device.
  • the length of the flow label is 16 bits;
  • the transmission index indication is used to indicate the number of transmissions or retransmissions of heterogeneous network data frames.
  • the length of the transmission index indication is 2 bits.
  • the 1-bit merging indication can be used to divide the service segments, so that the receiving device can understand the service segments, thereby improving the efficiency of the receiving device in querying the service.
  • the header overhead can be saved by replacing the traditional expensive TCP/IP five-tuple with a 16-bit flow label.
  • the header overhead can be greatly saved.
  • the method further includes:
  • connection request is carried through a heterogeneous network data frame, and the connection request is used to request to establish a connection with the receiving device;
  • the sending device can initiate a connection request with a smaller header overhead, thereby improving communication efficiency.
  • the sending device can initiate the end request with a smaller header overhead, thereby improving communication efficiency.
  • the method further includes:
  • the congestion control algorithm is negotiated with the receiving device.
  • the flexibility of congestion control can be improved, resulting in higher bandwidth utilization, lower transmission delay, and improved service processing efficiency.
  • the method further includes:
  • session negotiation is performed with the receiving device, in which session negotiation parameters are carried by the extension header of the heterogeneous network data frame.
  • the heterogeneous network consists of one or more of wireless fidelity Wi-Fi, Bluetooth, low-power Bluetooth, and Ethernet.
  • heterogeneous network data frames By diversifying heterogeneous networks, the application scenarios of heterogeneous network data frames can be expanded, making heterogeneous network data frames more compatible.
  • the method further includes:
  • the confirmation information is used to confirm one or more heterogeneous network data frames sent by the sending device.
  • the second aspect also provides a communication method, applied to the receiving device, including:
  • heterogeneous network data frame in a heterogeneous network; wherein the heterogeneous network data frame does not include a network layer protocol frame header, and the length of the frame header of the heterogeneous network data frame is less than the length of the transport layer protocol frame header;
  • the application layer that sends the payload to the receiving device.
  • the frame header of the heterogeneous network data frame does not include the network layer protocol frame header, and the length of the frame header of the heterogeneous network data frame is shorter than the traditional transport layer frame header. Therefore, Header overhead can be saved, thereby improving the efficiency of data transmission.
  • the method after receiving the heterogeneous network data frame in the heterogeneous network, the method further includes:
  • the confirmation information is used to confirm one or more heterogeneous network data frames sent by the sending device.
  • acknowledgment information for acknowledging multiple heterogeneous network data frames By sending acknowledgment information for acknowledging multiple heterogeneous network data frames to the sending device, multiple acknowledgments of multiple heterogeneous network data can be avoided, thereby avoiding network congestion caused by multiple sending of acknowledgment information, thereby improving Bandwidth utilization.
  • the method before receiving the heterogeneous network data frame in the heterogeneous network, the method further includes:
  • connection request sent by the sending device, establish a connection with the sending device based on the connection request, and the connection request is carried by the heterogeneous network data frame;
  • the end request is carried through a heterogeneous network data frame.
  • the end request is used to initiate a disconnection from the sending device.
  • the receiving device can initiate a connection request with a smaller header overhead, thereby improving communication efficiency.
  • the receiving device can initiate the end request with a smaller header overhead, thereby improving communication efficiency.
  • the method further includes:
  • the congestion control algorithm is negotiated with the sending device.
  • the flexibility of congestion control can be improved, resulting in higher bandwidth utilization, lower transmission delay, and improved service processing efficiency.
  • the method further includes:
  • session negotiation is performed with the sending device, where the session negotiation parameters are carried by the extension header of the heterogeneous network data frame.
  • the heterogeneous network consists of one or more of wireless fidelity Wi-Fi, Bluetooth, low-power Bluetooth, and Ethernet.
  • heterogeneous network data frames By diversifying heterogeneous networks, the application scenarios of heterogeneous network data frames can be expanded, making heterogeneous network data frames more compatible.
  • the third aspect provides a sending device, which includes modules/units that perform the method of the first aspect or any possible design of the first aspect; these modules/units can be implemented by hardware or executed by hardware. Corresponding software implementation.
  • the fourth aspect also provides a receiving device, which includes modules/units that perform the method of the second aspect or any possible design of the second aspect; these modules/units can be implemented by hardware, or can be implemented by hardware. Execute the corresponding software implementation.
  • the fifth aspect also provides a sending device, including: a processor and a memory, the memory being used to store a computer program; the processor being used to run the computer program, so that the sending device implements the method described in the first aspect communication method.
  • the sixth aspect also provides a receiving device, including: a processor and a memory, the memory being used to store a computer program; the processor being used to run the computer program, so that the receiving device implements the method described in the second aspect communication method.
  • the seventh aspect also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to implement the method described in the first aspect or the second aspect. Communication methods.
  • An eighth aspect provides a computer program that, when the above computer program is run on a processor of a sending device, causes the sending device to perform the communication method as described in the first aspect, or when the above computer program is run on a processor of a receiving device When running on the mobile phone, the receiving device is caused to perform the communication method described in the second aspect.
  • the program in the eighth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory that is not packaged with the processor.
  • a ninth aspect provides a communication system, including the sending device as described in the fifth aspect and the receiving device as described in the sixth aspect.
  • Figure 1 is an application scenario architecture diagram provided by the embodiment of this application.
  • FIG. 2 is a schematic structural diagram of the equipment provided by the embodiment of the present application.
  • Figure 3 is a protocol stack architecture diagram provided by an embodiment of this application.
  • Figure 4a is a schematic diagram of a heterogeneous network data frame provided by an embodiment of the present application.
  • Figure 4b is a schematic diagram of a universal extension header provided by an embodiment of the present application.
  • Figure 4c is a schematic diagram of an extension header carrying Flow Label parameters provided by an embodiment of the present application.
  • Figure 4d is a schematic diagram of an extension header carrying MSS parameters provided by an embodiment of the present application.
  • Figure 4e is a schematic diagram of an extension header carrying Scaling Factor parameters provided by the embodiment of the present application.
  • Figure 4f is a schematic diagram of an extension header carrying Service ID parameters provided by the embodiment of the present application.
  • Figure 4g is a schematic diagram of an extension header carrying SN parameters provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the L2 frame format provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of state machine changes provided by the embodiment of the present application.
  • Figure 7 is a schematic flow chart of an embodiment of the communication method provided by this application.
  • Figure 8 is a schematic flow chart of another embodiment of the communication method provided by this application.
  • Figure 9 is a schematic diagram of the data block transmission mode provided by the embodiment of the present application.
  • Figure 10 is a schematic flow chart of yet another embodiment of the communication method provided by this application.
  • FIG 11 is a schematic structural diagram of an embodiment of the sending device provided by this application.
  • Figure 12 is a schematic structural diagram of an embodiment of a receiving device provided by this application.
  • the character "/" indicates that the related objects are an or relationship.
  • A/B can mean A or B.
  • “And/or” describes the relationship between related objects, indicating that three relationships can exist.
  • a and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • at least one of the following” or similar expressions thereof refers to any combination of these items, which may include any combination of a single item (items) or a plurality of items (items).
  • at least one item (item) of A, B or C can represent: A, B, C, A and B, A and C, B and C, or A, B and C.
  • each of A, B, and C can itself be an element, or it can be a set containing one or more elements.
  • transmission can include sending and/or receiving, and can be a noun or a verb.
  • the equals involved in the embodiments of this application can be used in conjunction with greater than, and are applicable to the technical solution adopted when it is greater than, and can also be used in conjunction with less than, and are applicable to the technical solution adopted when it is less than. It should be noted that when equal is used with greater than, it cannot be used with less than; when equal to is used with less than, it is not used with greater than.
  • TCP is a reliable transmission protocol designed for the Internet, which takes full consideration of bandwidth utilization.
  • TCP as a transmission protocol cannot meet the communication needs and is no longer applicable.
  • the embodiment of this application proposes a communication method, which is applied to equipment to improve communication efficiency and meet network deployment requirements.
  • Figure 1 is an application scenario architecture diagram provided by the embodiment of this application.
  • the above application scenario includes multiple devices, such as device A, device B, device C, device D, etc.
  • multiple devices can form a heterogeneous network, which refers to a network with diverse transmission media.
  • the above-mentioned transmission media includes but is not limited to wireless fidelity (Wi-Fi), Bluetooth (bluetooth, BT), low-power Bluetooth (bluetooth low energy, BLE), and Ethernet (ethernet, ETH).
  • the device can be a fixed terminal, such as a laptop computer, a desktop computer, a smart home device, etc.
  • the device may also be a mobile terminal, such as a mobile phone, tablet, etc.
  • a mobile terminal can also be called User Equipment (UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user Agent or user device.
  • the mobile terminal can be a station (ST) in WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, or a personal digital processing station.
  • SIP Session Initiation Protocol
  • WLL wireless Local Loop
  • PDA Personal Digital Assistant
  • handheld device with wireless communication function computing device or other processing device connected to a wireless modem, vehicle-mounted device, Internet of Vehicles terminal, computer, laptop computer, handheld communication device, handheld Computing equipment, satellite wireless equipment, wireless modem cards, television set top boxes (STBs), customer premise equipment (CPE) and/or other equipment used to communicate over wireless systems, and next generation communications systems , for example, mobile terminals in 5G networks or mobile terminals in future evolved Public Land Mobile Network (PLMN) networks.
  • the mobile terminal may also be a wearable device.
  • Wearable devices can also be called wearable smart devices. It is a general term for applying wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes, etc.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction.
  • Figure 2 exemplarily shows a schematic structural diagram of the device 100.
  • the device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user Identification module (subscriber identification module, SIM) card interface 195, etc.
  • a processor 110 an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the device 100.
  • the device 100 may include more or fewer components than shown in the figures, or some components may be combined, or some components may be separated, or may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • Interfaces may include integrated circuits (inter- integrated circuit (I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (PCM) interface, universal asynchronous receiver/transmitter (UART) interface, Mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and/or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C inter- integrated circuit
  • I2S integrated circuit sound
  • PCM pulse code modulation
  • UART Universal asynchronous receiver/transmitter
  • MIPI Mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationships between the modules illustrated in the embodiment of the present invention are only schematic illustrations and do not constitute a structural limitation on the device 100 .
  • the device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charge management module 140 may receive wireless charging input through the wireless charging coil of the device 100 . While the charging management module 140 charges the battery 142, it can also provide power to the device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor, etc.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194.
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110 and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation
  • the antenna 1 of the device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160. Coupling allows the device 100 to communicate with the network and other devices through wireless communication technology.
  • the device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, etc.
  • Display 194 includes a display panel.
  • the device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the optical signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
  • Camera 193 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • the device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Device 100 may support one or more video codecs. In this way, the device 100 can play or record videos in multiple encoding formats.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • the NPU can realize intelligent cognitive applications of the device 100, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the device 100 (such as audio data, phone book, etc.).
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or a flash memory device.
  • the processor 110 executes various functional applications and data processing of the device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • Device 100 can listen to music through speaker 170A, or listen to hands-free phone calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the voice can be heard by bringing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the headphone interface 170D is used to connect wired headphones.
  • the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • the gyro sensor 180B may be used to determine the motion posture of the device 100 .
  • the angular velocity of device 100 about three axes ie, x, y, and z axes
  • Air pressure sensor 180C is used to measure air pressure.
  • device 100 measures air pressure via air pressure sensor 180C. Pressure value to calculate altitude, assist positioning and navigation.
  • Magnetic sensor 180D includes a Hall sensor.
  • the acceleration sensor 180E can detect the acceleration of the device 100 in various directions (generally three axes).
  • Distance sensor 180F for measuring distance.
  • Device 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the device 100 may utilize the distance sensor 180F to measure distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • LED light emitting diode
  • a light detector such as a photodiode
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • Fingerprint sensor 180H is used to collect fingerprints.
  • the device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
  • Temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also known as "touch device”.
  • the touch sensor 180K can be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through display screen 194 .
  • Bone conduction sensor 180M can acquire vibration signals.
  • the buttons 190 include a power button, a volume button, etc.
  • the motor 191 can generate vibration prompts.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • FIG 3 is a schematic diagram of the protocol stack architecture of the device provided by the embodiment of the present application.
  • the protocol stack architecture includes the application layer, heterogeneous network transport layer, and physical layer.
  • the application layer is used to generate or receive business data, which can also be considered as payload. It can be understood that, for the sending device, the device acting as the sending device generates service data; for the receiving device, the device acting as the receiving device receives the service data.
  • the heterogeneous network transport layer is used to encapsulate business data to obtain heterogeneous network data frames, or to decapsulate heterogeneous network data frames to obtain business data.
  • the heterogeneous network data frames can be SFC frames.
  • SFC softbus fabric communication
  • the above-mentioned SFC is only an illustrative description and does not constitute a limitation on the embodiments of the present application.
  • the above-mentioned heterogeneous network transmission layer can be named by any name, and only needs to be implemented with the heterogeneous network transmission layer.
  • the device as the sending device receives the service data from the application layer and encapsulates the service data from the application layer to obtain a heterogeneous network data frame; for the receiving device, the device as the receiving device receives the service data from the physical layer.
  • the physical layer is used to send heterogeneous network data frames to the peer end or receive heterogeneous network data frames from the peer end. It can be understood that for the sending device, the device serving as the sending device sends heterogeneous network data frames to the receiving device; for the receiving device, the device serving as the receiving device receives the heterogeneous network data frames from the sending device.
  • the heterogeneous network transport layer replaces the traditional transport layer protocol, such as the TCP layer or the User Datagram Protocol (UDP) layer.
  • this application is applied to communication within the same local area network.
  • the second-layer communication (for example, the media access control layer) can solve the communication without the participation of the third layer (for example, the IP layer). Therefore, the IP layer can be omitted, thus It can save the IP encapsulation process and save data processing delay, which can effectively reduce the delay and improve communication efficiency.
  • the IP layer no longer participates in data encapsulation, the header overhead can be greatly reduced, thereby further improving data transmission efficiency.
  • the heterogeneous network transport layer and physical layer are completely decoupled, and there is no binding to other protocol layers (for example, IP layer), making the protocol stack architecture lightweight and improving portability. Meet the needs of netting.
  • the embodiments of the present application realize the encapsulation of the application layer payload by constructing a heterogeneous network transport layer, but this does not constitute a limitation on the embodiments of the present application.
  • the functions of the heterogeneous network transport layer may be transplanted to the application layer, so that the application layer payload can be encapsulated into a heterogeneous network data frame through the application layer.
  • the frame structure of the heterogeneous network data frame is exemplified with reference to Figure 4a.
  • the above heterogeneous network data frame includes V (Version), P (Priority), TI (Transmit Index), M (Merge), Window, O (Optional), C (Crowding), T (Type), Length , Checksum, Flow Label, SN (Sequence Number) and other fields.
  • the V field is used to represent the version number of the heterogeneous network data frame, so that the protocol can be extended to be compatible with new heterogeneous network data frames and old heterogeneous network data frames.
  • the length of the V field can be 2 bits.
  • the initial version can be 0, and after version expansion, the version can be upgraded to 1.
  • the P field is used to characterize the priority of heterogeneous network data frames.
  • the length of the P field is 3 bits. Therefore, it can include a maximum of 8 priorities.
  • the TI field is used to characterize the transmission index of heterogeneous network data frames.
  • the value of the TI field may be 0 when the heterogeneous network data frame is sent for the first time, and the value of the TI field may be incremented when the heterogeneous network data frame is retransmitted.
  • the length of the TI field can be 2 bits, so the maximum value of the TI field is 3. It can be understood that when the heterogeneous network data frame is retransmitted from the first to the third time, that is, in the process of the value of the TI field increasing from 1 to 3, the time consumed in transmitting the heterogeneous network data frame is Can be used for calculation of round trip time (RTT).
  • RTT round trip time
  • the M field is a merge indication, which is used to indicate whether the current heterogeneous network data frame is merged with the subsequent heterogeneous network data frame.
  • the TCP protocol is a stream protocol and uses a byte stream (stream) mode.
  • byte stream mode the sending device sends data in the form of a data stream.
  • each data usually has the same size, and the receiving device will receive these data streams composed of multiple data continuously. Therefore, the receiving device cannot distinguish the pause points of the data stream, and therefore cannot distinguish the segments of the service.
  • the data block mode can be adopted. This data block mode can divide services into multiple segments for sending, and each segment can include multiple data.
  • the M field indicates whether the data is the last data of the paragraph, thereby indicating the end of each paragraph to the receiving device, thereby allowing the receiving device to distinguish service paragraphs.
  • the length of the M field may be 1 bit. For example, if the value of the M field is 1, it indicates that the current heterogeneous network data frame is merged with the subsequent heterogeneous network data frame. That is to say, the heterogeneous network data frame is not the last data of a business segment; If the value of the M field is 0, it indicates that the current heterogeneous network data frame will not be merged with subsequent heterogeneous network data frames. That is to say, the heterogeneous network data frame is the last data of a service segment.
  • the heterogeneous network data frame is not the last data of a business segment. If M If the value of the field is 1, it indicates that the current heterogeneous network data frame will not be merged with subsequent heterogeneous network data frames. That is to say, the heterogeneous network data frame is the last data of a business segment.
  • the Window field is used to characterize the receive window length, which can pass the number of heterogeneous network data frames.
  • the length of the Window field can be 8 bits.
  • the Window may include two window modes, for example, a first mode and a second mode.
  • the first mode may be a coarse adjustment mode, and the coarse adjustment mode may include a window magnification, and the window magnification may be obtained through negotiation between the sending device and the receiving device.
  • the second mode is a fine adjustment mode, which does not include window magnification.
  • the first bit in the 8 bits of the Window field can be used to indicate the above two modes. For example, if the first bit of the Window field is 0, it indicates that the current window mode is the first mode, and the last 7 bits of the Window field may indicate the basic window length.
  • the embodiment of the present application uses 1 byte (that is, 8 bits) to indicate the length of the reception window, which can greatly reduce the header overhead, thereby improving data transmission efficiency.
  • the O field is used to indicate whether there is an extension header (Optional Header), where the number of extension headers can be 0-N, and N is a positive integer.
  • the length of each extension header is 32 bits.
  • the length of the O field may be 1 bit. For example, if the value of the O field is 1, it indicates that the extension header exists; if the value of the O field is 0, it indicates that there is no extension header. Alternatively, if the value of the O field is 0, it indicates that the extension header exists; if the value of the O field is 1, it indicates that there is no extension header.
  • Figure 4b shows the general format of the extension header.
  • the extension header can include fields such as E, TP, LENGTH and value.
  • the E field is used to indicate whether the extension header has ended, and the length of the E field is 1 bit. For example, if the value of the E field is 1, it may indicate that the current extension header is the last extension header; or if the value of the E field is 0, it may indicate that the current extension header is the last extension header.
  • the TP field is used to characterize the type of negotiation parameters in the extension header.
  • the negotiation parameters may include but are not limited to: Flow Label, MSS, Scaling Factor, Service ID, SN and other parameters.
  • the length of the TP field is 7 bits.
  • Flow Label is used to indicate the assigned flow label.
  • the length of Flow Label is 2 bytes.
  • the flow label is determined by the server device It is determined that the flow label is negotiated through the extension header in the client device or server device. If the server device carries a flow label of 0, it means that there is no available flow label.
  • the method of negotiating flow labels can be:
  • the client device sends an initialization request, which can be carried through a heterogeneous network data frame.
  • the Flow Label field in the header of the initialization request can be 0.
  • the server device receives the initialization request, it can send a synchronization request to the client device.
  • the synchronization request can be carried through a heterogeneous network data frame.
  • the synchronization request includes an extension header, and the extension header can carry Flow Label suggestions. value, the Flow Label field in the header of the synchronization request can be 0.
  • the client device replies with ACK information
  • the ACK information can be carried through a heterogeneous network data frame.
  • the ACK information includes an extension header, and the extension header carries a confirmation value.
  • the Flow Label field of the header in the ACK information can be 0.
  • Flow Label negotiation can be successfully completed.
  • the client device replies with NACK information
  • the NACK information can be carried through the heterogeneous network data frame.
  • the server device can be notified that the Flow Label suggested value carried in the extension header is in conflict, so that the next round of Flow can be started.
  • Label negotiation the Flow Label field in the header of the NACK message can be 0.
  • the server device receives the NACK message, it can resend the synchronization request to the client device, thus starting a new round of Flow Label negotiation.
  • MSS is used to characterize the size of data that the sending device can receive.
  • the length of the MSS is 2 bytes.
  • the MSS does not require a negotiation process. Both parties can notify the opposite end of their proposed MSS value.
  • the opposite end receives the MSS value, the opposite end can assemble a data frame based on the suggested MSS value.
  • the MSS may be defaulted to 1484 bytes, where 1484 may be obtained by MTU-16.
  • the value of Scaling Factor can be specified by the client device.
  • the server device receives the value of Scaling Factor and replies with the same response value, the negotiation can be considered successful.
  • Service ID is an identification number used to characterize the business.
  • the Service ID is carried by the client device when it initiates a connection request, thereby indicating the service to be connected.
  • the server device receives the Service ID, if the Service ID exists, it can further negotiate the connection, otherwise, it can send a reset (RST) message. It is understandable that during the connection establishment process, both parties need to carry the Service ID parameter.
  • SN is used to characterize the sequence number of heterogeneous network data frames. It is understandable that both parties can choose an initial value and send it to the other end during the initial handshake. If a confirmation is received, the negotiation can be considered successful.
  • Figure 4c shows the extension header format where the negotiation parameter is Flow Label.
  • the negotiation parameter is MSS as an example for explanation.
  • Figure 4d shows the extension header format in which the negotiation parameter is MSS.
  • the negotiation parameter is Scaling Factor as an example for explanation.
  • Figure 4e shows the extension header format where the negotiation parameter is MSS.
  • the negotiation parameter is Service ID as an example for explanation.
  • Figure 4f shows the extension header format where the negotiation parameter is MSS.
  • Figure 4g shows the extension header format where the negotiation parameter is SN.
  • the LENGTH field is used to indicate the length of the value field, in bytes.
  • the length of the LENGTH field is 8 bits.
  • the Value field is used to represent the value of the negotiation parameter.
  • extension header may appear during the process of connection establishment and connection disconnection. During the data transmission process, the above-mentioned extension header will not appear, thereby reducing the header overhead of the heterogeneous network data frame, thus Data transmission efficiency can be improved.
  • the C field is used to indicate whether congestion exists.
  • the length of the C field can be 1 bit. For example, if the value of the C field is 1, it indicates that congestion exists; if the value of the C field is 0, it indicates that there is no congestion. Or, if the value of the C field is 0, it indicates that congestion exists, and if the value of the C field is 1, it indicates that there is no congestion.
  • the T field is used to indicate the type of heterogeneous network data frame.
  • the type can include but is not limited to initialization, response, data, end and other types.
  • the length of the T field can be 3 bits.
  • the Length field is used to indicate the length of the payload in the heterogeneous network data frame.
  • the length of the Length field can be 12 bits.
  • the Checksum field is used to verify the validity of heterogeneous network data frames.
  • the length of the Checksum field can be 16 bits. Among them, when the value of Checksum is all 0, it can be considered that no verification is required. It is understandable that in addition to the above Checksum, validity verification can also be performed through Cyclic Redundancy Check (CRC) and other methods. Tested, this application Please do not specifically limit this in the embodiment.
  • CRC Cyclic Redundancy Check
  • the Flow Label field is used to characterize the address of the receiving device.
  • the length of the Flow Label field can be 16 bits. Since the TCP protocol is suitable for the Internet, which involves IP routing selection, TCP/IP is usually used for routing selection through five-tuples, and the header overhead of the five-tuple is large.
  • the embodiment of this application is applied to the local area network to solve the communication problem within the local area network and does not involve the external network. Therefore, there is no routing problem.
  • the above-mentioned five-tuple function in TCP/IP can be realized through the above-mentioned Flow Label. This can further reduce header overhead and improve data transmission efficiency.
  • heterogeneous network data frames can also be applied to wide area networks or the Internet. At this time, the above heterogeneous network data frames can be carried through network layers such as the IP layer, and the above Flow Label field and IP address can be used together Determine the corresponding address.
  • the SN field is used to indicate the sequence number of the heterogeneous network data frame.
  • the length of the SN field can be 32 bits.
  • the frame header of the transport layer protocol and the frame header of the network layer protocol will occupy a large header overhead of the message.
  • the transport layer protocol as TCP and the network layer protocol as IPv4 as an example
  • the TCP frame header occupies 20 bytes and the IPv4 frame header occupies 20 bytes.
  • the frame header of the transport layer protocol and the frame header of the network layer protocol occupy a total of 40 bytes; taking the transport layer protocol as TCP and the network layer protocol as IPv6 as an example, the TCP frame header occupies 20 bytes and the IPv6 frame header occupies 40 bytes.
  • the frame header of the transport layer protocol and the network layer protocol occupies a total of 60 bytes, which will greatly reduce the data transmission efficiency.
  • the heterogeneous network data frame does not include the network layer protocol frame header, thereby saving the header overhead of the network layer protocol.
  • the overhead of the entire frame header of a heterogeneous network data frame is 12 bytes (that is, 96 bits), which is far less than the header overhead of existing transport layer protocols.
  • the header overhead is greatly reduced. For example, compared with the 40-byte header overhead of TCP and IPv4, heterogeneous network data frames can save 28 words. Section header overhead; compared with the 60-byte header overhead of TCP and IPv6, heterogeneous network data frames can save 48 bytes of header overhead, which can greatly reduce the header overhead and improve data transmission efficiency.
  • L2 layer 2
  • the L2 data frame is a MAC frame.
  • Figure 5 is a schematic diagram of the format of the MAC frame. Referring to Figure 5, the MAC frame includes fields such as Preamble, SFD, DstMAC, SrcMAC, Type, SFC Frame and FCS.
  • the Preamble field is the preamble, which is used to enable the adapter of the receiving device to quickly adjust the clock frequency when receiving the MAC frame so that it is the same as the frequency of the sending device.
  • the length of the Preamble field can be 7 bytes, with 1s and 0s alternating.
  • the SFD field is used to characterize the start character of the MAC frame.
  • the length of the SFD field is 1 byte.
  • the first 6 bits are 1 and 0 alternately.
  • the last two bits of continuous 1 are used to inform the receiving device adapter: "Frame information needs to be Here you go, ready to receive.”
  • the DstMAC field is the destination address, which is used to represent the MAC address or physical address of the network adapter that receives the MAC frame.
  • the length of the DstMAC is 6 bytes. It can be understood that when the receiving device receives a MAC frame, it will first check whether the destination address of the MAC frame is the same as the physical address of the current adapter. If it is the same, it will be further processed; if it is different, the byte will be discarded. frame.
  • the SrcMAC field is the source address and is used to represent the MAC address or physical address of the network adapter that sends the MAC frame.
  • the length of the SrcMAC is 6 bytes.
  • the Type field is used to indicate the type of high-level data carried in the layer 2 data frame. Since there are many upper-layer protocols, the Type field can be used to indicate which high-level protocol the data is delivered to for processing.
  • the length of the Type field is 2 bytes. For example, if the value of the Type field is 0xABAB, it can indicate that the high-level data carried in the layer 2 data frame is a heterogeneous network data frame. If the value of the Type field is 0x0800, then it can Indicates that the higher layer data carried in the layer 2 data frame is an IP frame. It can be understood that the above 0xABAB and 0x0800 are only illustrative descriptions and do not constitute a limitation on the embodiments of the present application. In some embodiments, heterogeneous network data frames and IP frames may also be indicated by other values.
  • the SFC Frame field is used to characterize the heterogeneous network data frame.
  • the minimum length of the SFC Frame field can be 46 bytes and the maximum length can be 1500 bytes, which can also be called the maximum transmission unit. When it is less than 46 bytes, it can be padded to 46 bytes.
  • the FCS field is the frame detection sequence, used to detect whether errors occur in the MAC frame.
  • the length of this FCS field is 4 bytes. It can be understood that the sending device calculates the Cyclic Redundancy Check (CRC) of the MAC frame and writes it into the FCS field. The receiving device recalculates the CRC and compares it with the CRC value in the FCS field; if the two are not the same, it means that the data has been lost or changed during the transmission. At this time, the MAC frame needs to be retransmitted.
  • CRC Cyclic Redundancy Check
  • heterogeneous network data frame can be carried through other layers, such as layer 3 or layer 4, which is not specifically limited in the embodiment of the present application.
  • the status of the device may include shutdown status, initialization status, listening status, synchronization status, connection status, end waiting status, and shutdown waiting status.
  • the closed state can be the initial state of the client device and the server device.
  • the one that actively requests to establish a connection can be the client device, and the one that responds passively can be the server device.
  • the client device and the server device can be a sending device or a receiving device. When the client device serves as a sending device, the server device serves as a receiving device; or, when the client device serves as a receiving device, the server device serves as a sending device.
  • the client device After the client device creates the Socket, it can call the connect interface, and can send an initialization request to the server device when it is in the closed state, so that it can enter the initialization state from the closed state.
  • the server device After the server device creates the Socket, it needs to listen to the initialization request. Therefore, it can call the listen interface, which can transform the closed state into the listening state and start listening.
  • the server device listens to the initialization request in the listening state, if it agrees to establish a connection, it can send a synchronization request to the client device, thereby entering the synchronization state from the listening state; if it does not agree to establish a connection, it does not need to reply with any information. .
  • the client device After the client device receives the synchronization request in the initialization state, if there is no problem with the parameters in the synchronization request, it can send confirmation information (such as ACK) to the server device, thereby entering the connection state from the initialization state, indicating that it is connected to the server.
  • confirmation information such as ACK
  • the connection of the device is successfully established, so that data interaction with the server device can be carried out; if there is a problem with the parameters in the synchronization request, non-confirmation information (such as NACK) can be sent to the server device.
  • NACK non-confirmation information
  • the server device After the server device receives the confirmation information in the synchronization state, it can enter the connection state from the synchronization state, indicating that the connection with the client device is successfully established, so that it can interact with the client device.
  • the server device receives the confirmation information in the synchronization state, After the non-confirmation information is received, the synchronization request can be resent to the client device, thereby starting a new round of negotiation with the client device. At this time, the status of the server device does not switch.
  • the client device and/or the server device When the client device and/or the server device are in the initialization state or synchronization state, if no response is received from the other party, the client device and/or the server device can enter the shutdown state after a preset period of time. At this time, the connection is established. Fails and releases the corresponding resources.
  • any party can actively initiate a disconnection.
  • the way to proactively initiate the disconnection may be to notify the peer through control information.
  • either party can actively disconnect after the heartbeat times out. In this case, there is no need to notify the other party.
  • the client device When the client device is in the connected state, it can actively initiate a disconnection. At this time, the client device can actively send an end request to request a disconnection. After the client device sends the end request, it can enter the end waiting state from the connection state.
  • the server device receives the end request in the connection state, it can send an end confirmation to the client device, thereby entering the close waiting state from the connection state, indicating that the server device is ready to disconnect.
  • the client device receives the end confirmation in the end waiting state, it can send a confirmation message to the server device, so that it can enter the closed state from the end waiting state, indicating that the connection is successfully disconnected.
  • the server device receives the confirmation message in the shutdown waiting state, it can enter the shutdown state from the shutdown waiting state, indicating that the connection is successfully disconnected.
  • the server device When the server device is in the connected state, it can actively initiate a disconnection. At this time, the server device can actively send an end request to request a disconnection. After the server device sends the end request, it can enter the end waiting state from the connection state.
  • the client device receives the end request in the connection state, it can send an end confirmation to the server device, thereby entering the close waiting state from the connection state, indicating that the client device is ready to disconnect.
  • the server device receives the end confirmation in the end waiting state, it can send a confirmation message to the client device, so that it can enter the closed state from the end waiting state, indicating that the connection is successfully disconnected.
  • the client device After the client device receives the confirmation message in the close waiting state, it can enter the closed state from the close waiting state, indicating that the connection is disconnected successfully.
  • the client device and/or the server device are in the end waiting state or the closing waiting state, if no response is received from the other party, they can switch to the closing state after a preset period of time. At this time, the connection is disconnected. Open successfully and release the corresponding resources.
  • FIG. 7 is a schematic flowchart of an embodiment of a communication method provided by this application.
  • the above communication method can be applied between any two devices (for example, device A and device B).
  • device A can be a client device
  • device B can be a server device.
  • device; or device A can be a server device
  • device B can be a client device.
  • the following takes device A as the client device and device B as the server device as an example for illustrative explanation.
  • the specific steps include the following:
  • Step 701 Device A sends an initialization request to device B.
  • device B receives the initialization request sent by device A.
  • device A in the shutdown state can send an initialization request to device B, thereby starting the process of establishing a connection with device B. It can be understood that after device A sends an initialization request to device B, device A can enter the initialization state from the closed state.
  • the initialization request may be carried through a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame may be used to indicate that the heterogeneous network data frame sent this time carries an initialization request.
  • the SN field in the heterogeneous network data frame can be used to indicate the sequence number of the heterogeneous network data frame sent this time.
  • the sequence number of the heterogeneous network data frame carrying the initialization request can be x1, and x1 can be 32 Bits of binary digits.
  • Step 702 Device B sends a synchronization request to device A.
  • device A receives the synchronization request sent by device B.
  • device B in the listening state can listen. When device B hears device A sending an initialization request, device B can send a synchronization request to device A. It can be understood that after device B sends a synchronization request to device A, device B can enter the synchronization state from the listening state.
  • the synchronization request can also be carried through a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame can be used to indicate that the heterogeneous network data frame sent this time carries a synchronization request.
  • the sequence number of the heterogeneous network data frame carrying the synchronization request may be x2, and x2 may be a 32-bit binary number.
  • Step 703 Device A sends confirmation information to device B.
  • device B receives the confirmation information sent by device A.
  • device A in the initialization state can send confirmation information to device B. It can be understood that after device A sends a confirmation message to device B, device A can enter the connection state from the initialization state. That is to say, device A and device B successfully establish a connection.
  • the acknowledgment information may also be carried by a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame may be used to indicate that the heterogeneous network data frame sent this time carries acknowledgment information.
  • the value of the SN field in the heterogeneous network data frame carrying the synchronization request is the same as the value of the SN field in the heterogeneous network data frame carrying the confirmation information. That is, the sequence number of the heterogeneous network data frame carrying the synchronization request is the same as the sequence number of the heterogeneous network data frame carrying the confirmation information.
  • the congestion control algorithm can also be negotiated, so that the congestion control algorithm can be dynamically negotiated based on the links between different devices, so that different applications can Scenarios use different congestion control algorithms to avoid throughput reduction caused by applying the same congestion control algorithm to different application scenarios.
  • the communication method of device A as a server device and device B as a client device can refer to the communication method of device A as a client device and device B as a server, which will not be described again here.
  • connection establishment process between two devices is exemplified above through FIG. 7
  • data transmission process between two devices is exemplified through FIG. 8 .
  • step 703 the following steps are specifically included:
  • Step 801 Device A obtains the payload.
  • the above-mentioned payload may be business data
  • the business data may be data generated by the application layer.
  • Step 802 Device A encapsulates the payload and obtains a heterogeneous network data frame.
  • the specific method of encapsulating the payload may refer to the frame format shown in Figure 4a, which will not be described again here.
  • the current data transmission mode usually adopts the byte stream (stream) mode.
  • the sending device sends data in the form of a data stream, and accordingly, the receiving device receives data in the form of a data stream. Therefore, the receiving device cannot distinguish the pause point of the current service.
  • the receiving device needs to query the pause point of the service, it needs to query the entire service, thereby reducing the efficiency of the service.
  • the M field in the heterogeneous network data frame can be used to indicate whether there are other heterogeneous network data frames following the current heterogeneous network data frame.
  • the M field can indicate the pause point of the service, so that the sending device can divide the service into segments, so that the receiving device can understand the segments of the service and improve service identification and reception efficiency.
  • the M field in the heterogeneous network data frame sent earlier can be set to 1 to indicate that there are still more heterogeneous network data frames later.
  • Heterogeneous network data frame, and the M field in the last heterogeneous network data frame can be set to 0 to indicate that there is no subsequent heterogeneous network data frame, so that The purpose of dividing business paragraphs.
  • the M field in the heterogeneous network data frame sent earlier can also be set to 0 to indicate that there will be heterogeneous network data frames later, and the last heterogeneous network data frame
  • the M field in the frame is set to 1, which is used to indicate that there is no heterogeneous network data frame later, so that the purpose of dividing service segments can be achieved.
  • This application does not specifically limit the setting method of the M field.
  • Step 803 Device A sends a heterogeneous network data frame to device B.
  • device B receives the heterogeneous network data frame sent by device A.
  • the device A may send the heterogeneous network data frame to device B.
  • the T field in the heterogeneous network data frame can be used to indicate that the heterogeneous network data frame sent this time carries a payload.
  • the SN field in the heterogeneous network data frame can be used to indicate the sequence number of the heterogeneous network data frame sent this time.
  • the sequence number of the heterogeneous network data frame carrying the payload can be y1, and y1 can be 32 Bits of binary digits.
  • device B when device A sends a heterogeneous network data frame to device B, device B can also send a heterogeneous network data frame to device A. Correspondingly, device A receives the heterogeneous network data frame sent by device B.
  • the specific implementation method of device B sending heterogeneous network data frames can be referred to the above-mentioned specific implementation method of device A sending heterogeneous network data frames, which will not be described again here.
  • Step 804 Device B sends confirmation information to device A.
  • device A receives the confirmation information sent by device B.
  • device B can send confirmation information to device A.
  • the confirmation information is an acknowledgment of the received heterogeneous network data frame.
  • device B in order to reduce network congestion, can feed back confirmation information at one time to multiple heterogeneous network data frames sent by device A. That is to say, after receiving any heterogeneous network data frame sent by device A, device B generates confirmation information, but does not send the confirmation information.
  • the preset amount of confirmation information is accumulated, the above preset amount of confirmation information can be fed back to device A at one time, thereby reducing the number of times of sending confirmation information and reducing network congestion.
  • the preset number of values may be 16 or other values, which are not specifically limited in this embodiment of the present application.
  • Step 805 Device B decapsulates the received heterogeneous network data frame to obtain the payload.
  • the decapsulation process refers to removing the frame header of the heterogeneous network data frame, so as to obtain the payload.
  • the device B After device B obtains the payload, it can send the payload to the application layer, so that the service interaction between device B and device A can be completed.
  • Step 1001 Device A sends an end request to device B.
  • device B receives the end request sent by the device.
  • device A in the connected state may send an end request to device B to initiate a connection disconnection process. It can be understood that after device A sends an end request to device B, device A can enter the end waiting state from the connection state.
  • the end request may also be carried by a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame may be used to indicate that the heterogeneous network data frame sent this time carries an end request.
  • the SN field in the heterogeneous network data frame can be used to indicate the sequence number of the heterogeneous network data frame sent this time.
  • the sequence number of the heterogeneous network data frame carrying the end request can be z1, and z1 can be 32. Bits of binary digits.
  • Step 1002 Device B sends an end confirmation to device A.
  • device A receives the end confirmation sent by device B.
  • device B After device B receives the end request sent by device A, if device B allows the end of this communication task, that is, allows the disconnection, it can send an end confirmation to device A to confirm this disconnection with device A. Open connection. If device B is not allowed to end this communication task, that is, it is not allowed to disconnect, it does not need to send an end confirmation to device A. It can be understood that after device B sends a completion confirmation to device A, device B can enter the shutdown waiting state from the connected state.
  • the end confirmation can also be carried by a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame can be used to indicate that the heterogeneous network data frame sent this time carries the end confirmation.
  • the SN field in heterogeneous network data frames can be used to Indicates the sequence number of the heterogeneous network data frame sent this time.
  • the sequence number of the heterogeneous network data frame carrying the end confirmation may be z2, and z2 may be a 32-bit binary number.
  • Step 1003 Device A sends confirmation information to device B.
  • device B receives the confirmation information sent by device A.
  • device A after receiving the end confirmation sent by device B, device A can send confirmation information to device B.
  • the confirmation information is used to confirm the end confirmation sent by device B, so that the connection between device A and device B can be disconnected. Connection. It can be understood that after device A sends a confirmation message to device B, device A can enter the shutdown state from the end of waiting state.
  • the acknowledgment information may also be carried by a heterogeneous network data frame.
  • the T field in the heterogeneous network data frame may be used to indicate that the heterogeneous network data frame sent this time carries acknowledgment information.
  • the sequence number carried by the heterogeneous network data frame carrying the confirmation information is consistent with the sequence number carried by the heterogeneous network data frame carrying the end confirmation.
  • device B after receiving the confirmation information sent by device A, device B disconnects the connection between device B and device A. After device B receives the confirmation message sent by device A, device B can enter the shutdown state from the shutdown waiting state.
  • connection disconnection can be executed after the connection is established or the connection disconnection can be executed after the data transmission is completed. Yes, the embodiments of this application do not specifically limit this.
  • device B may also actively initiate connection disconnection. For example, device B sends an end request to device A.
  • device A or device B in the connected state detects a connection timeout, it can also enter the closed state from the connected state, so that the connection can be disconnected.
  • device A or device B can detect whether the connection has timed out by detecting heartbeat messages. For example, if no heartbeat message is detected within the preset time period, it can be considered that the connection has timed out, and the connection can be disconnected. .
  • FIG 11 is a schematic structural diagram of an embodiment of the sending device of the present application.
  • the above-mentioned sending device 1100 may include: an acquisition module 1110, a packaging module 1120 and a sending module 1130; wherein,
  • Obtain module 1110 used to obtain the payload of the application layer
  • the encapsulation module 1120 is used to encapsulate the payload of the application layer to obtain a heterogeneous network data frame; wherein the heterogeneous network data frame does not include a network layer protocol frame header, and the frame header length of the heterogeneous network data frame is smaller than the transport layer protocol Frame header length;
  • the sending module 1130 is used to send the heterogeneous network data frame to the receiving device in the heterogeneous network.
  • the frame header of the heterogeneous network data frame includes a window length indication
  • the window length indication is used to indicate the receiving window length
  • the length of the window length indication is 8 bits.
  • the first bit of the window length indication is used to indicate whether there is a window amplification factor, and the last 7 bits of the window length indication are used to indicate the base length of the receiving window.
  • the first bit of the window length indication indicates the existence of a window magnification
  • the receiving window length is determined by the basic length of the receiving window and the window magnification, where the window magnification is obtained through negotiation between the sending device and the receiving device.
  • the frame header of the heterogeneous network data frame includes at least one of the following:
  • the merge indication is used to indicate whether the current heterogeneous network data frame is merged with the subsequent heterogeneous network data frame.
  • the length of the merge indication is 1 bit;
  • the flow label is used to indicate the address of the receiving device.
  • the length of the flow label is 16 bits;
  • the transmission index indication is used to indicate the number of transmissions or retransmissions of heterogeneous network data frames.
  • the length of the transmission index indication is 2 bits.
  • the above sending module 1130 is specifically used to
  • connection request is carried through a heterogeneous network data frame, and the connection request is used to request to establish a connection with the receiving device;
  • the above-mentioned sending device 1100 also includes:
  • the negotiation module is used to negotiate the congestion control algorithm with the receiving device during the process of establishing a connection with the receiving device.
  • the above negotiation module is also used to negotiate
  • session negotiation is performed with the sending device, where the session negotiation parameters are carried by the extension header of the heterogeneous network data frame.
  • the heterogeneous network consists of one or more of wireless fidelity Wi-Fi, Bluetooth, low-power Bluetooth, and Ethernet.
  • the above-mentioned sending device 1100 also includes:
  • the receiving module is used to receive confirmation information sent by the receiving device, and the confirmation information is used to confirm one or more heterogeneous network data frames sent by the sending device.
  • the sending device 1100 provided by the embodiment shown in Figure 11 can be used to execute the technical solutions of the method embodiments shown in Figures 1 to 10 of this application. For its implementation principles and technical effects, please refer to the relevant descriptions in the method embodiments.
  • FIG 12 is a schematic structural diagram of an embodiment of the receiving device of the present application.
  • the receiving device 1200 may include: a receiving module 1210, a decapsulating module 1220 and a sending module 1230; wherein,
  • the receiving module 1210 is used to receive heterogeneous network data frames in heterogeneous networks; wherein the heterogeneous network data frames do not include network layer protocol frame headers, and the length of the frame headers of the heterogeneous network data frames is smaller than the length of the transport layer protocol frame headers;
  • Decapsulation module 1220 is used to decapsulate heterogeneous network data frames to obtain payloads
  • the sending module 1230 is used to send the payload to the application layer of the receiving device.
  • the above sending module 1230 is also used to
  • the confirmation information is used to confirm one or more heterogeneous network data frames sent by the sending device.
  • connection request sent by the sending device, establish a connection with the sending device based on the connection request, and the connection request is carried by the heterogeneous network data frame;
  • the end request is carried through a heterogeneous network data frame.
  • the end request is used to initiate a disconnection from the sending device.
  • the above receiving device 1200 also includes:
  • the negotiation module is used to negotiate the congestion control algorithm with the sending device during the process of establishing a connection with the sending device.
  • the above negotiation module is also used to negotiate
  • session negotiation is performed with the sending device, in which session negotiation parameters are carried by the extension header of the heterogeneous network data frame.
  • the heterogeneous network consists of one or more of wireless fidelity Wi-Fi, Bluetooth, low-power Bluetooth, and Ethernet.
  • the receiving device 1200 provided by the embodiment shown in Figure 12 can be used to execute the technical solutions of the method embodiments shown in Figures 1 to 10 of this application. For its implementation principles and technical effects, further reference can be made to the relevant descriptions in the method embodiments.
  • the above division of the various modules of the sending device shown in Figure 11 and the receiving device shown in Figure 12 is only a division of logical functions. In actual implementation, it can be fully or partially integrated into a physical entity, or it can be physically implemented. separate. And these modules can all be implemented in the form of software calling through processing elements; they can also all be implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware.
  • the detection module can be a separate processing element, or can be integrated into a chip of the electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together or implemented independently. During the implementation process, each step of the above method or each of the above modules can be completed by instructions in the form of hardware integrated logic circuits or software in the processor element.
  • the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (hereinafter referred to as: ASIC), or one or more microprocessors (Digital Signal Processor; hereinafter referred to as: DSP), or one or more Field Programmable Gate Arrays (hereinafter referred to as: FPGA), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Arrays
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (hereinafter referred to as: SOC).
  • SOC system-on-a-chip
  • the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also Including GPU, embedded neural network processor (Neural-network Process Units; hereinafter referred to as: NPU) and image signal processor (Image Signal Processing; hereinafter referred to as: ISP).
  • the processor may also include necessary hardware accelerators or logic processing Hardware circuits, such as ASIC, or one or more integrated circuits used to control the execution of the program of the technical solution of this application, etc.
  • the processor may have functionality to operate one or more software programs, which may be stored in a storage medium.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program. When it is run on a computer, it causes the computer to execute the steps provided by the embodiments shown in FIGS. 1 to 10 of the present application. method.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product includes a computer program that, when run on a computer, causes the computer to execute the method provided by the embodiments shown in FIGS. 1 to 10 of the present application.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • And/or describes the relationship between associated objects, indicating that there can be three relationships. For example, A and/or B can represent the existence of A alone, the existence of A and B at the same time, or the existence of B alone. Where A and B can be singular or plural.
  • the character “/” generally indicates that the related objects are in an “or” relationship.
  • At least one of the following" and similar expressions refers to any combination of these items, including any combination of single or plural items.
  • At least one of a, b and c can mean: a, b, c, a and b, a and c, b and c or a and b and c, where a, b, c can be single, also Can be multiple.
  • any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), magnetic disks or optical disks, etc.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disks or optical disks etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请提供一种通信方法、设备及存储介质,涉及通信领域,该方法包括:获取应用层的有效载荷;对应用层的有效载荷进行封装,得到异构网络数据帧;其中,异构网络数据帧不包括网络层协议帧头,异构网络数据帧的帧头长度小于传输层协议帧头长度;在异构网络中将异构网络数据帧发送给接收设备。本申请提供的方法,有助于提高通信的效率。

Description

通信方法、设备及存储介质
本申请要求于2022年08月04日提交中国专利局、申请号为202210932395.3、申请名称为“通信方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,尤其涉及一种通信方法、设备及存储介质。
背景技术
传输控制协议(transmission control protocol,TCP)是为互联网设计的可靠传输协议,其充分考虑了带宽的利用率。
然而在部分应用场景,例如各厂商研发的生态应用场景中,TCP作为传输协议满足不了通信的需求,已经不再适用。主要原因有以下几点:1、TCP的拥塞控制是静态的,不同链路的拥塞控制策略是相同的,而各厂商研发的生态应用场景可能需要灵活的拥塞控制策略。2、TCP与网络协议(internet protocol,IP)深度绑定,协议开销较大,而各厂商研发的生态应用场景可能需要数据传输效率较高的协议,也就是还说,协议开销要较小。3、TCP逻辑复杂,可移植性差,无法做到轻量级,而各厂商研发的生态应用场景需要的是轻量级、可移植性高的协议,由此便于各厂商进行部署,以满足低时延、高带宽的网络需求。
发明内容
本申请提供了一种通信方法、设备及存储介质,有助于提高通信的效率,提高用户的体验。
第一方面提供了一种通信方法,应用于发送设备,包括:
获取应用层的有效载荷;
对应用层的有效载荷进行封装,得到异构网络数据帧;其中,异构网络数据帧不包括网络层协议帧头,异构网络数据帧的帧头长度小于传输层协议帧头长度;
在异构网络中将异构网络数据帧发送给接收设备。
通过设计异构网络数据帧的帧格式,使得异构网络数据帧的帧头不包括网络层协议帧头,且异构网络数据帧的帧头的长度小于传统的传输层的帧头,由此可以节省头开销,从而可以提高数据传输的效率。
其中一种可能的实现方式中,异构网络数据帧的帧头包括窗口长度指示,窗口长度指示用于指示接收窗口长度,窗口长度指示的长度为8比特。
通过8比特的窗口长度指示指示接收窗口长度,可以减小接收窗口长度的头开销,从而可以提高数据传输效率。
其中一种可能的实现方式中,窗口长度指示的首个比特用于指示是否存在窗口放大倍率,窗口长度指示的后7个比特用于指示接收窗口基础长度。
通过窗口长度指示的首个比特用于指示是否存在窗口放大倍率,可以通过窗口放大倍率与窗口基础长度配合实现窗口的粗调和细调,由此可以满足不同场景下的窗口调整需求,从而可以提高传输效率。
其中一种可能的实现方式中,若窗口长度指示的首个比特指示存在窗口放大倍率,接收窗口长度由接收窗口基础长度与窗口放大倍率确定,其中,窗口放大倍率由发送设备与接收设备协商获得。
通过1个字节就可以表征长度65535以内的任意窗口大小,由此可以减小用于表征窗口大小 的开销。
其中一种可能的实现方式中,异构网络数据帧的帧头包括以下至少一个:
合并指示,合并指示用于指示当前的异构网络数据帧是否与后续的异构网络数据帧合并,合并指示的长度为1比特;
流标签,流标签用于指示所述接收设备的地址,流标签的长度为16比特;
传输索引指示,传输索引指示用于指示异构网络数据帧的传输或重传次数,传输索引指示的长度为2比特。
通过1比特的合并指示可以用于对业务的段落进行划分,使得接收设备了解业务的段落,由此可以提高接收设备对业务的查询效率。
通过16比特的流标签替代传统的开销较大TCP/IP的五元组,由此可以节省头开销。
通过2比特的传输索引指示替代传统的32比特的时间戳,可以较大的节省头开销。
其中一种可能的实现方式中,所述方法还包括:
向接收设备发送连接请求,其中,连接请求通过异构网络数据帧承载,连接请求用于请求与接收设备建立连接;和/或
向接收设备发送结束请求,其中,结束请求通过异构网络数据帧承载,结束请求用于启动与接收设备断开连接。
通过异构网络数据帧携带连接请求,由此可以使得发送设备通过较小的头开销发起连接请求,从而可以提高通信效率。
通过异构网络数据帧携带结束请求,由此可以使得发送设备通过较小的头开销发起结束请求,从而可以提高通信效率。
其中一种可能的实现方式中,所述方法还包括:
与接收设备建立连接过程中,与接收设备协商拥塞控制算法。
通过在连接建立的过程中,与接收设备动态的协商拥塞控制算法,可以提高拥塞控制的灵活性,从而可以使得带宽利用率更高,传输时延更低,进而可以提高业务的处理效率。
其中一种可能的实现方式中,所述方法还包括:
与接收设备建立连接过程中,与接收设备进行会话协商,其中,会话协商的参数由异构网络数据帧的扩展头携带。
通过在建立过程中与接收设备协商参数,使得在与接收设备的数据传输过程中无需在帧头中携带相应的参数,由此可以节省头开销,从而可以进一步提高数据传输效率。
其中一种可能的实现方式中,异构网络由无线保真Wi-Fi、蓝牙、低功耗蓝牙及以太网中的一种或多种组成。
通过对异构网络的多样化,可以扩大异构网络数据帧的应用场景,使得异构网络数据帧有较大的兼容性。
其中一种可能的实现方式中,所述在异构网络中将异构网络数据帧发送给接收设备之后,所述方法还包括:
接收接收设备发送的确认信息,确认信息用于对发送设备发送的一个或多个异构网络数据帧进行确认。
通过一个确认信息对多个异构网络数据帧进行确认,由此可以避免发送多个确认信息对多个异构网络数据帧进行确认,从而可以提高通信效率,进而可以提高数据传输效率。
第二方面还提供了一种通信方法,应用于接收设备,包括:
在异构网络中接收异构网络数据帧;其中,异构网络数据帧不包括网络层协议帧头,所述异构网络数据帧的帧头长度小于传输层协议帧头长度;
对异构网络数据帧进行解封装,得到有效载荷;
将有效载荷发送给接收设备的应用层。
通过设计异构网络数据帧的帧格式,使得异构网络数据帧的帧头不包括网络层协议帧头,且异构网络数据帧的帧头的长度小于传统的传输层的帧头,由此可以节省头开销,从而可以提高数据传输的效率。
其中一种可能的实现方式中,所述在异构网络中接收异构网络数据帧之后,所述方法还包括:
向发送设备发送确认信息,确认信息用于对发送设备发送的一个或多个异构网络数据帧进行确认。
通过向发送设备发送用于确认多个异构网络数据帧的确认信息,可以避免多次对多个异构网络数据进行确认,由此可以避免多次发送确认信息导致的网络拥塞,从而可以提高带宽利用率。
其中一种可能的实现方式中,所述在异构网络中接收异构网络数据帧之前,所述方法还包括:
接收发送设备发送的连接请求,基于连接请求与发送设备建立连接,连接请求由异构网络数据帧承载;和/或
向发送设备发送结束请求,结束请求通过异构网络数据帧承载,结束请求用于启动与发送设备断开连接。
通过异构网络数据帧携带连接请求,由此可以使得接收设备通过较小的头开销发起连接请求,从而可以提高通信效率。
通过异构网络数据帧携带结束请求,由此可以使得接收设备通过较小的头开销发起结束请求,从而可以提高通信效率。
其中一种可能的实现方式中,所述方法还包括:
在与发送设备建立连接过程中,与发送设备协商拥塞控制算法。
通过在连接建立的过程中,与发送设备动态的协商拥塞控制算法,可以提高拥塞控制的灵活性,从而可以使得带宽利用率更高,传输时延更低,进而可以提高业务的处理效率。
其中一种可能的实现方式中,所述方法还包括:
与发送设备建立连接过程中,与发送设备进行会话协商,其中,会话协商的参数由异构网络数据帧的扩展头携带。
通过在建立过程中与发送设备协商参数,使得在与发送设备的数据传输过程中无需在帧头中携带相应的参数,由此可以节省头开销,从而可以进一步提高数据传输效率。
其中一种可能的实现方式中,异构网络由无线保真Wi-Fi、蓝牙、低功耗蓝牙及以太网中的一种或多种组成。
通过对异构网络的多样化,可以扩大异构网络数据帧的应用场景,使得异构网络数据帧有较大的兼容性。
第三方面提供了一种发送设备,该发送设备包括执行第一方面或者第一方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第四方面还提供了一种接收设备,该接收设备包括执行第二方面或者第二方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第五方面还提供了一种发送设备,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,使得所述发送设备实现如第一方面所述的通信方法。
第六方面还提供了一种接收设备,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,使得所述接收设备实现如第二方面所述的通信方法。
第七方面还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得所述计算机实现如第一方面或第二方面所述的通信方法。
第八方面提供一种计算机程序,当上述计算机程序在发送设备的处理器上运行时,使得所述发送设备执行如第一方面所述的通信方法,或当上述计算机程序在接收设备的处理器上运行时,使得所述接收设备执行第二方面所述的通信方法。
在一种可能的设计中,第八方面中的程序可以全部或者部分存储在与处理器封装在一起的存储介质上,也可以部分或者全部存储在不与处理器封装在一起的存储器上。
第九方面提供一种通信系统,包括如第五方面所述的发送设备及如第六方面所述的接收设备。
附图说明
图1为本申请实施例提供的应用场景架构图;
图2为本申请实施例提供的设备的结构示意图;
图3为本申请实施例提供的协议栈架构图;
图4a为本申请实施例提供的异构网络数据帧的示意图;
图4b为本申请实施例提供的通用扩展头的示意图;
图4c为本申请实施例提供的携带Flow Label参数的扩展头的示意图;
图4d为本申请实施例提供的携带MSS参数的扩展头的示意图;
图4e为本申请实施例提供的携带Scaling Factor参数的扩展头的示意图;
图4f为本申请实施例提供的携带Service ID参数的扩展头的示意图;
图4g为本申请实施例提供的携带SN参数的扩展头的示意图;
图5为本申请实施例提供的L2帧格式示意图;
图6为本申请实施例提供的状态机变化示意图;
图7为本申请提供的通信方法一个实施例的流程示意图;
图8为本申请提供的通信方法另一个实施例的流程示意图;
图9为本申请实施例提供的数据块传输模式示意图;
图10为本申请提供的通信方法再一个实施例的流程示意图;
图11为本申请提供的发送设备一个实施例的结构示意图;
图12为本申请提供的接收设备一个实施例的结构示意图。
具体实施方式
本申请实施例中,除非另有说明,字符“/”表示前后关联对象是一种或的关系。例如,A/B可以表示A或B。“和/或”描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
需要指出的是,本申请实施例中涉及的“第一”、“第二”等词汇,仅用于区分描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量,也不能理解为指示或暗示顺序。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。此外,“以下至少一项(个)”或者其类似表达,是指的这些项中的任意组合,可以包括单项(个)或复数项(个)的任意组合。例如,A、B或C中的至少一项(个),可以表示:A,B,C,A和B,A和C,B和C,或A、B和C。其中,A、B、C中的每个本身可以是元素,也可以是包含一个或多个元素的集合。
本申请实施例中,“示例的”、“在一些实施例中”、“在另一实施例中”等用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。
本申请实施例中的“的(of)”、“相应的(corresponding,relevant)”和“对应的(corresponding)”有时可以混用,应当指出的是,在不强调其区别时,所要表达的含义是一致的。本申请实施例中,通信、传输有时可以混用,应当指出的是,在不强调其区别时,其所表达的含义是一致的。例如,传输可以包括发送和/或接收,可以为名词,也可以是动词。
本申请实施例中涉及的等于可以与大于连用,适用于大于时所采用的技术方案,也可以与小于连用,适用于小于时所采用的技术方案。需要说明的是,当等于与大于连用时,不能与小于连用;当等于与小于连用时,不与大于连用。
TCP是为互联网设计的可靠传输协议,其充分考虑了带宽的利用率。
然而在部分应用场景,例如各厂商研发的生态应用场景中,TCP作为传输协议满足不了通信的需求,已经不再适用。
本申请实施例提出了一种通信方法,应用于设备,以提高通信的效率,满足布网需求。
现结合图1-图10对本申请实施例提供的通信方法进行说明。
图1为本申请实施例提供的应用场景架构图。如图1所示,上述应用场景包括多个设备,例如,设备A、设备B、设备C、设备D等。其中,多个设备之间可以组成异构网络,该异构网络指的是传输媒介多样化的网络。示例性的,上述传输媒介包括但不限于无线保真(wireless fidelity,Wi-Fi)、蓝牙(bluetooth,BT)、低功耗蓝牙(bluetooth low energy,BLE)、以太网(ethernet,ETH)。
可以理解的是,上述应用场景仅示例性的示出了4个设备,但并不构成对本申请实施例的限定,在一些实施例中,还可以包括多于4个或少于4个设备的应用场景。
设备可以是固定终端,例如,笔记本电脑、台式机电脑、智能家居设备等。设备也可以是移动终端,例如,手机、平板等。移动终端也可以称为用户设备(User Equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。移动终端可以是WLAN中的站点(STAION,ST),可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、车联网终端、电脑、膝上型计算机、手持式通信设备、手持式计算设备、卫星无线设备、无线调制解调器卡、电视机顶盒(set top box,STB)、用户驻地设备(customer premise equipment,CPE)和/或用于在无线系统上进行通信的其它设备以及下一代通信系统,例如,5G网络中的移动终端或者未来演进的公共陆地移动网络(Public Land Mobile Network,PLMN)网络中的移动终端等。该移动终端还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。
图2示例性的示出了设备100的结构示意图。
设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对设备100的具体限定。在本申请另一些实施例中,设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter- integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对设备100的结构限定。在本申请另一些实施例中,设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160 耦合,使得设备100可以通过无线通信技术与网络以及其他设备通信。
设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。
设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。设备100可以支持一种或多种视频编解码器。这样,设备100可以播放或录制多种编码格式的视频。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行设备100的各种功能应用以及数据处理。
设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口170D用于连接有线耳机。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。
陀螺仪传感器180B可以用于确定设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定设备100围绕三个轴(即,x,y和z轴)的角速度。
气压传感器180C用于测量气压。在一些实施例中,设备100通过气压传感器180C测得的气 压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。
加速度传感器180E可检测设备100在各个方向上(一般为三轴)加速度的大小。
距离传感器180F,用于测量距离。设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。
环境光传感器180L用于感知环境光亮度。
指纹传感器180H用于采集指纹。设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。
骨传导传感器180M可以获取振动信号。按键190包括开机键,音量键等。马达191可以产生振动提示。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。
图3为本申请实施例提供的设备的协议栈架构示意图。参考图3,该协议栈架构包括应用层、异构网络传输层、物理层。其中,应用层用于生成或接收业务数据,该业务数据也可以认为是有效载荷。可以理解的是,对于发送设备来说,作为发送设备的设备生成业务数据;对于接收设备来说,作为接收设备的设备接收业务数据。异构网络传输层用于对业务数据进行封装,得到异构网络数据帧,或用于对异构网络数据帧进行解封装,得到业务数据。以异构网络传输层为华为的软总线结构通信(softbus fabric communication,SFC)层为例,异构网络数据帧可以是SFC帧。可以理解的是,上述SFC仅为示例性说明,并不构成对本申请实施例的限定,在具体应用中,上述异构网络传输层可以以任意的名字命名,仅需实现与异构网络传输层相同的功能即可。对于发送设备来说,作为发送设备的设备接收来自应用层的业务数据,并对应用层的业务数据进行封装,得到异构网络数据帧;对于接收设备来说,作为接收设备的设备接收来自物理层的异构网络数据帧,并对异构网络数据帧进行解封装,得到业务数据。此外,异构网络传输层中还可以包括拥塞控制算法,以实现拥塞控制。物理层用于发送异构网络数据帧给对端或接收来自对端的异构网络数据帧。可以理解的是,对于发送设备来说,作为发送设备的设备将异构网络数据帧发送给接收设备;对于接收设备来说,作为接收设备的设备接收来自发送设备的异构网络数据帧。
可见,在上述协议栈架构中,异构网络传输层替代了传统的传输层协议,例如:TCP层或用户数据包协议(User Datagram Protocol,UDP)层等。此外,本申请应用于同一个局域网内的通信,二层通信(例如,媒体接入控制层)就可以解决通信,无需三层(例如,IP层)参与,因此,可以省却IP层,由此可以省却IP的封装过程,节省了数据处理时延,从而可以有效减小时延,提高通信效率。此外,由于IP层不再参与数据的封装,由此可以大大减小头开销,从而可以进一步提高数据传输效率。且异构网络传输层与物理层是完全解耦的,也不存在与其他协议层(例如,IP层)的绑定,使得协议栈架构也变得轻量化,同时也提高了可移植性,满足布网的需求。
需要说明的是,本申请实施例通过构建异构网络传输层实现应用层有效载荷的封装,但并不构成对本申请实施例的限定。在一些实施例中,也可以不构建异构网络传输层,而是将异构网络传输层的功能移植到应用层,从而可以通过应用层实现将应用层有效载荷封装成异构网络数据帧。
接着,结合图4a对异构网络数据帧的帧结构进行示例性说明。参考图4a,上述异构网络数据帧包括V(Version)、P(Priority)、TI(Transmit Index)、M(Merge)、Window、O(Optional)、C(Crowding)、T(Type)、Length、Checksum、Flow Label、SN(Sequence Number)等字段。
其中,V字段用于表征异构网络数据帧的版本号,由此可以扩展协议,以便兼容新的异构网络数据帧和旧的异构网络数据帧,V字段的长度可以为2比特。示例性的,初始版本可以为0,版本扩展之后,版本可以升级为1。
P字段用于表征异构网络数据帧的优先级,P字段的长度为3比特,因此,最大可以包括8个优先级。
TI字段用于表征异构网络数据帧的传输索引。示例性的,首次发送异构网络数据帧时TI字段的值可以为0,重传上述异构网络数据帧时TI字段的值可以递增。TI字段的长度可以为2比特,因此,TI字段的值最大为3。可以理解的是,当对异构网络数据帧进行第一次至第三次重传时,也就是TI字段的数值从1递增至3的过程中,传输异构网络数据帧的所消耗的时间可以用于往返时延(round trip time,RTT)的计算。当TI字段的数值递增为3之后,若再次进行异构网络数据帧的重传,则TI字段的数值不变,传输异构网络数据帧的所消耗的时间不再用于往返时延(round trip time,RTT)的计算。可以理解的是,相对于TCP协议中的32比特的时间戳,2个比特的TI字段大大减小了头开销,从而可以提高数据传输效率。
M字段为合并指示,用于表征当前的异构网络数据帧是否与后面的异构网络数据帧进行合并。可以理解的是,TCP协议为流协议,采用的是字节流(stream)模式。在字节流模式中,发送设备以数据流的形式发送数据。在数据流中,每个数据通常具有相同的大小,接收设备会不间断的接收这些由多个数据组成的数据流。因此,接收设备无法区分数据流的停顿点,也就无法区分业务的段落。而通过本申请的M字段,可以采用数据块模式。该数据块模式可以将业务分成多个段落进行发送,每个段落可以包括多个数据。通过M字段指示该数据是否是该段落的最后一个数据,由此可以指示接收设备每个段落的结尾,从而可以让接收设备区分业务的段落。其中,M字段的长度可以为1比特。示例性的,若M字段的数值为1,则指示当前的异构网络数据帧与后续的异构网络数据帧合并,也就是说,该异构网络数据帧并非一个业务段落的最后一个数据;若M字段的数值为0,则指示当前的异构网络数据帧不与后续的异构网络数据帧合并,也就是说,该异构网络数据帧为一个业务段落的最后一个数据。或者,若M字段的数值为0,则指示当前的异构网络数据帧与后续的异构网络数据帧合并,也就是说,该异构网络数据帧并非一个业务段落的最后一个数据;若M字段的数值为1,则指示当前的异构网络数据帧不与后续的异构网络数据帧合并,也就是说,该异构网络数据帧为一个业务段落的最后一个数据。
Window字段用于表征接收窗口长度,该接收窗口长度可以通过异构网络数据帧的数量。Window字段的长度可以为8比特。其中,Window可以包括2种窗口模式,例如,第一模式及第二模式。第一模式可以为粗调模式,该粗调模式可以包含窗口放大倍率,该窗口放大倍率可以通过发送设备和接收设备协商获得。第二模式为细调模式,该细调模式不包含窗口放大倍率。Window字段的8比特中的首个比特可以用于指示上述两种模式。示例性的,Window字段的首个比特为0,则指示当前窗口模式为第一模式,Window字段的后7个比特可以指示基础窗口长度。接着,将基础窗口长度乘以窗口放大倍率即为接收窗口长度。Window字段的首个比特为1,则指示当前窗口模式为第二模式,Window字段的后7个比特可以指示接收窗口长度。或者,Window字段的首个比特为1,则指示当前窗口模式为第一模式;Window字段的首个比特为0,则指示当前窗口模式为第二模式。相对于TCP协议中通过字节指示接收窗口长度,本申请实施例通过1个字节(也就是8比特)指示接收窗口长度,可以大大减小头开销,从而可以提高数据传输效率。
O字段用于指示是否存在扩展头(Optional Header),其中,扩展头的数目可以是0-N个,N为正整数。每个扩展头的长度为32比特。O字段的长度可以为1比特,示例性的,若O字段的数值为1,则指示存在扩展头;若O字段的数值为0,则指示不存在扩展头。或者,若O字段的数值为0,则指示存在扩展头;若O字段的数值为1,则指示不存在扩展头。
现结合图4b-图4g对扩展头的格式进行示例性说明。
图4b为扩展头的通用格式,参考图4b,扩展头可以包括E、TP、LENGTH及value等字段。
其中,E字段用于表征扩展头是否结束,E字段的长度为1比特。示例性的,若E字段的值为1,则可以表示当前扩展头为最后一个扩展头;或者若E字段的值为0,则可以表示当前扩展头为最后一个扩展头。
TP字段用于表征扩展头中协商参数的类型。其中,协商参数可以包括但不限于:Flow Label、MSS、Scaling Factor、Service ID及SN等参数。TP字段的长度为7比特。
Flow Label用于指示分配的流标签,Flow Label的长度为2个字节。该流标签由服务端设备 决定,该流标签通过客户端设备或服务端设备中的扩展头进行协商,其中,若服务端设备携带0的流标签,则表示无可用流标签。
其中,协商流标签的方式可以是:
客户端设备发送初始化请求,该初始化请求可以通过异构网络数据帧携带,该初始化请求的头部的Flow Label字段可以为0。当服务端设备接收到该初始化请求后,可以向客户端设备发送同步请求,该同步请求可以通过异构网络数据帧携带,该同步请求中包括扩展头,该扩展头中可以携带Flow Label的建议值,该同步请求的头部的Flow Label字段可以为0。若客户端设备回复ACK信息,该ACK信息可以通过异构网络数据帧携带,该ACK信息中包括扩展头,该扩展头中携带确认值,该ACK信息中的头部的Flow Label字段可以为0,由此可以成功完成Flow Label的协商。若客户端设备回复NACK信息,该NACK信息可以通过异构网络数据帧携带,通过该NACK信息可以通知服务端设备扩展头中携带的Flow Label建议值有冲突,由此可以开始下一轮的Flow Label的协商,该NACK信息中的头部的Flow Label字段可以为0。当服务端设备接收到NACK信息后,可以重新向客户端设备发送同步请求,由此开始新一轮的Flow Label的协商。
MSS用于表征发送设备能接收的数据的大小,该MSS的长度为2个字节。其中,该MSS无需协商过程,双方都可通知对端自己建议的MSS值,当对端接收到该MSS值后,对端可以根据该建议的MSS值组装数据帧。示例性的,MSS的本地计算方法可以是:MSS=MTU-16。在一些可选的实施例中,如果扩展头中未携带该协商参数,则可以将MSS默认为1484字节,其中,1484可以由MTU-16获得。
Scaling Factor的值可以由客户端设备指定,当服务端设备接收到该Scaling Factor的值,并回复相同的回应值后,可以认为协商成功。
Service ID用于表征业务的识别号。该Service ID由客户端设备发起连接请求时携带,由此指明待连接的服务。当服务端设备接收到该Service ID后,若该Service ID存在,则可以进一步进行连接的协商,否则,可以发送重置(RST)信息。可以理解的是,在连接建立的过程中,双方都需携带该Service ID参数。
SN用于表征异构网络数据帧的序号。可以理解的是,双方可以自行选择一个初始值,在初始化握手的时候,发送给对端,若收到确认,则可以认为协商成功。
以协商参数为Flow Label为例进行说明。图4c为协商参数为Flow Label的扩展头格式,参考图4c,通过TP=Flow Label,用于指示本次扩展头携带的协商参数为Flow Label,通过LENGTH=2,用于指示,value字段的长度为2字节。
接着,以协商参数为MSS为例进行说明。图4d为协商参数为MSS的扩展头格式。
接着,以协商参数为Scaling Factor为例进行说明。图4e为协商参数为MSS的扩展头格式。
接着,以协商参数为Service ID为例进行说明。图4f为协商参数为MSS的扩展头格式。
接着,以协商参数为SN为例进行说明。图4g为协商参数为SN的扩展头格式。
LENGTH字段用于指示value字段的长度,单位为字节。LENGTH字段的长度为8比特。
Value字段用于表征协商参数的值。
可以理解的是,上述扩展头可以出现在连接建立和连接断开的过程中,在数据传输过程中,不会出现上述扩展头,由此可以减小异构网络数据帧的头部开销,从而可以提高数据传输效率。
C字段用于指示是否存在拥堵情况。C字段的长度可以为1比特。示例性的,若C字段的值为1,指示存在拥堵情况,若C字段的值为0,指示不存在拥堵情况。或者,若C字段的值为0,指示存在拥堵情况,若C字段的值为1,指示不存在拥堵情况。
T字段用于指示异构网络数据帧的类型。其中,类型可以包括但不限于初始化、应答、数据、结束等类型。T字段的长度可以为3比特。
Length字段用于指示异构网络数据帧中的有效载荷的长度。Length字段的长度可以为12比特。
Checksum字段用于对异构网络数据帧进行有效性校验。Checksum字段的长度可以为16比特。其中,Checksum的数值为全0时,可以认为不需要进行校验,可以理解的是,除上述Checksum之外,还可以通过循环冗余校验(Cyclic Redundancy Check,CRC)等方式进行有效性校验,本申 请实施例对此不作特殊限定。
Flow Label字段用于表征接收设备的地址。Flow Label字段的长度可以为16比特。由于TCP协议适用于互联网,其中涉及到IP路由的选择,TCP/IP通常通过五元组用于进行路由选择,五元组的头开销是较大的。而本申请实施例应用于局域网,解决的是局域网内的通信问题,不涉及外网,因此,不存在路由选择问题,通过上述Flow Label就可以实现上述TCP/IP中的五元组的功能,从而可以进一步减少头开销,提高数据传输效率。在一些可选的实施例中,异构网络数据帧也可以应用于广域网或互联网,此时,可以通过IP层等网络层承载上述异构网络数据帧,通过上述Flow Label字段和IP地址可以共同确定相应的地址。
SN字段用于指示异构网络数据帧的序号。SN字段的长度可以为32比特。
可以理解的是,现有技术中,传输层协议的帧头和网络层协议的帧头会占用报文较大的头开销。以传输层协议为TCP及网络层协议为IPv4为例,TCP帧头占用20字节,IPv4帧头占用20字节,也就是说,传输层协议的帧头和网络层协议的帧头总共占用40字节;以传输层协议为TCP及网络层协议为IPv6为例,TCP帧头占用20字节,IPv6帧头占用40字节,也就是说,传输层协议的帧头和网络层协议的帧头总共占用60字节,由此会大大降低数据的传输效率。而本申请实施例中,异构网络数据帧不包含网络层协议帧头,由此可以节省网络层协议的头开销。此外,异构网络数据帧的整个帧头的开销为12个字节(也就是96比特),远小于现有的传输层协议的头开销。相对于现有的传输层协议和网络层协议的头开销,极大的降低了头开销,示例性的,相对于TCP和IPv4的40字节的头开销,异构网络数据帧可以节省28字节的头开销;相对于TCP和IPv6的60字节的头开销,异构网络数据帧可以节省48字节的头开销,由此可以大大减小头开销,从而可以提高数据传输效率。
上述异构网络数据帧可以通过层2(L2)承载。以L2为MAC层为例,L2数据帧为MAC帧,图5为MAC帧的格式示意图。参考图5,MAC帧包括Preamble、SFD、DstMAC、SrcMAC、Type、SFC Frame及FCS等字段。
其中,Preamble字段为前同步码,用于使接收设备的适配器在接收MAC帧时能够迅速调整时钟频率,使它和发送设备的频率相同。该Preamble字段的长度可以为7个字节,1和0交替。
SFD字段用于表征MAC帧的起始符,该SFD字段的长度为1个字节,前6个比特1和0交替,最后两个比特连续的1用于告知接收设备适配器:“帧信息要来了,准备接收”。
DstMAC字段为目的地址,用于表征接收MAC帧的网络适配器的MAC地址或物理地址,该DstMAC的长度为6个字节。可以理解的是,当接收设备接收到一个MAC帧时,首先会检查该MAC帧的目的地址是否与当前适配器的物理地址相同,如果相同,则会进一步处理;如果不同,则字节丢弃该MAC帧。
SrcMAC字段为源地址,用于表征发送MAC帧的网络适配器的MAC地址或物理地址,该SrcMAC的长度为6个字节。
Type字段用于指示层2数据帧中携带的高层数据的类型,由于上层协议众多,通过该Type字段,可以用于指示数据交付给哪个高层协议处理。Type字段的长度为2字节,示例性的,若Type字段的数值为0xABAB,则可以指示层2数据帧中携带的高层数据为异构网络数据帧,若Type字段的数值为0x0800,则可以指示层2数据帧中携带的高层数据为IP帧。可以理解的是,上述0xABAB和0x0800仅为示例性说明,并不构成对本申请实施例的限定,在一些实施例中,还可以通过其他数值指示异构网络数据帧和IP帧。
SFC Frame字段用于表征异构网络数据帧,其中,异构网络数据帧的帧格式具体可以参考图4所示实施例的相关描述,在此不再赘述。可以理解的是,SFC Frame字段的长度最小可以为46字节,最大可以为1500字节,也可以称之为最大传输单元。当不足46字节时,可以填充至46字节。
FCS字段为帧检测序列,用于检测该MAC帧是否出现差错。该FCS字段的长度为4个字节。可以理解的是,发送设备计算MAC帧的循环冗余校验码(Cyclic Redundancy Check,CRC),并写入FCS字段。接收设备重新计算CRC,与FCS字段的CRC值进行比较;若两者不相同,则表示传输过程中发生了数据丢失或改变,此时,需要重新传输该MAC帧。
可以理解的是,上述异构网络数据帧可以通过其他层,例如层3或层4进行承载,本申请实施例对此不作特殊限定。
接着,结合图6对设备的状态转换进行示例性说明。参考图6,设备的状态可以包括关闭态,初始化态,监听态,同步态,连接态,结束等待态,关闭等待态。可以理解的是,关闭态可以为客户端设备和服务端设备的初始状态。其中,主动请求建立连接的可以是客户端设备,被动响应的可以是服务端设备。客户端设备和服务端设备可以是发送设备或接收设备,当客户端设备作为发送设备时,服务端设备为接收设备;或者,当客户端设备作为接收设备时,服务端设备为发送设备。
其中,客户端设备创建Socket后,可以调用connect接口,并可以在处于关闭态时向服务端设备发送初始化请求,由此可以由关闭态进入初始化态。服务端设备创建Socket后,由于要监听初始化请求,因此,可以调用listen接口,由此可以由关闭态转换为监听态,并启动监听。
当服务端设备在监听态监听到初始化请求后,如果同意建立连接,则可以向客户端设备发送同步请求,由此可以由监听态进入同步态;如果不同意建立连接,则可以不回复任何信息。
当客户端设备在初始化态接收到同步请求后,如果同步请求中的参数没有问题,则可以向服务端设备发送确认信息(例如ACK),由此可以由初始化态进入连接态,表示与服务端设备的连接建立成功,从而可以与服务端设备进行数据交互;如果同步请求中的参数出现问题,则可以向服务端设备发送非确认信息(例如NACK),此时,状态无需切换,与服务端设备开始下一轮协商。
当服务端设备在同步态接收到确认信息后,可以由同步态进入连接态,表示与客户端设备的连接建立成功,从而可以与客户端设备进行数据交互;当服务端设备在同步态接收到非确认信息后,则可以向客户端设备重新发送同步请求,由此可以开始与客户端设备新一轮的协商,此时,服务端设备的状态不切换。
当客户端设备和/或服务端设备处于初始化态或同步态时,若没有收到对方的响应,客户端设备和/或服务端设备可以在预设时长后进入关闭态,此时,连接建立失败,并释放相应的资源。
可以理解的是,任何一方(包括客户端设备和服务端设备)都可以主动发起断开连接。其中,主动发起断开连接的方式可以是通过控制信息通知对端。
在一些可选的实施例中,任何一方也可以在心跳超时后,主动断开连接,此时,无需告知对端。
接着,下文以通过控制信息告知对端的方式对主动断开连接的方式进行示例性说明。
当客户端设备在连接态时可以主动发起断开连接,此时,客户端设备可以主动发送结束请求,用于请求断开连接。当客户端设备发送结束请求后,由此可以由连接态进入结束等待态。当服务端设备在连接态接收到结束请求后,可以向客户端设备发送结束确认,由此可以由连接态进入关闭等待态,表示该服务端设备已经准备好断开连接。当客户端设备在结束等待态接收到结束确认后,可以向服务端设备发送确认信息,由此可以由结束等待态进入关闭态,表示连接断开成功。当服务端设备在关闭等待态接收到确认信息后,可以由关闭等待态进入关闭态,表示连接断开成功。
或者,
当服务端设备在连接态时可以主动发起断开连接,此时,服务端设备可以主动发送结束请求,用于请求断开连接。当服务端设备发送结束请求后,由此可以由连接态进入结束等待态。当客户端设备在连接态接收到结束请求后,可以向服务端设备发送结束确认,由此可以由连接态进入关闭等待态,表示该客户端设备已经准备好断开连接。当服务端设备在结束等待态接收到结束确认后,可以向客户端设备发送确认信息,由此可以由结束等待态进入关闭态,表示连接断开成功。当客户端设备在关闭等待态接收到确认信息后,可以由关闭等待态进入关闭态,表示连接断开成功。
可以理解的是,当客户端设备和/或服务端设备处于结束等待态或关闭等待态时,若没有收到对方的响应,则可以在预设时长后切换至关闭态,此时,连接断开成功,并释放相应的资源。
图7为本申请提供的通信方法一个实施例的流程示意图,上述通信方法可以应用于任意两个设备之间(例如,设备A和设备B)。其中,设备A可以为客户端设备,设备B可以为服务端 设备;或设备A可以为服务端设备,设备B可以为客户端设备。下文以设备A为客户端设备,设备B为服务端设备为例进行示例性说明,具体包括以下步骤:
步骤701,设备A向设备B发送初始化请求。相应的,设备B接收设备A发送的初始化请求。
具体地,处于关闭态的设备A可以向设备B发送初始化请求,由此可以启动与设备B建立连接的过程。可以理解的是,设备A向设备B发送初始化请求后,设备A可以由关闭态进入初始化态。
其中,初始化请求可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是初始化请求。异构网络数据帧中的SN字段可以用于指示本次发送的异构网络数据帧的序列号,示例性的,携带初始化请求的异构网络数据帧序列号可以为x1,该x1可以是32比特的二进制数字。
步骤702,设备B向设备A发送同步请求。相应的,设备A接收设备B发送的同步请求。
具体地,处于监听态的设备B可以监听,当设备B监听到设备A发送初始化请求后,设备B可以向设备A发送同步请求。可以理解的是,设备B向设备A发送同步请求后,设备B可以由监听态进入同步态。
其中,同步请求也可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是同步请求。示例性的,携带同步请求的异构网络数据帧序列号可以为x2,该x2可以是32比特的二进制数字。
步骤703,设备A向设备B发送确认信息。相应的,设备B接收设备A发送的确认信息。
具体地,处于初始化态的设备A接收到设备B发送的同步请求后,可以向设备B发送确认信息。可以理解的是,设备A向设备B发送确认信息后,设备A可以由初始化态进入连接态,也就是说,设备A与设备B成功建立连接。
其中,确认信息也可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是确认信息。此外,为了让设备B识别该确认信息是对同步请求的确认,携带同步请求的异构网络数据帧中的SN字段的值与携带确认信息的异构网络数据帧中的SN的值相同,也就是携带同步请求的异构网络数据帧的序列号与携带确认信息的异构网络数据帧的序列号相同。
在一些可选的实施例中,在设备A与设备B建立连接的过程中,还可以协商拥塞控制算法,由此可以根据不同设备间的链路动态协商拥塞控制算法,从而可以使得不同的应用场景使用不同的拥塞控制算法,避免因相同的拥塞控制算法应用至不同的应用场景导致吞吐量降低。
可以理解的是,设备A作为服务端设备,设备B作为客户端设备的通信方式具体可以参考设备A作为客户端设备,设备B作为服务端的通信方式,在此不再赘述。
上文通过图7对两个设备之间的连接建立过程进行了示例性说明,接着,通过图8对两个设备之间的数据传输过程进行示例性说明。仍以如图7所示的设备A和设备B为例,当设备A与设备B成功建立连接之后,可以进行数据传输,上述步骤703之后,具体包括以下步骤:
步骤801,设备A获取有效载荷。
具体地,上述有效载荷可以是业务数据,该业务数据可以是应用层生成的数据。
步骤802,设备A将有效载荷进行封装,获得异构网络数据帧。
具体地,对有效载荷进行封装的具体方式可以参考图4a所示的帧格式,在此不再赘述。
可以理解的是,当前数据传输的模式通常采用字节流(stream)模式。在字节流模式中,发送设备以数据流的形式发送数据,相应的,接收设备以数据流的形式接收数据。因此,接收设备无法区分当前业务的停顿点,当接收设备需要对业务的停顿点进行查询时,需要对整个业务进行查询,由此降低了业务的效率。而本申请实施例中,由于异构网络数据帧中的M字段可以用于指示当前异构网络数据帧后面是否还有其他的异构网络数据帧。通过该M字段可以指示业务的停顿点,使得发送设备可以对业务进行段落的划分,从而可以使得接收设备了解业务的段落,提高业务的识别和接收效率。示例性的,如图9所示,在一个业务的段落中,包括多个异构网络数据帧,在先发送的异构网络数据帧中的M字段可以设为1,用于指示后面还有异构网络数据帧,而最后一个异构网络数据帧中的M字段可以设为0,用于指示后面没有异构网络数据帧,从而可以实现 划分业务段落的目的。可选地,在一个业务的段落中,也可以将在先发送的异构网络数据帧中的M字段设为0,用于指示后面还有异构网络数据帧,而最后一个异构网络数据帧中的M字段设为1,用于指示后面没有异构网络数据帧,从而可以实现划分业务段落的目的,本申请对M字段的设置方式不作特殊限定。
步骤803,设备A向设备B发送异构网络数据帧。相应的,设备B接收设备A发送的异构网络数据帧。
具体地,设备A获得异构网络数据帧之后,可以将异构网络数据帧发送给设备B。异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是有效载荷。异构网络数据帧中的SN字段可以用于指示本次发送的异构网络数据帧的序列号,示例性的,携带有效载荷的异构网络数据帧序列号可以为y1,该y1可以是32比特的二进制数字。
可以理解的是,设备A在向设备B发送异构网络数据帧时,设备B也可以向设备A发送异构网络数据帧,相应的,设备A接收设备B发送的异构网络数据帧。设备B发送异构网络数据帧的具体实现方式可以参考上述设备A发送异构网络数据帧的具体实现方式,在此不再赘述。
步骤804,设备B向设备A发送确认信息。相应的,设备A接收设备B发送的确认信息。
具体地,当设备B接收到设备A发送的任意一个异构网络数据帧后,可以向设备A发送确认信息,该确认信息为对接收到的异构网络数据帧的确认。为了让设备A识别该确认信息是对异构网络数据帧的确认,携带确认信息的异构网络数据帧中的SN字段的值与设备A发送的异构网络数据帧中的SN的值相同,示例性的,携带确认信息的异构网络数据帧中的SN=y1。
在一些可选的实施例中,为了减少网络的拥塞,设备B可以对设备A发送的多个异构网络数据帧一次性反馈确认信息。也就是说,设备B在接收到设备A发送的任意一个异构网络数据帧后,生成确认信息,但是不发送该确认信息。当累计满预设数量的确认信息后,可以将上述预设数量的确认信息一次性反馈给设备A,从而可以减少发送确认信息的次数,减少网络的拥塞。其中,预设数量的数值可以为16,也可以为其他数值,本申请实施例对此不作特殊限定。
步骤805,设备B对接收到的异构网络数据帧进行解封装,得到有效载荷。
具体地,当设备B接收到异构网络数据帧后,可以对异构网络数据帧进行解封装,由此可以获取异构网络数据帧中的有效载荷。其中,解封装的过程指的是将异构网络数据帧的帧头去除,从而可以获得有效载荷。当设备B获得有效载荷后,可以将该有效载荷发送给应用层,由此可以完成设备B与设备A之间的业务交互。
可以理解的是,设备A接收设备B发送的异构网络数据帧的过程具体可以参考上述设备B接收设备A发送的异构网络数据帧的过程,在此不再赘述。
上文通过图8和图9对两个设备之间的数据传输过程进行了示例性说明,接着,通过图10对两个设备之间的连接断开过程进行示例性说明。仍以如图7所示的设备A和设备B为例,具体包括以下步骤:
步骤1001,设备A向设备B发送结束请求。相应的,设备B接收设备发送的结束请求。
具体地,处于连接态的设备A可以向设备B发送结束请求,用于发起连接断开的流程。可以理解的是,当设备A向设备B发送结束请求后,设备A可以由连接态进入结束等待态。
其中,结束请求也可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是结束请求。异构网络数据帧中的SN字段可以用于指示本次发送的异构网络数据帧的序列号,示例性的,携带结束请求的异构网络数据帧序列号可以为z1,该z1可以是32比特的二进制数字。
步骤1002,设备B向设备A发送结束确认。相应的,设备A接收设备B发送的结束确认。
具体地,设备B接收到设备A发送的结束请求后,若设备B允许结束本次通信任务,也就是允许断开连接,则可以向设备A发送结束确认,用于向设备A确认本次断开连接。若设备B不允许结束本次通信任务,也就是不允许断开连接,则可以不向设备A发送结束确认。可以理解的是,当设备B向设备A发送结束确认后,设备B可以由连接态进入关闭等待态。
其中,结束确认也可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是结束确认。异构网络数据帧中的SN字段可以用于 指示本次发送的异构网络数据帧的序列号,示例性的,携带结束确认的异构网络数据帧序列号可以为z2,该z2可以是32比特的二进制数字。
步骤1003,设备A向设备B发送确认信息。相应的,设备B接收设备A发送的确认信息。
具体地,设备A接收到设备B发送的结束确认后,可以向设备B发送确信信息,该确认信息用于对设备B发送的结束确认进行确认,由此可以断开设备A与设备B之间的连接。可以理解的是,当设备A向设备B发送确认信息后,设备A可以由结束等待态进入关闭态。
其中,确认信息也可以通过异构网络数据帧承载,示例性的,异构网络数据帧中的T字段可以用于指示本次发送的异构网络数据帧携带的是确认信息。为了用于识别该确认信息是对结束确认的确认,携带该确认信息的异构网络数据帧承载的序列号与携带结束确认的异构网络数据帧承载的序列号一致。
相应的,设备B接收到设备A发送的确认信息后,断开设备B与设备A之间的连接。当设备B接收到设备A发送的确认信息后,设备B可以由关闭等待态进入关闭态。
可以理解的是,图10所示实施例可以在步骤703之后执行,也可以在步骤803之后执行,也就是说,可以在连接建立之后执行连接断开,也可以在数据传输完成之后执行连接断开,本申请实施例对此不作特殊限定。
需要说明的是,以上示例仅示例性的示出了设备A主动发起连接断开的过程,但并不构成对本申请实施例的限定,在一些实施例中,也可以由设备B主动发起连接断开的过程,例如,设备B向设备A发送结束请求。
在一些可选的实施例中,处于连接态的设备A或设备B若检测到连接超时,也可以由连接态进入关闭态,由此可以断开连接。在具体实现时,设备A或设备B可以通过检测心跳报文的方式检测连接是否超时,例如,若在预设时长内未检测到心跳报文,则可以认为连接超时,此时可以断开连接。
图11为本申请发送设备一个实施例的结构示意图,如图11所示,上述发送设备1100可以包括:获取模块1110、封装模块1120及发送模块1130;其中,
获取模块1110,用于获取应用层的有效载荷;
封装模块1120,用于对应用层的有效载荷进行封装,得到异构网络数据帧;其中,异构网络数据帧不包括网络层协议帧头,异构网络数据帧的帧头长度小于传输层协议帧头长度;
发送模块1130,用于在异构网络中将异构网络数据帧发送给接收设备。
其中一种可能的实现方式中,异构网络数据帧的帧头包括窗口长度指示,窗口长度指示用于指示接收窗口长度,窗口长度指示的长度为8比特。
其中一种可能的实现方式中,窗口长度指示的首个比特用于指示是否存在窗口放大倍率,窗口长度指示的后7个比特用于指示接收窗口基础长度。
其中一种可能的实现方式中,窗口长度指示的首个比特指示存在窗口放大倍率,接收窗口长度由接收窗口基础长度与窗口放大倍率确定,其中,窗口放大倍率由发送设备与接收设备协商获得。
其中一种可能的实现方式中,异构网络数据帧的帧头包括以下至少一个:
合并指示,合并指示用于指示当前的异构网络数据帧是否与后续的异构网络数据帧合并,合并指示的长度为1比特;
流标签,流标签用于指示接收设备的地址,流标签的长度为16比特;
传输索引指示,传输索引指示用于指示异构网络数据帧的传输或重传次数,传输索引指示的长度为2比特。
其中一种可能的实现方式中,上述发送模块1130具体用于
向接收设备发送连接请求,其中,连接请求通过异构网络数据帧承载,连接请求用于请求与接收设备建立连接;和/或
向接收设备发送结束请求,其中,结束请求通过异构网络数据帧承载,结束请求用于启动与接收设备断开连接。
其中一种可能的实现方式中,上述发送设备1100还包括:
协商模块,用于与接收设备建立连接过程中,与接收设备协商拥塞控制算法。
其中一种可能的实现方式中,上述协商模块还用于
与发送设备建立连接过程中,与发送设备进行会话协商,其中,会话协商的参数由异构网络数据帧的扩展头携带。
其中一种可能的实现方式中,异构网络由无线保真Wi-Fi、蓝牙、低功耗蓝牙及以太网中的一种或多种组成。
其中一种可能的实现方式中,上述发送设备1100还包括:
接收模块,用于接收接收设备发送的确认信息,确认信息用于对发送设备发送的一个或多个异构网络数据帧进行确认。
图11所示实施例提供的发送设备1100可用于执行本申请图1-图10所示方法实施例的技术方案,其实现原理和技术效果可以进一步参考方法实施例中的相关描述。
图12为本申请接收设备一个实施例的结构示意图,如图12所示,上述接收设备1200可以包括:接收模块1210、解封装模块1220及发送模块1230;其中,
接收模块1210,用于在异构网络中接收异构网络数据帧;其中,异构网络数据帧不包括网络层协议帧头,异构网络数据帧的帧头长度小于传输层协议帧头长度;
解封装模块1220,用于对异构网络数据帧进行解封装,得到有效载荷;
发送模块1230,用于将有效载荷发送给接收设备的应用层。
其中一种可能的实现方式中,上述发送模块1230还用于
向发送设备发送确认信息,确认信息用于对发送设备发送的一个或多个异构网络数据帧进行确认。
其中一种可能的实现方式中,上述接收模块1210还用于
接收发送设备发送的连接请求,基于连接请求与发送设备建立连接,连接请求由异构网络数据帧承载;和/或
向发送设备发送结束请求,结束请求通过异构网络数据帧承载,结束请求用于启动与发送设备断开连接。
其中一种可能的实现方式中,上述接收设备1200还包括:
协商模块,用于与发送设备建立连接过程中,与发送设备协商拥塞控制算法。
其中一种可能的实现方式中,上述协商模块还用于
与发送设备建立连接过程中,与发送设备进行会话协商,其中,会话协商的参数由异构网络数据帧的扩展头携带。
其中一种可能的实现方式中,异构网络由无线保真Wi-Fi、蓝牙、低功耗蓝牙及以太网中的一种或多种组成。
图12所示实施例提供的接收设备1200可用于执行本申请图1-图10所示方法实施例的技术方案,其实现原理和技术效果可以进一步参考方法实施例中的相关描述。
应理解以上图11所示的发送设备和图12所示的接收设备的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,检测模块可以为单独设立的处理元件,也可以集成在电子设备的某一个芯片中实现。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。
例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit;以下简称:ASIC),或,一个或多个微处理器(Digital Signal Processor;以下简称:DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array;以下简称:FPGA)等。再如,这些模块可以集成在一起,以片上系统(System-On-a-Chip;以下简称:SOC)的形式实现。
以上各实施例中,涉及的处理器可以例如包括CPU、DSP、微控制器或数字信号处理器,还可 包括GPU、嵌入式神经网络处理器(Neural-network Process Units;以下简称:NPU)和图像信号处理器(Image Signal Processing;以下简称:ISP),该处理器还可包括必要的硬件加速器或逻辑处理硬件电路,如ASIC,或一个或多个用于控制本申请技术方案程序执行的集成电路等。此外,处理器可以具有操作一个或多个软件程序的功能,软件程序可以存储在存储介质中。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行本申请图1~图10所示实施例提供的方法。
本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机程序,当其在计算机上运行时,使得计算机执行本申请图1~图10所示实施例提供的方法。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a和b,a和c,b和c或a和b和c,其中a,b,c可以是单个,也可以是多个。
本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,任一功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory;以下简称:ROM)、随机存取存储器(Random Access Memory;以下简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。

Claims (14)

  1. 一种通信方法,其特征在于,应用于发送设备,所述方法包括:
    获取应用层的有效载荷;
    对所述应用层的有效载荷进行封装,得到异构网络数据帧;其中,所述异构网络数据帧不包括网络层协议帧头,所述异构网络数据帧的帧头长度小于传输层协议帧头长度;
    在异构网络中将所述异构网络数据帧发送给接收设备。
  2. 根据权利要求1所述的方法,其特征在于,所述异构网络数据帧的帧头包括窗口长度指示,所述窗口长度指示用于指示接收窗口长度,所述窗口长度指示的长度为8比特。
  3. 根据权利要求2所述的方法,其特征在于,所述窗口长度指示的首个比特用于指示是否存在窗口放大倍率,所述窗口长度指示的后7个比特用于指示接收窗口基础长度。
  4. 根据权利要求3所述的方法,其特征在于,若所述窗口长度指示的首个比特指示存在所述窗口放大倍率,所述接收窗口长度由所述接收窗口基础长度与所述窗口放大倍率确定,其中,所述窗口放大倍率由所述发送设备与所述接收设备协商获得。
  5. 根据权利要求1所述的方法,其特征在于,所述异构网络数据帧的帧头包括以下至少一个:
    合并指示,所述合并指示用于指示当前的异构网络数据帧是否与后续的异构网络数据帧合并,所述合并指示的长度为1比特;
    流标签,所述流标签用于指示所述接收设备的地址,所述流标签的长度为16比特;
    传输索引指示,所述传输索引指示用于指示异构网络数据帧的传输或重传次数,所述传输索引指示的长度为2比特。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述方法还包括:
    向所述接收设备发送连接请求,其中,所述连接请求通过所述异构网络数据帧承载,所述连接请求用于请求与所述接收设备建立连接;和/或
    向所述接收设备发送结束请求,其中,所述结束请求通过所述异构网络数据帧承载,所述结束请求用于启动与所述接收设备断开连接。
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述在异构网络中将所述异构网络数据帧发送给接收设备之后,所述方法还包括:
    接收所述接收设备发送的确认信息,所述确认信息用于对所述发送设备发送的一个或多个异构网络数据帧进行确认。
  8. 一种通信方法,其特征在于,应用于接收设备,所述方法包括:
    在异构网络中接收异构网络数据帧;其中,所述异构网络数据帧不包括网络层协议帧头,所述异构网络数据帧的帧头长度小于传输层协议帧头长度;
    对所述异构网络数据帧进行解封装,得到有效载荷;
    将所述有效载荷发送给所述接收设备的应用层。
  9. 根据权利要求8所述的方法,其特征在于,所述在异构网络中接收异构网络数据帧之后,所述方法还包括:
    向发送设备发送确认信息,所述确认信息用于对所述发送设备发送的一个或多个异构网络数据帧进行确认。
  10. 根据权利要求8或9所述的方法,其特征在于,所述在异构网络中接收异构网络数据帧之前,所述方法还包括:
    接收所述发送设备发送的连接请求,基于所述连接请求与所述发送设备建立连接,所述连接请求由异构网络数据帧承载;和/或
    向所述发送设备发送结束请求,所述结束请求通过异构网络数据帧承载,所述结束请求用于启动与所述发送设备断开连接。
  11. 一种发送设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,使得所述发送设备实现如权利要求1-7任一项所述的通信 方法。
  12. 一种接收设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,使得所述接收设备实现如权利要求8-10任一项所述的通信方法。
  13. 一种通信系统,其特征在于,包括如权利要求11所述的发送设备和如权利要求12所述的接收设备。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序在计算机上运行时,实现如权利要求1-10任一所述的通信方法。
PCT/CN2023/110463 2022-08-04 2023-08-01 通信方法、设备及存储介质 WO2024027674A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210932395.3 2022-08-04
CN202210932395.3A CN117560432A (zh) 2022-08-04 2022-08-04 通信方法、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2024027674A1 true WO2024027674A1 (zh) 2024-02-08

Family

ID=89819133

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/110463 WO2024027674A1 (zh) 2022-08-04 2023-08-01 通信方法、设备及存储介质

Country Status (2)

Country Link
CN (1) CN117560432A (zh)
WO (1) WO2024027674A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104994014A (zh) * 2015-05-11 2015-10-21 重庆邮电大学 智能电网通信中的电力线载波IPv6与无线ZigBee间的通信方法
CN105282114A (zh) * 2014-07-18 2016-01-27 北京新岸线移动多媒体技术有限公司 一种数据帧传输的方法、发送装置和接收装置
US20170111412A1 (en) * 2015-10-20 2017-04-20 Brian E. Rogers Technologies for end of frame detection in streaming content
CN112039824A (zh) * 2019-06-03 2020-12-04 上海哔哩哔哩科技有限公司 通信方法、系统、设备及计算机可读存储介质
CN113302887A (zh) * 2021-03-31 2021-08-24 华为技术有限公司 一种基于时间敏感传输协议的通信方法和相关装置
CN114500475A (zh) * 2021-12-31 2022-05-13 赛因芯微(北京)电子科技有限公司 一种基于实时传输协议的网络数据传输方法、装置及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105282114A (zh) * 2014-07-18 2016-01-27 北京新岸线移动多媒体技术有限公司 一种数据帧传输的方法、发送装置和接收装置
CN104994014A (zh) * 2015-05-11 2015-10-21 重庆邮电大学 智能电网通信中的电力线载波IPv6与无线ZigBee间的通信方法
US20170111412A1 (en) * 2015-10-20 2017-04-20 Brian E. Rogers Technologies for end of frame detection in streaming content
CN112039824A (zh) * 2019-06-03 2020-12-04 上海哔哩哔哩科技有限公司 通信方法、系统、设备及计算机可读存储介质
CN113302887A (zh) * 2021-03-31 2021-08-24 华为技术有限公司 一种基于时间敏感传输协议的通信方法和相关装置
CN114500475A (zh) * 2021-12-31 2022-05-13 赛因芯微(北京)电子科技有限公司 一种基于实时传输协议的网络数据传输方法、装置及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WANG JIAN-PING; HUANG TAO; LI QI-YUE; SUN WEI: "Architecture and Protocol Stack Design for New Wireless IOT Network", CONTROL AND INSTRUMENTS IN CHEMICAL INDUSTRY, vol. 43, no. 10, 10 October 2016 (2016-10-10), pages 1085 - 1090, XP009552313, ISSN: 1000-3932 *

Also Published As

Publication number Publication date
CN117560432A (zh) 2024-02-13

Similar Documents

Publication Publication Date Title
WO2021018187A1 (zh) 投屏方法及设备
WO2020133183A1 (zh) 音频数据的同步方法及设备
EP4213512A1 (en) Screen projection method and system, and electronic device
WO2021043170A1 (zh) 一种蓝牙连接方法及相关装置
WO2021043219A1 (zh) 一种蓝牙回连方法及相关装置
US20240040481A1 (en) Tws headset connection method and device
WO2023011376A1 (zh) 一种北斗通信系统中密钥更新方法、系统及相关装置
WO2021147660A1 (zh) 一种数据传输方法及设备
WO2023011380A1 (zh) 一种北斗通信系统中多帧融合传输方法及相关装置
CN115334138A (zh) Quic数据传输方法、装置、客户端及服务端
WO2024027674A1 (zh) 通信方法、设备及存储介质
WO2023011379A1 (zh) 一种北斗通信系统中入站传输控制方法、系统及相关装置
WO2022111712A1 (zh) 一种音频与视频同步的方法及设备
WO2023011377A1 (zh) 一种北斗通信系统中应用层回执传输方法、系统及装置
WO2023001044A1 (zh) 数据处理方法及电子设备
WO2023051204A1 (zh) 跨设备连接方法、电子设备及存储介质
CN115694596B (zh) 一种北斗通信系统中入站传输控制方法、系统及相关装置
WO2022068486A1 (zh) 数据发送方法、电子设备、芯片系统及存储介质
WO2022188813A1 (zh) 蓝牙通信方法、系统及电子设备
WO2022095581A1 (zh) 数据传输方法及终端设备
CN114640725B (zh) 数据传输方法及电子设备
WO2024067430A1 (zh) 一种传输方法、系统及相关装置
WO2024088173A1 (zh) 组播通信方法及相关装置
CN112996066B (zh) 驻网方法及相关设备
WO2023011329A1 (zh) 一种北斗通信系统中数据传输控制方法、系统及相关装置

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: 23849381

Country of ref document: EP

Kind code of ref document: A1