[go: up one dir, main page]

WO2025168105A1 - Data transmission method and apparatus, electronic device, and storage medium - Google Patents

Data transmission method and apparatus, electronic device, and storage medium

Info

Publication number
WO2025168105A1
WO2025168105A1 PCT/CN2025/076449 CN2025076449W WO2025168105A1 WO 2025168105 A1 WO2025168105 A1 WO 2025168105A1 CN 2025076449 W CN2025076449 W CN 2025076449W WO 2025168105 A1 WO2025168105 A1 WO 2025168105A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
protocol
queue
tcp
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/076449
Other languages
French (fr)
Chinese (zh)
Inventor
杨鹏
侯添译
马红阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2025168105A1 publication Critical patent/WO2025168105A1/en
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/56Allocation or scheduling criteria for wireless resources based on priority criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6295Queue scheduling characterised by scheduling criteria using multiple queues, one for each individual QoS, connection, flow or priority

Definitions

  • the application relates to the field of terminal technology, and in particular to a data transmission method and device, electronic equipment and storage medium.
  • the air interface signal may be interfered with or the air interface signal is poor, resulting in a poor Internet experience for the users.
  • the embodiments of the present application provide a data transmission method and apparatus, an electronic device, and a storage medium, which can improve the user experience of using an electronic device to access the Internet through a Wi-Fi network.
  • the electronic device includes a Wi-Fi driver.
  • a first protocol message to be sent is a signaling message of a preset protocol
  • the electronic device adds the first protocol message to a first priority transmission queue, including: the Wi-Fi driver parses the first protocol message, and when determining, based on a parsing result, that the first protocol message is a signaling message of the preset protocol, adds the first protocol message to the first priority transmission queue.
  • the signaling message can be sent out more reliably (it can be understood that the recipient can receive the signaling message with a greater probability), avoiding the signaling message from being successfully sent due to the air interface environment not being good enough (it can be understood that the recipient failed to successfully receive the signaling message), resulting in the user experiencing connection jams, delays or failures when using the electronic device to surf the Internet through the Wi-Fi network, thereby ensuring the user's experience of surfing the Internet through the Wi-Fi network.
  • the first priority transmission queue includes a voice-optimized VO queue; and the ability of the first priority transmission queue to seize a channel is greater than that of transmission queues other than the first priority transmission queue.
  • the transmission queues other than the first priority transmission queue include: a video optimization VI queue, a best effort BE queue, and a background optimization BK queue.
  • protocol messages other than signaling messages in the preset protocol can be sent in a queue that does not have the strongest channel seizure capability, so that the signaling messages of the preset protocol can be promptly placed in the VO queue with the strongest channel seizure capability for transmission, thereby better ensuring that electronic devices can access the Internet through the Wi-Fi network and guaranteeing the user's Internet experience.
  • the third TCP handshake message when the third TCP handshake message carries service data, it can contain multiple data packets. That is, after receiving the third TCP handshake message, even if it contains missing data, the TCP server can promptly determine which sequence numbers are missing based on the sequence numbers of the received messages and promptly notify the mobile phone to resend the data. Therefore, when the third TCP handshake message carries service data, it cannot be simply considered a signaling message and can be treated as a signaling message for the default protocol. Even if a transmission issue occurs, the peer device can promptly detect the issue and notify the mobile phone to resend the missing data, eliminating the need to prioritize its transmission using the default protocol's signaling message transmission priority. This allows signaling messages for the default protocol that significantly impact the Wi-Fi network experience to be promptly routed to the VO queue with the strongest channel preemption capability for transmission, thereby better ensuring Wi-Fi access for electronic devices and guaranteeing a secure user experience.
  • the electronic device can successfully send the first protocol message to the target device.
  • embodiments of the present application further provide a data transmission device that can be applied to an electronic device.
  • the functions of the device can be implemented in hardware or by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions, such as a processing module and a sending module.
  • the processing module is used to add the first protocol message to the first priority transmission queue when the first protocol message to be sent is a signaling message; the processing module is also used to add the first protocol message to the second priority transmission queue when the first protocol message is not a signaling message of the preset protocol; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP; the sending module is used to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.
  • the present application provides an electronic device comprising a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; wherein the memory stores computer program code, and the computer program code comprises computer instructions, which, when executed by the processor, enable the electronic device to execute the data transmission method provided in the first aspect and any possible design thereof.
  • the present application provides an electronic device, including a TCP/IP protocol stack, a Wi-Fi driver, and a Wi-Fi chip; when the Wi-Fi driver executes computer instructions, the electronic device executes the data transmission method provided in the first aspect and any one of its design methods.
  • the present application provides a computer-readable storage medium, which includes computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes the data transmission method provided in the first aspect and any possible design thereof.
  • FIG2 is a schematic diagram showing the principle of a data transmission method provided in an embodiment of the present application.
  • FIG8 is a fourth flow chart of a data transmission method provided in an embodiment of the present application.
  • FIG9 is a fifth flow chart of a data transmission method provided in an embodiment of the present application.
  • Frequency band In the field of communications, frequency band refers to the frequency range of electromagnetic waves.
  • DHCP Dynamic Host Configuration Protocol
  • RFC 1541 Superseded by RFC 2131. It allows a DHCP server to dynamically assign network configuration information, such as Internet Protocol (IP) addresses, subnet masks, and gateway addresses, to clients (e.g., mobile phones and other electronic devices).
  • IP Internet Protocol
  • DHCP is typically used in large local area networks, primarily to centrally manage and allocate IP addresses, thereby increasing address utilization.
  • the DHCP server (usually a router or a network device connected to the router) will assign an available IP address to the mobile phone and provide the IP address of the gateway at the same time.
  • the gateway is a router connected to a Wi-Fi network.
  • the router is responsible for forwarding messages from the internal network to the external network, and also forwarding messages from the external network to the internal network.
  • the gateway IP address obtained by the mobile phone is the IP address pointing to the router.
  • the router can perform network address translation (NAT), routing selection and other operations, thereby realizing communication between the mobile phone and the external network.
  • NAT network address translation
  • the electronic device can send an ARP request message in the broadcast domain of the Wi-Fi local area network.
  • the ARP request message contains the target IP address (i.e. the IP of the gateway) and the IP address of the electronic device, as well as an empty MAC address field.
  • Other devices in the Wi-Fi local area network will receive this ARP request packet and check whether their IP address matches the target IP address in the ARP request message. If it matches, the device will reply its MAC address to the sender. In this way, the electronic device can convert the IP address into the corresponding MAC address, thereby achieving network communication.
  • host B, host C and host D will all receive the ARP request message and identify whether the target IP address in the ARP request message is the same as or matches their own IP address. If Host B and Host D determine that the target IP address in the ARP request message is different from or does not match their own IP address, they will discard the ARP request message. If Host C determines that the target IP address in the ARP request message is the same as or matches its own IP address, it will return its MAC address to Host A. Host A will associate the received MAC address with the gateway's ID address and store it in the ARP table entry. Host A will then use this MAC address to send messages.
  • DNS Domain Name System
  • DNS Domain Name System
  • electronic devices can convert the host name of an application server (e.g., www.example.com) to the corresponding IP address (e.g., 192.0.2.1).
  • an application server e.g., www.example.com
  • the corresponding IP address e.g., 192.0.2.1
  • the electronic device can also use DNS to convert it into the corresponding IP address to complete the corresponding communication.
  • WMM defines four transmission queues with different priorities: voice optimized queue (VO), video optimized queue (VI), best effort queue (BE), and background optimized queue (BK).
  • VO voice optimized queue
  • VI video optimized queue
  • BE best effort queue
  • BK background optimized queue
  • the VO queue is primarily used for voice data, with low latency as its primary goal; the VI queue focuses on video data, aiming to ensure smooth video streaming; the BE queue meets best-effort service requirements without strict QoS guarantees; and the BK queue targets background applications, with a certain tolerance for delay and loss.
  • EDCA enhanced distributed channel access
  • AIFS defines the time each priority message needs to wait before starting to send on the contention medium, that is, AIFS includes a priority-related timer.
  • Messages with higher transmission priorities can be configured with a shorter AIFS so that they can participate in the competition earlier, thereby increasing their probability of obtaining a transmission opportunity on the contention medium (i.e., channel), which also helps meet the requirements of applications with higher real-time performance.
  • the higher the transmission priority of the transmission queue the shorter the AIFS parameter time, so that the higher the transmission priority of the transmission queue, the higher the probability of competing for the channel.
  • the transmission queues with AIFS parameters from small to large are VO, VI, BE, and BK.
  • the AIFS parameter of the VO queue can be 24us
  • the AIFS parameter of the VI queue can be 34us
  • the AIFS parameter of the BE queue can be 43us
  • the AIFS parameter of the BK queue can be 79us.
  • the random backoff parameter is a range, specifically [CWmin, CWmax].
  • the random backoff mechanism is to derive CW from [CWmin, CWmax].
  • the initial value CW CWmin.
  • After a contention failure, it is doubled, and then updated to CW 2CW until CW reaches CWmax.
  • CW returns to CWmin.
  • the random backoff parameter ranges, from smallest to largest, are for the following transmission queues: VO, VI, BE, and BK.
  • TXOP Limit refers to the maximum duration that a given electronic device or station (STA) can transmit during a competitive or non-competitive transmission in a wireless local area network.
  • STA electronic device or station
  • TXOP Limit refers to the maximum amount of time that a STA obtains a transmission opportunity and continuously transmits data on the shared medium of the network.
  • TXOP Limit has different configuration methods for different QoS categories. By allowing STAs to transmit for a longer time during the transmission opportunity, TXOP Limit can improve the quality of service for high transmission priority messages, such as voice and video messages. For messages with low transmission priority, the TXOP Limit is smaller to give more stations the opportunity to transmit. In other words, the TXOP Limit of the transmission queue with a higher transmission priority is larger, and the TXOP Limit of the transmission queue with a lower transmission priority is smaller.
  • these four transmission queues compete for the channel. They compete by counting down based on the AIFS parameter plus the random backoff parameter. If the channel is still idle after the countdown reaches 0, the queue will occupy it. If the channel is already occupied, the queue will restart the countdown after the channel becomes idle. After a transmission queue wins the channel, it can use the channel for the duration of the TXOP limit.
  • some embodiments of the present application can improve the user's Internet experience by prioritizing the transmission of signaling messages of important protocols in the TCP/IP (Transmission Control Protocol/Internet Protocol) protocol stack (some protocols that are strongly related to the user's Internet experience) and improving the transmission reliability of the signaling messages of these important protocols.
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • signaling message is responsible for completing tasks such as establishing, maintaining, and terminating network connections, as well as managing and resolving network addresses. In other words, this type of signaling message is used to ensure that users can access the Internet and then successfully use electronic devices to complete the services required by users.
  • the sender For signaling messages, the sender only sends one message at a time. If the air interface signal is interfered with or poor, and the receiver fails to receive the signaling message, it cannot determine whether the sender has sent the message and cannot promptly notify the sender to resend the message. Subsequently, based on the retransmission mechanism, if the sender does not receive a response (e.g., an acknowledgment (ACK) message) from the receiver after a preset duration (retransmission interval) has passed after sending the signaling message, the sender can determine that the signaling message has failed and can resend the message.
  • ACK acknowledgment
  • a signaling message can be understood as a protocol message sent through only one message, and a data message can be understood as a protocol message sent through multiple messages at the same time.
  • the first protocol message is placed in a first transmission queue. If the first protocol message is determined not to be a signaling message, the first protocol message is placed in a second transmission queue.
  • the first transmission queue is a VO queue
  • the second transmission queue is a VI queue, a BE queue, or a BK queue.
  • the electronic device may transmit the first protocol message in the first transmission queue or the second transmission queue based on a specific queue scheduling rule, wherein the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.
  • the electronic device when sending protocol messages, the electronic device can place the signaling messages closely related to the user's Internet access in the VO queue.
  • the VO queue is the queue with the strongest channel seizure capability for electronic devices in Wi-Fi scenarios.
  • the signaling message can be sent out more reliably (it can be understood that the receiver can receive the signaling message with a greater probability), avoiding the signaling message from being successfully sent due to the air interface environment not being good enough (it can be understood that the receiver failed to successfully receive the signaling message), resulting in the user using the electronic device to access the Internet through the Wi-Fi network. Connection jams, delays or failures, ensuring the user's experience of accessing the Internet through the Wi-Fi network.
  • FIG3 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • the electronic device 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display 193, a subscriber identification module (SIM) card interface 194, and a camera 195.
  • 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 1
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU).
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated into one or more processors.
  • the processor may include a system-on-chip (SoC).
  • SoC system-on-chip
  • the controller can be the nerve center and command center of the electronic device.
  • the controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
  • Processor 110 may also include a memory for storing instructions and data.
  • the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
  • the processor 110 may include one or more interfaces.
  • the interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface.
  • I2C inter-integrated circuit
  • I2S inter-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 external memory interface 120 can be used to connect to an external non-volatile memory device to expand the storage capacity of the electronic device.
  • the external non-volatile memory device communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory device.
  • Internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).
  • RAMs can be directly read and written by processor 110 and can be used to store executable programs (e.g., machine instructions) for an operating system or other running programs, as well as user and application data.
  • executable programs e.g., machine instructions
  • NVMs can also store executable programs and user and application data, and can be preloaded into RAMs for direct reading and writing by processor 110.
  • the display screen 193 can be used to display pages required by the electronic device (for example, wizard pages (including highlight recommendation pages and external module access pages), etc.), and display images captured by any one or more cameras 195 in the interface.
  • pages required by the electronic device for example, wizard pages (including highlight recommendation pages and external module access pages), etc.
  • display images captured by any one or more cameras 195 in the interface for example, wizard pages (including highlight recommendation pages and external module access pages), etc.
  • the wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to electronic devices.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, and perform other processing on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
  • at least some of the functional modules of the mobile communication module 150 can be set in the processor 110.
  • at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
  • the SIM card interface 194 is used to connect a SIM card.
  • the SIM card can be connected to and disconnected from the electronic device by inserting or removing it from the SIM card interface 194.
  • the electronic device may support one or more SIM card interfaces.
  • the SIM card interface 194 may support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 194 at the same time.
  • the SIM card interface 194 is also compatible with external memory cards. Electronic devices interact with the network through the SIM card to implement functions such as calls and data communications.
  • One SIM card corresponds to one user number.
  • the software system of the electronic device can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.
  • the software system on the application processor (AP) in the system-on-chip (SOC) of an electronic device is divided into five layers: the application layer, the framework layer (or application framework layer), the system library and Android runtime (Android runtime), the HAL layer (hardware abstraction layer), and the kernel layer (or driver layer).
  • the system library and Android runtime can also be referred to as the native framework layer or the native layer.
  • the framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions or services.
  • the application framework layer may include an activity manager, a window manager, a content provider, an audio service, a view system, a telephony manager, a resource manager, a notification manager, a package manager, etc., which are not limited in this embodiment of the application.
  • the window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the view system includes visual controls, such as those for displaying text and images.
  • the view system is used to build applications.
  • a display interface can consist of one or more views.
  • a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
  • the resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
  • the Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders.
  • the Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
  • Package Manager in The system is used to manage application packages. It allows applications to obtain detailed information about installed applications and their services, permissions, etc.
  • the package manager is also used to manage events such as application installation, uninstallation, and upgrades.
  • the system library can include multiple functional modules. For example: surface manager, media libraries, open graphics library embedded systems (OpenGL ES), SGL, etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of common audio and video formats, as well as static image files.
  • the media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • SGL is a drawing engine for 2D drawing.
  • the Android runtime consists of the core library and the ART virtual machine.
  • the Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one for the Java language's function calls and the other for the Android core library.
  • the application layer and the application framework layer run in the ART virtual machine.
  • the ART virtual machine executes the Java files in the application layer and application framework layer as binary files.
  • the ART virtual machine is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
  • the HAL layer is an interface layer located between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms.
  • the HAL layer provides a standard interface to display device hardware capabilities to the higher-level Java API framework (i.e., the framework layer).
  • the HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as the audio HAL audio module, the bluetooth HAL Bluetooth module, the camera HAL camera module (also known as the camera HAL or camera hardware abstraction module), the sensors HAL sensor module (or Isensor service, sensor service), the Wi-Fi HAL (Wi-Fi module), etc.
  • the kernel layer is the layer between hardware and software. It contains at least various drivers and the TCP/IP protocol stack. These drivers can include display drivers, camera drivers, audio drivers, sensor drivers, battery drivers, Wi-Fi drivers, and more, though this application does not limit these.
  • the TCP/IP protocol stack is a collection of network communication protocols whose primary function is to ensure the correct and efficient transmission of data across a network. It provides a set of standardized protocols that enable different types of hosts, routers, and other devices to communicate and exchange data. By using the TCP/IP protocol stack, various devices can find paths between each other, exchange data, send and receive information, and ensure reliable and secure data transmission within complex networks.
  • the TCP/IP protocol stack typically consists of multiple layers, such as the physical layer, data link layer, network layer, transport layer, and application layer. Each layer has specific functions, such as the network layer responsible for addressing and routing, and the transport layer responsible for data segmentation and transmission control.
  • the transport layer in a TCP/IP protocol stack typically includes a TCP/UDP (user datagram protocol) protocol stack; the network layer in a TCP/IP protocol stack may include an IP protocol stack.
  • the TCP/UDP protocol stack is responsible for data transmission at the transport layer.
  • the transport layer is primarily responsible for breaking application layer data into smaller data blocks and passing these blocks to the network layer for reliable transmission across the network.
  • the IP protocol stack is responsible for the network layer, which is the foundation of data transmission on the internet.
  • the IP protocol stack uses IP addresses to identify and address devices on the network, thereby routing data between different network nodes.
  • the business data that needs to be sent by various applications in the application layer will first be encapsulated by the TCP/IP protocol stack, and then sent through the Wi-Fi driver to control the Wi-Fi chip.
  • the TCP/IP protocol stack When an electronic device uses a Wi-Fi network to access the Internet in a Wi-Fi scenario, when the TCP/IP protocol stack generates a protocol message, the TCP/IP protocol stack sends the message to the Wi-Fi driver, so that the Wi-Fi driver sends the protocol message to the corresponding recipient.
  • the Wi-Fi driver is used to drive the Wi-Fi module (or Wi-Fi chip) to establish a Wi-Fi connection so that the electronic device can access the Internet through the Wi-Fi network.
  • the Wi-Fi driver may include a message parsing module, a queue allocation module and a data sending module.
  • the message parsing module is used to parse the protocol message from the TCP/IP protocol stack, and determine whether the protocol message is a signaling message of the preset protocol based on the parsing result.
  • the queue allocation module is used to allocate queues to the protocol messages from the TCP/IP protocol stack according to the judgment of the message parsing module on the parsing result.
  • the queue allocation message allocates the protocol message to the VO queue; when the message parsing module determines that the protocol message is not a signaling message of the preset protocol, the queue allocation message allocates the protocol message to a transmission queue other than the VO queue.
  • the data sending module can send the protocol message according to a specific queue message sending rule based on the allocation result of the queue allocation message to the protocol message.
  • the electronic device needs to complete the EAPOL interaction process with the AP to complete identity authentication. If the user's network environment is very poor (i.e., the air interface signal is interfered with or the air interface signal is poor), the electronic device fails to successfully send the signaling message that needs to be sent to the AP during the EAPOL interaction process, and identity authentication cannot be completed. The electronic device will also be unable to access the Internet through the AP.
  • DHCP is an important protocol for obtaining the IP of a mobile phone.
  • the signaling message sent by the DHCP server - DHCP OFFER (DHCP offer) provides the IP to the electronic device. If the user's network environment is very poor (that is, the air interface signal is interfered with or the air interface signal is poor), the DHCP server does not receive the DHCP DISCOVER (DHCP discovery) signaling message sent by the electronic device.
  • the electronic device After the electronic device obtains its own IP address and the IP address of the gateway, considering that the electronic device accesses the Internet through the Wi-Fi network, it must forward the corresponding message to the gateway in the Wi-Fi local area network.
  • the data transmission in the Wi-Fi local area network is through the data link layer, so at this time the electronic device needs to obtain the MAC address of the gateway through ARP interaction to facilitate the subsequent forwarding of the data to the Internet by the gateway.
  • the user's network environment is very poor (that is, the air interface signal is interfered with or the air interface signal is poor)
  • the ARP request message sent by the electronic device is not received by the gateway for a long time, which will cause the ARP table on the mobile phone to age. After that, the electronic device will not be able to send any protocol message to the gateway, resulting in the user being completely unable to access the Internet.
  • the electronic device After the electronic device obtains the IP address of the application server, it can complete the establishment of a TCP connection (or TCP stream) through TCP interaction with the application server. After the TCP connection is established, the electronic device can normally exchange data with the application server to achieve the purpose of Internet access.
  • the electronic device and the TCP server will establish a TCP connection through a three-way handshake. Among them, the Transmission Control Protocol Synchronization Sequence Number (TCP SYN) message is the first handshake message. If the user's network environment is very poor (that is, the air interface signal is interfered or the air interface signal is poor), resulting in the loss of the signaling message, the TCP server will be completely unable to perceive that there is an electronic device trying to access.
  • TCP SYN Transmission Control Protocol Synchronization Sequence Number
  • the data transmission method provided by the present application may include five corresponding processes, which may be: EAPLO data transmission process, DHCP data transmission process, ARP data transmission process, DNS data transmission process and TCP data transmission process.
  • EAPLO data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG5.
  • FIG5 is a schematic diagram of the EAPLO data transmission process provided by the embodiment of the present application. Referring to FIG5, taking the electronic device (i.e., the client STA (station)) as a mobile phone and the AP as a router as an example, the EAPLO data transmission process may include S501-S516:
  • the router sends the first handshake message to the mobile phone.
  • the Wi-Fi chip of the mobile phone receives the first handshake message from the router, and sends the first handshake message to the TCP/IP protocol stack through the Wi-Fi driver.
  • the preset algorithm may be a pseudo-random function (PRF) algorithm.
  • PRF pseudo-random function
  • PTK PRF (Snonce + Anonce + PMK + AA + SA).
  • the MIC key is determined during the authentication process between the mobile phone and the router before the EAPOL interaction.
  • the MIC key can be the first 16 bytes of the PTK.
  • the Wi-Fi driver of the mobile phone parses the first message and determines whether the first message is a signaling message of a preset protocol based on the parsing result.
  • the transmission queue other than the VO queue can be referred to as the second priority transmission queue.
  • the second priority transmission queue is different from the first priority transmission queue. The same applies to the subsequent embodiments.
  • the Wi-Fi driver of the mobile phone may place the first message that is not a signaling message of the preset protocol in the BE queue.
  • the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.
  • the router receives the first message from the mobile phone, and generates a third handshake message based on the SNonce and MIC1(sta) carried in the first message.
  • the router can generate a PTK and MIC1(ap) in the same way as the mobile phone generates the PTK and MIC(sta). If MIC1(sta) and MIC1(ap) are the same, the PTK calculated by the router can be determined to be correct. If MIC1(sta) and MIC1(ap) are different, it can be assumed that the PTK calculated by the mobile phone and the PTK calculated by the router are different. The router can then discard the first message and return an authentication failure message to the mobile phone, ending the entire EAPOL interaction process.
  • the router can generate a group temporal key (GTK) based on the group master key (GMK), Anonce, and AA.
  • GTK group temporal key
  • GMK group master key
  • Anonce AA
  • the GMK may be calculated based on secret information pre-configured by the router, authentication credentials, or other security factors. This application does not impose any specific restrictions on this.
  • the router can also use the first 16 bytes of the PTK and the first message to generate MIC2 (ap).
  • the specific generation method can refer to the generation method of MIC1 (ap).
  • the router can also encrypt the GTK using a preset encryption method and generate a third handshake message Message3 carrying MIC2(ap) and the encrypted GTK.
  • the third handshake message can specifically be an EAPOL-Key message carrying MIC2(ap) and the encrypted GTK.
  • the preset encryption method can be to use the middle 16 bytes of the PTK to encrypt the GTK using any feasible encryption method (such as counter cipher mode with block chaining message authentication code protocol (CCMP)).
  • CCMP block chaining message authentication code protocol
  • S509 The router sends a third handshake message to the mobile phone.
  • the Wi-Fi chip of the mobile phone receives the third handshake message from the router, and sends the third handshake message to the TCP/IP protocol stack through the Wi-Fi driver.
  • the TCP/IP protocol stack of the mobile phone decrypts the encrypted GTK carried in the third handshake message, installs the PTK and GTK, generates a second message, and sends the second message to the Wi-Fi driver.
  • the TCP/IP protocol stack first generates MIC2(sta) in the same way as the router generates MIC2(ap), and then determines whether MIC2(sta) is the same as MIC2(ap).
  • the third handshake message can be considered unmodified and the GTK calculated by the router is correct.
  • the mobile phone can then use the PTK to decrypt the encrypted GTK to obtain the GTK, install the PTK and GTK, and generate the second message.
  • the third handshake message can be considered modified or the GTK calculated by the router is incorrect.
  • the third handshake message can be discarded and an authentication failure message can be returned to the router, ending the entire EAPOL interaction process.
  • Installing the PTK and the GTK may refer to subsequently using the PTK to encrypt unicast data frames between the mobile phone and the router, and using the GTK to encrypt multicast data frames and broadcast data frames between the mobile phone and the router.
  • the second message can be the fourth handshake message, Message 4, specifically an EAPOL-Key Ack message carrying an ACK and MIC3(sta).
  • the mobile phone can use the first 16 bytes of the PTK and the third handshake message to generate MIC3(sta).
  • the specific generation method can refer to the generation method of MIC1(sta).
  • S512 The Wi-Fi driver of the mobile phone parses the second message, and determines whether the second message is a signaling message of a preset protocol based on the parsing result.
  • the Wi-Fi driver may parse the second message in any feasible manner. By parsing the second message, the Wi-Fi driver may determine the specific protocol message of the second message and the number of the protocol message interaction process, i.e., the parsing result. For example, after parsing the second message, it may be determined that the second message is an EAPOL protocol message and is the fourth EAPOL protocol message in the EAPOL protocol message interaction process.
  • the Wi-Fi driver determines that the second message is a signaling message of a preset protocol, it can be considered that the receiving method cannot promptly determine whether the second message is received. Once the second message is lost, it is necessary to wait for the sender to retransmit it based on the retransmission mechanism after a long time. During this waiting time, the user cannot access the Internet normally. In other words, the reliable transmission of the second message has a greater impact on whether the user can access the Internet normally. Based on this, in order to ensure that the second message that has a greater impact on the user's Internet access is reliably sent and that the user can access the Internet normally through the Wi-Fi network, the second message can be placed in the VO queue, that is, S513 is executed.
  • the Wi-Fi driver determines that the second message is not a signaling message for the preset protocol, then even if the second message is lost, the receiver can promptly detect it and notify the sender to resend it, without causing the user's Internet access to stall. Based on this, in this case, the second message can be placed in a transmission queue other than the VO queue (e.g., the BE queue, the VI queue, or the BK queue), executing S514.
  • the VO queue e.g., the BE queue, the VI queue, or the BK queue
  • S514 The Wi-Fi driver of the mobile phone puts the second message into a transmission queue other than the VO queue.
  • the Wi-Fi driver of the mobile phone may place the second message that is not a signaling message of the preset protocol in the BE queue.
  • S515 The Wi-Fi driver of the mobile phone sends the second message to the router through the Wi-Fi chip according to the preset queue message sending rule.
  • the router after receiving the second message, the router first generates MIC3(ap) in the same manner as the mobile phone generates MIC3(ap), and then determines whether MIC3(sta) and MIC3(ap) are the same.
  • MIC3(sta) and MIC3(ap) are the same, it can be assumed that the second message has not been modified and the mobile phone has successfully installed the PTK and GTK. The router can then install the PTK and GTK and end the entire EAPOL interaction process. If MIC3(sta) and MIC3(ap) are different, it can be assumed that the second message has been modified or the mobile phone has failed to successfully install the PTK and GTK. The router can then discard the second message and return an authentication failure message to the mobile phone, ending the entire EAPOL interaction process.
  • the mobile phone can place all EAPOL signaling messages in the first-priority transmission queue with a higher transmission priority, such as the VO queue, for transmission.
  • a higher transmission priority such as the VO queue
  • the highest priority transmission queue is used, and messages in this queue have a stronger ability to seize the channel and a higher transmission success rate. This allows signaling messages placed in the first-priority transmission queue in the EAPOL data transmission process to be transmitted more reliably (i.e., with interference or poor signal quality), even in less-than-optimal air interface conditions (i.e., with a higher probability of successful reception at the receiver), allowing the mobile phone and router to successfully complete the EAPOL data transmission process.
  • the mobile phone can then proceed to the subsequent internet access process through the router, ensuring a smooth internet access experience, ensuring a better Wi-Fi experience.
  • FIG6 is a schematic diagram of the DHCP data transmission process provided by the embodiment of the present application.
  • the DHCP data transmission process may include S601-S618:
  • S601 The TCP/IP protocol stack of the mobile phone generates a third message and sends the third message to the Wi-Fi driver.
  • the TCP/IP protocol stack can generate a DHCP Discover message.
  • S604 The Wi-Fi driver of the mobile phone puts the third message into a transmission queue other than the VO queue.
  • the Wi-Fi driver of the mobile phone may place the third message that is not a signaling message of the preset protocol in the BE queue.
  • each interactive DHCP protocol message is a data message that the recipient cannot promptly determine has not been received when it is missing, and is strongly related to the user's ability to access the Internet normally. Therefore, based on the parsing result of the third message, the Wi-Fi driver here can determine that the third message is a signaling message of the preset protocol. Therefore, S604 will not be executed in practice.
  • the description of S604 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.
  • the Wi-Fi driver may send the third message in the broadcast domain of the Wi-Fi network through the Wi-Fi chip, so that the DHCP server can receive the third message.
  • the DHCP server may be pre-installed in a router that provides a Wi-Fi network, or may be a device connected to the router in a Wi-Fi local area network. If the DHCP server and the router are different devices, the Wi-Fi chip may send the third message to the router, which then sends it to the DHCP server.
  • the DHCP server receives a third message from the mobile phone, selects an unassigned first IP address from the IP address pool in response to the third message, and generates a DHCP OFFER message carrying the first IP address.
  • the DHCP server sends the DHCP OFFER message to the mobile phone.
  • the DHCP server can send the DHCP Offer message in the broadcast domain of the Wi-Fi network. After sending the third message, the mobile phone can obtain the DHCP Offer message by monitoring the broadcast address (i.e., monitoring messages in the broadcast domain).
  • the DHCP server unicasts the DHCP Offer message to the mobile phone.
  • the DHCP server can use the mobile phone's MAC address or other identifier carried in the third message to unicast the DHCP Offer message to the mobile phone.
  • the DHCP server can specifically send the DHCP OFFER message to the mobile phone through the router.
  • the Wi-Fi chip of the mobile phone receives the DHCP OFFER message from the DHCP server and sends the DHCP OFFER message to the TCP/IP protocol stack through the Wi-Fi driver.
  • the TCP/IP protocol stack of the mobile phone applies the first IP address carried in the DHCP OFFER message to the network configuration of the mobile phone and generates a fourth message.
  • Applying the first IP address to the mobile phone's network configuration refers to configuring the first IP address as the mobile phone's IP address. Furthermore, the TCP/IP protocol stack is used to apply information such as the lease period of the first IP address, subnet mask, gateway IP address, and DNS server IP address carried in the DHCP OFFER message to the mobile phone's network configuration in a similar manner.
  • the TCP/IP protocol stack will also determine whether the first IP address is valid through any available method. If the first IP address is determined to be valid, the TCP/IP protocol stack will apply the first IP address to the phone's network configuration and generate the fourth message. If the first IP address is determined to be invalid, the phone can perform any available processing action, such as resending a DHCP DISCOVER message to the DHCP server.
  • the fourth message may specifically be a DHCP REQUEST message.
  • the DHCP REQUEST message is used to instruct the mobile phone to accept the first IP address assigned by the DHCP server.
  • S610 The TCP/IP protocol stack of the mobile phone sends a fourth message to the Wi-Fi driver.
  • the Wi-Fi driver of the mobile phone parses the fourth message, and determines whether the fourth message is a signaling message of a preset protocol based on the parsing result.
  • the Wi-Fi driver determines that the fourth message is a signaling message of a preset protocol based on the parsing result of the fourth message
  • the fourth message may be placed in a VO queue for sending, ie, S612 is executed.
  • the Wi-Fi driver determines that the fourth message is not a signaling message of the preset protocol based on the parsing result of the fourth message
  • the fourth message may be placed in a transmission queue other than the VO queue for sending, that is, S613 is executed.
  • S611 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.
  • the target domain name can be a domain name entered by the user in the browser, or it can be a domain name transmitted by the application to the TCP/IP protocol stack when the user triggers an application to open. This application does not make specific restrictions on this.
  • the Wi-Fi driver can determine that the seventh message is a signaling message of the preset protocol based on the parsing result of the seventh message. Therefore, S804 will not be executed in practice.
  • the description of S804 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.
  • the Wi-Fi driver may send the seventh message to the DNS server using the IP address of the DNS server carried in the DHCP OFFER message previously provided by the DHCP server.
  • the DNS server may be pre-installed in a router that provides a Wi-Fi network, or may be a device connected to the router in a Wi-Fi local area network. If the DNS server and the router are different devices, the Wi-Fi chip may send the seventh message to the router, which then sends it to the DNS server.
  • the DNS server receives the seventh message from the mobile phone, determines the second IP address corresponding to the target domain name in the seventh message in response to the seventh message, and generates a DNS response message carrying the second IP address.
  • the DNS server will determine the second IP address corresponding to the target domain name in any feasible manner, such as obtaining the second IP address from the local cache of the DNS server.
  • the DNS server sends a DNS response message to the mobile phone.
  • the DNS server unicasts the DNS response message to the mobile phone.
  • the source IP address in the DNS request message is the IP address of the mobile phone.
  • the DNS server After obtaining the domain name resolution result (i.e., the second IP address), the DNS server sends a DNS response message carrying the domain name resolution result to the mobile phone based on the source IP address.
  • the Wi-Fi chip of the mobile phone receives the DNS response message from the router, and sends the DNS response message to the TCP/IP protocol stack through the Wi-Fi driver.
  • the TCP/IP protocol stack of the mobile phone stores the second IP address carried in the DNS response message.
  • the mobile phone After obtaining the second IP address corresponding to the target domain name, the mobile phone can use the second IP address as the destination address to access the Internet.
  • the mobile phone can place all signaling messages corresponding to the DNS in the VO queue for transmission. Since the VO queue is the queue with the strongest channel preemption capability for electronic devices in Wi-Fi scenarios, even in poor air interface conditions (i.e., interference or poor air interface signals), the signaling messages in the DNS data transmission process can be sent more reliably (this can be understood as a higher probability that the receiver will successfully receive the signaling message). This allows the mobile phone and the DNS server to successfully complete the DNS data transmission process. The mobile phone can then use the destination IP address corresponding to the web page or application that the user needs to log in to, obtained through this process, to proceed with the subsequent Internet access process and successfully access the Internet.
  • the ninth message is a signaling message
  • the signaling message may carry a message containing business data.
  • the signaling message may be regarded as a data message. Therefore, the ninth message is not a signaling message in the strict sense mentioned in this application and does not necessarily need to be placed in the VO queue to be sent.
  • the Wi-Fi driver of the mobile phone parses the ninth message and determines whether the ninth message is a signaling message of a preset protocol based on the parsing result.
  • the ninth message may be placed in a VO queue for sending, ie, S912 is executed.
  • the Wi-Fi driver of the mobile phone puts the ninth message into the VO queue.
  • the Wi-Fi driver of the mobile phone puts the ninth message into a transmission queue other than the VO queue.
  • the Wi-Fi driver of the mobile phone sends the ninth message to the TCP server through the Wi-Fi chip according to the preset queue message sending rule.
  • the mobile phone and the TCP server can be considered to have established a TCP connection, and the Wi-Fi chip of the mobile phone can send the ninth message to the TCP server according to the TCP protocol.
  • the mobile phone After the mobile phone sends the ninth message to the TCP server, it enters the ESTABLISHED state, which indicates that the client has received the SYN+ACK message (i.e., the TCP response message) sent by the server and sent an ACK message (i.e., the ninth message) as confirmation.
  • the connection between the client and the server has been successfully established, and both parties can begin data transmission.
  • the TCP server After receiving the ninth message from the mobile phone, the TCP server is also in the ESTABLISHED (connection established) state.
  • the first message, the second message, the third message, the fourth message, the fifth message, the sixth message, the seventh message, the eighth message, and the ninth message generated by the mobile phone may all be referred to as first protocol messages to be sent.
  • the router acting as an AP, the DHCP server, the router acting as a gateway, the DNS server, and the TCP server may be referred to as target devices.
  • the embodiment of the present application further provides a data transmission device, which can be applied to an electronic device in a Wi-Fi network.
  • the device can include a processing module and a sending module.
  • the processing module is used to add the first protocol message to the first priority transmission queue when the first protocol message to be sent is a signaling message; the processing module is also used to add the first protocol message to the second priority transmission queue when the first protocol message is not a signaling message of the preset protocol; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP; the sending module is used to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.
  • the cooperation between the processing module and the sending module can also enable the data transmission device to complete all the steps of the data transmission method provided in the aforementioned embodiment.
  • each module performs operations has been described in detail in the embodiment of the data transmission method in the above embodiment, and will not be further elaborated here.
  • the relevant beneficial effects thereof can also be referred to the relevant beneficial effects of the above data transmission method, and will not be repeated here.
  • An embodiment of the present application further provides an electronic device comprising: a display screen, a memory, and one or more processors; the display screen, the memory, and the processors being coupled; wherein the memory stores computer program code, the computer program code comprising computer instructions, which, when executed by the processor, causes the electronic device to execute the frame loss fault determination method provided in the aforementioned embodiment.
  • the specific structure of the electronic device can be referenced with reference to the electronic device structure shown in FIG3 .
  • the present application also provides an electronic device comprising a TCP/IP protocol stack, a Wi-Fi driver, and a Wi-Fi chip.
  • the Wi-Fi driver executes computer instructions
  • the electronic device executes the data transmission method provided in the aforementioned embodiment.
  • the TCP/IP protocol stack and the Wi-Fi driver may be software modules within an AP within a SOC within the electronic device.
  • An embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes the data transmission method provided in the aforementioned embodiment.
  • the present application also provides a chip system, as shown in FIG10 .
  • the chip system 1000 includes at least one processor 1001, a memory, and at least one interface circuit 1002.
  • the processor 1001 and the interface circuit 1002 can be interconnected via a line.
  • the interface circuit 1002 can be used to receive signals from another device (e.g., a target device).
  • the interface circuit 1002 can be used to send signals to another device (e.g., a target device).
  • the interface circuit 1002 can read instructions or computer programs stored in the memory and send the instructions or computer programs to the processor 1001.
  • the various steps of the data transmission method provided in the above embodiment can be implemented.
  • the chip system can also include other discrete components, which are not specifically limited in the embodiments of the present application.

Landscapes

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

Abstract

The present application relates to the technical field of communications, and provides a data transmission method, an electronic device, and a storage medium, in which an important signaling message can be reliably sent, so as to improve the experience of a user using an electronic device to access the Internet by means of a Wi-Fi network. The method comprises: when a first protocol message to be sent is a signaling message of a preset protocol, an electronic device adds the first protocol message to a first priority transmission queue; when the first protocol message is not a signaling message of the preset protocol, the electronic device adds the first protocol message to a second priority transmission queue, the second priority transmission queue being different from the first priority transmission queue, and the preset protocol comprising any one or more of the following items: EAPOL, DHCP, ARP, DNS, or TCP; and, according to a preset queue message sending rule, the electronic device sends the first protocol message to a target device by means of a Wi-Fi network, the preset queue message sending rule comprising the transmission priority of the first priority transmission queue being higher than the transmission priority of the second priority transmission queue.

Description

一种数据传输方法和装置、电子设备和存储介质Data transmission method and device, electronic device and storage medium

本申请要求于2024年2月9日提交到国家知识产权局、申请号为2024101790006、发明名称为“一种数据传输方法和装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 9, 2024, with application number 2024101790006 and invention name “A data transmission method and device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application.

技术领域Technical Field

申请涉及终端技术领域,尤其涉及一种数据传输方法和装置、电子设备和存储介质。The application relates to the field of terminal technology, and in particular to a data transmission method and device, electronic equipment and storage medium.

背景技术Background Art

随着信息技术以及智能终端的快速发展,无线保真(Wireless Fidelity,Wi-Fi)应用在人们的日常生活中已经越来越普及。Wi-Fi应用场景主要由提供Wi-Fi服务的AP(WirelessAccessPoint,无线访问接入点)以及各种支持Wi-Fi的电子设备组成。目前,AP可以支持2.4G频段和5G频段。而由于2.4G频段是公共、免费的频段,因此工作在2.4G频段的AP与AP之间容易产生信号干扰,从而使得电子设备和AP之间的空口(即Wi-Fi空口)信号被干扰,降低用户的上网体验。而对于工作在5G频段的AP而言,由于5G频段的电磁波穿透障碍物的能力较弱,一旦AP与电子设备之间存在障碍物,也会使得电子设备和AP之间的空口信号变差,降低用户的上网体验。With the rapid development of information technology and smart terminals, Wireless Fidelity (Wi-Fi) applications have become increasingly popular in people's daily lives. Wi-Fi application scenarios mainly consist of APs (Wireless Access Points) that provide Wi-Fi services and various electronic devices that support Wi-Fi. Currently, APs can support 2.4G and 5G bands. However, since the 2.4G band is a public and free band, signal interference is likely to occur between APs operating in the 2.4G band, causing interference to the air interface (i.e., Wi-Fi air interface) signal between electronic devices and APs, reducing the user's Internet experience. For APs operating in the 5G band, since the electromagnetic waves in the 5G band have a weak ability to penetrate obstacles, once there is an obstacle between the AP and the electronic device, the air interface signal between the electronic device and the AP will also deteriorate, reducing the user's Internet experience.

综上,目前用户在使用电子设备通过Wi-Fi上网时,会因为空口信号受到干扰或者空口信号较差,使得用户的上网体验不好。In summary, currently when users use electronic devices to access the Internet via Wi-Fi, the air interface signal may be interfered with or the air interface signal is poor, resulting in a poor Internet experience for the users.

发明内容Summary of the Invention

本申请实施例提供一种数据传输方法和装置、电子设备和存储介质,能够提高用户使用电子设备通过Wi-Fi网络上网的体验。The embodiments of the present application provide a data transmission method and apparatus, an electronic device, and a storage medium, which can improve the user experience of using an electronic device to access the Internet through a Wi-Fi network.

为了达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

第一方面,本申请实施例提供一种数据传输方法。该方法包括:电子设备在待发送的第一协议报文为预设协议的信令报文的情况下,将第一协议报文加入第一优先级传输队列中;电子设备在第一协议报文不为预设协议的信令报文的情况下,将第一协议报文加入第二优先级传输队列;第二优先级传输队列与第一优先级传输队列不同;预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP;电子设备按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送第一协议报文;预设队列报文发送规则包括第一优先级传输队列的传输优先级高于第二优先级传输队列的传输优先级。In a first aspect, an embodiment of the present application provides a data transmission method. The method includes: when a first protocol message to be sent is a signaling message of a preset protocol, the electronic device adds the first protocol message to a first priority transmission queue; when the first protocol message is not a signaling message of the preset protocol, the electronic device adds the first protocol message to a second priority transmission queue; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS, or TCP; the electronic device sends the first protocol message to a target device via a Wi-Fi network according to a preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.

基于上述实施例提供的技术方案,电子设备在发送协议报文时,可以将与用户上网密切相关的预设协议的信令报文放在传输优先级高的第一优先级传输队列如VO队列中。在Wi-Fi场景下,传输优先级高的队列中的报文抢占信道能力更强,传输成功率更高。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),放在第一优先级传输队列中的预设协议的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功接收到该信令报文的概率更高),避免了预设协议的信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户通过Wi-Fi网络上网的体验。Based on the technical solution provided by the above embodiment, when sending a protocol message, the electronic device can place the signaling message of the preset protocol that is closely related to the user's Internet access in a first priority transmission queue with a high transmission priority, such as a VO queue. In the Wi-Fi scenario, the message in the queue with a high transmission priority has a stronger channel seizure capability and a higher transmission success rate. In this way, even if the air interface environment is not good enough (that is, the air interface signal is interfered with or the air interface signal is poor), the signaling message of the preset protocol placed in the first priority transmission queue can be sent out more reliably (it can be understood that the probability of the recipient successfully receiving the signaling message is higher), avoiding the signaling message of the preset protocol from being successfully sent due to the air interface environment not being good enough (it can be understood that the recipient failed to successfully receive the signaling message), resulting in the user using the electronic device to access the Internet through the Wi-Fi network. Connection jams, delays or failures, ensuring the user's experience of accessing the Internet through the Wi-Fi network.

在第一方面的一种可能的设计方式中,电子设备包括Wi-Fi驱动;电子设备在待发送的第一协议报文为预设协议的信令报文的情况下,将第一协议报文加入第一优先级传输队列中,包括:Wi-Fi驱动对第一协议报文进行解析,并在基于解析结果确定第一协议报文为预设协议的信令报文的情况下,将第一协议报文加入第一优先级传输队列中。In a possible design of the first aspect, the electronic device includes a Wi-Fi driver. When a first protocol message to be sent is a signaling message of a preset protocol, the electronic device adds the first protocol message to a first priority transmission queue, including: the Wi-Fi driver parses the first protocol message, and when determining, based on a parsing result, that the first protocol message is a signaling message of the preset protocol, adds the first protocol message to the first priority transmission queue.

基于上述设计方式,电子设备便可以使用Wi-Fi驱动对需要发送的第一协议报文进行识别,从而判断第一协议报文是否为信令报文。在确定第一协议报文为信令报文的情况下,便可以将第一协议报文放入至抢占信道能力最强的第一优先级传输队列中,从而保证信令报文的可靠发送,保障用户使用电子设备在Wi-Fi网络中上网的使用体验。Based on the above design, the electronic device can use the Wi-Fi driver to identify the first protocol message to be sent, thereby determining whether the first protocol message is a signaling message. If the first protocol message is determined to be a signaling message, the first protocol message can be placed in the first priority transmission queue with the strongest channel preemption capability, thereby ensuring the reliable transmission of the signaling message and protecting the user's experience of surfing the Internet on the Wi-Fi network using the electronic device.

在第一方面的一种可能的设计方式中,所述预设协议的信令报文包括以下至少一项:可扩展的局域网认证协议EAPOL四次握手过程中的第二次握手报文、EAPOL四次握手过程中的第四次握手报文、动态主机配置协议DHCP DISCOVER报文、DHCP REQUEST报文、地址解析协议ARP请求报文、域名系统DNS请求报文、传输控制协议TCP三次握手过程中的第一次TCP握手报文、TCP三次握手过程中未携带业务数据的第三次TCP握手报文;In a possible design manner of the first aspect, the signaling message of the preset protocol includes at least one of the following: a second handshake message in a four-way handshake process of the Extensible Authentication Protocol for Local Area Networks (EAPOL), a fourth handshake message in a four-way handshake process of the EAPOL, a Dynamic Host Configuration Protocol (DHCP) DISCOVER message, a DHCP REQUEST message, an Address Resolution Protocol (ARP) request message, a Domain Name System (DNS) request message, a first TCP handshake message in a three-way handshake process of the Transmission Control Protocol (TCP), and a third TCP handshake message that does not carry service data in the three-way handshake process of the TCP.

其中,所述ARP请求报文用于请求网关的物理地址MAC;所述DNS请求报文用于请求目标域名对应的互联网协议地址IP;所述第一次TCP握手报文用于请求建立TCP连接。The ARP request message is used to request the physical address MAC of the gateway; the DNS request message is used to request the Internet Protocol address IP corresponding to the target domain name; and the first TCP handshake message is used to request the establishment of a TCP connection.

由于上述信令报文均为与用户上网体验强相关的预设协议的信令报文,在手机发送上述信令报文后,如果接收方未能接收到,则不能及时的确定这类报文的缺失,从而使得用户使用电子设备无法正常上网。基于此,对于这类信令报文,需要放在抢占信道能力最强的第一优先级传输队列中,这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),信令报文也可以更为可靠的被发送出去(可以理解为接收方可以更大概率的接收到该信令报文),避免了信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户通过Wi-Fi网络上网的体验。Since the above-mentioned signaling messages are all signaling messages of preset protocols that are strongly related to the user's Internet experience, after the mobile phone sends the above-mentioned signaling messages, if the recipient fails to receive them, it is impossible to determine the absence of such messages in a timely manner, thereby making it impossible for the user to use the electronic device to surf the Internet normally. Based on this, for such signaling messages, it is necessary to put them in the first priority transmission queue with the strongest channel seizure capability. In this way, even if the air interface environment is not good enough (that is, the air interface signal is interfered with or the air interface signal is poor), the signaling message can be sent out more reliably (it can be understood that the recipient can receive the signaling message with a greater probability), avoiding the signaling message from being successfully sent due to the air interface environment not being good enough (it can be understood that the recipient failed to successfully receive the signaling message), resulting in the user experiencing connection jams, delays or failures when using the electronic device to surf the Internet through the Wi-Fi network, thereby ensuring the user's experience of surfing the Internet through the Wi-Fi network.

在第一方面的一种可能的设计方式中,第一优先级传输队列包括语音优化VO队列;第一优先级传输队列抢占信道的能力大于第一优先级传输队列以外的传输队列。In a possible design of the first aspect, the first priority transmission queue includes a voice-optimized VO queue; and the ability of the first priority transmission queue to seize a channel is greater than that of transmission queues other than the first priority transmission queue.

基于上述设计方式,由于第一优先级传输队列为抢占信道能力最强的VO队列,所以可以更可靠发送信令报文,从而可以更好的保障电子设备通过Wi-Fi网络上网,保证了用户的上网体验。Based on the above design, since the first-priority transmission queue is the VO queue with the strongest channel preemption capability, signaling messages can be sent more reliably, thereby better ensuring that electronic devices can access the Internet through the Wi-Fi network and guaranteeing the user's Internet experience.

在第一方面的一种可能的设计方式中,第一优先级传输队列以外的传输队列包括:视频优化VI队列、尽力而为BE队列、背景优化BK队列。In a possible design manner of the first aspect, the transmission queues other than the first priority transmission queue include: a video optimization VI queue, a best effort BE queue, and a background optimization BK queue.

基于上述设计方式,可以使得预设协议中的信令报文以外的协议报文可以在抢占信道能力不是最强的队列中被发送,从而使得预设协议的信令报文可以及时放入抢占信道能力最强的VO队列中被传输,从而可以更好的保障电子设备通过Wi-Fi网络上网,保证了用户的上网体验。Based on the above design, protocol messages other than signaling messages in the preset protocol can be sent in a queue that does not have the strongest channel seizure capability, so that the signaling messages of the preset protocol can be promptly placed in the VO queue with the strongest channel seizure capability for transmission, thereby better ensuring that electronic devices can access the Internet through the Wi-Fi network and guaranteeing the user's Internet experience.

在第一方面的一种可能的实现方式中,在第一协议报文不为预设协议的信令报文的情况下,第一协议报文包括:TCP三次握手过程中携带了业务数据的第三次TCP握手报文。In a possible implementation manner of the first aspect, when the first protocol message is not a signaling message of a preset protocol, the first protocol message includes: a third TCP handshake message carrying service data in a TCP three-way handshake process.

基于上述设计方式,在第三次TCP握手报文携带有业务数据时,第三次TCP握手报文中是可以携带有多个数据报文的。也就是说,TCP服务器接收该第三次TCP握手报文后,即便其中缺少了内容,TCP服务器也可以根据收到的多个报文的序列号及时确定缺少了哪些序列号的数据,并及时告知手机重新发送。所以在第三次TCP握手报文携带有业务数据这种情况下,其不能被简单地视为是信令报文了,故可以将其不视为预设协议的信令报文,且即使其传输出问题,对端设备也能及时发现并告知手机重新发送缺失的数据,故不需要对其传输采用预设协议的信令报文的传输优先级来优先保障。从而使得真正对Wi-Fi网络上网体验影响较大的预设协议的信令报文可以被及时放入抢占信道能力最强的VO队列来传输,从而可以更好的保障电子设备通过Wi-Fi网络上网,保证了用户的上网体验。Based on the above design, when the third TCP handshake message carries service data, it can contain multiple data packets. That is, after receiving the third TCP handshake message, even if it contains missing data, the TCP server can promptly determine which sequence numbers are missing based on the sequence numbers of the received messages and promptly notify the mobile phone to resend the data. Therefore, when the third TCP handshake message carries service data, it cannot be simply considered a signaling message and can be treated as a signaling message for the default protocol. Even if a transmission issue occurs, the peer device can promptly detect the issue and notify the mobile phone to resend the missing data, eliminating the need to prioritize its transmission using the default protocol's signaling message transmission priority. This allows signaling messages for the default protocol that significantly impact the Wi-Fi network experience to be promptly routed to the VO queue with the strongest channel preemption capability for transmission, thereby better ensuring Wi-Fi access for electronic devices and guaranteeing a secure user experience.

在第一方面的一种可能的实现方式中,电子设备包括TCP/IP协议栈和Wi-Fi芯片;第一协议报文为TCP/IP协议栈生成的报文;电子设备按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送第一协议报文,包括:电子设备按照预设队列报文发送规则,控制Wi-Fi芯片通过Wi-Fi网络向目标设备发送第一协议报文。In a possible implementation of the first aspect, the electronic device includes a TCP/IP protocol stack and a Wi-Fi chip; the first protocol message is a message generated by the TCP/IP protocol stack; and the electronic device sends the first protocol message to a target device through a Wi-Fi network according to a preset queue message sending rule, including: the electronic device controls the Wi-Fi chip to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule.

基于上述设计方式,通过TCP/IP协议栈和Wi-Fi芯片的配合,电子设备便可以顺利将第一协议报文发送给目标设备。Based on the above design, through the cooperation of the TCP/IP protocol stack and the Wi-Fi chip, the electronic device can successfully send the first protocol message to the target device.

第二方面,本申请实施例还提供一种数据传输装置,该装置可以应用于电子设备。该装置的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块,例如,处理模块和发送模块。In a second aspect, embodiments of the present application further provide a data transmission device that can be applied to an electronic device. The functions of the device can be implemented in hardware or by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions, such as a processing module and a sending module.

其中,处理模块,用于在待发送的第一协议报文为信令报文的情况下,将第一协议报文加入第一优先级传输队列中;处理模块还用于在第一协议报文不为预设协议的信令报文的情况下,将第一协议报文加入第二优先级传输队列;第二优先级传输队列与第一优先级传输队列不同;预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP;发送模块,用于按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送第一协议报文;预设队列报文发送规则包括第一优先级传输队列的传输优先级高于第二优先级传输队列的传输优先级。Among them, the processing module is used to add the first protocol message to the first priority transmission queue when the first protocol message to be sent is a signaling message; the processing module is also used to add the first protocol message to the second priority transmission queue when the first protocol message is not a signaling message of the preset protocol; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP; the sending module is used to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.

第三方面,本申请提供一种电子设备,该电子设备包括显示屏、存储器和一个或多个处理器;显示屏、存储器与处理器耦合;其中,存储器中存储有计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被处理器执行时,使得电子设备执行如第一方面及其任一种可能的设计方式提供的数据传输方法。In a third aspect, the present application provides an electronic device comprising a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; wherein the memory stores computer program code, and the computer program code comprises computer instructions, which, when executed by the processor, enable the electronic device to execute the data transmission method provided in the first aspect and any possible design thereof.

第四方面,本申请提供一种电子设备,包括TCP/IP协议栈、Wi-Fi驱动和Wi-Fi芯片;Wi-Fi驱动执行计算机指令时,使得述电子设备执行如第一方面及其任一种设计方式提供的数据传输方法。In a fourth aspect, the present application provides an electronic device, including a TCP/IP protocol stack, a Wi-Fi driver, and a Wi-Fi chip; when the Wi-Fi driver executes computer instructions, the electronic device executes the data transmission method provided in the first aspect and any one of its design methods.

第五方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在电子设备上运行时,使得电子设备执行如第一方面及其任一种可能的设计方式提供的数据传输方法。In a fifth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the data transmission method provided in the first aspect and any possible design thereof.

第六方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面及其任一种可能的设计方式提供的数据传输方法。In a sixth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the data transmission method provided in the first aspect and any possible design thereof.

第七方面,本申请提供一种芯片系统,该芯片系统包括处理器,所述处理器可以包括AP,AP包括W-iFi驱动和TCP/IP协议栈。所述处理器可以是SoC(system on chip,片上系统)。所述芯片系统还可以包括W-iFi芯片。该处理器执行计算机指令时(如,处理器中的Wi-Fi驱动或W-iFi芯片执行计算机指令时),使得芯片系统所属的电子设备执行如第一方面及其任一种设计方式提供的数据传输方法。In a seventh aspect, the present application provides a chip system, which includes a processor, the processor may include an AP, and the AP includes a Wi-Fi driver and a TCP/IP protocol stack. The processor may be a SoC (system on chip). The chip system may also include a Wi-Fi chip. When the processor executes a computer instruction (e.g., when the Wi-Fi driver or Wi-Fi chip in the processor executes a computer instruction), the electronic device to which the chip system belongs executes the data transmission method provided in the first aspect and any one of its design methods.

可以理解地,上述提供的第二方面至第五方面提供的技术方案所能达到的有益效果,可参考第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the second to fifth aspects mentioned above can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的ARP交互过程的示意图;FIG1 is a schematic diagram of an ARP interaction process provided in an embodiment of the present application;

图2为本申请实施例提供提供的一种数据传输方法的原理示意图;FIG2 is a schematic diagram showing the principle of a data transmission method provided in an embodiment of the present application;

图3为本申请实施例提供的一种电子设备的硬件结构示意图;FIG3 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

图4为本申请实施例提供的一种电子设备的软件架构示意图;FIG4 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;

图5为本申请实施例提供的一种数据传输方法的流程示意图一;FIG5 is a flowchart of a data transmission method according to an embodiment of the present application;

图6为本申请实施例提供的一种数据传输方法的流程示意图二;FIG6 is a second flow chart of a data transmission method provided in an embodiment of the present application;

图7为本申请实施例提供的一种数据传输方法的流程示意图三;FIG7 is a third flow chart of a data transmission method provided in an embodiment of the present application;

图8为本申请实施例提供的一种数据传输方法的流程示意图四;FIG8 is a fourth flow chart of a data transmission method provided in an embodiment of the present application;

图9为本申请实施例提供的一种数据传输方法的流程示意图五;FIG9 is a fifth flow chart of a data transmission method provided in an embodiment of the present application;

图10为本申请实施例提供的一种芯片系统的结构示意图;FIG10 is a schematic structural diagram of a chip system provided in an embodiment of the present application;

图11为本申请实施例提供的另一种芯片系统的结构示意图。FIG11 is a schematic structural diagram of another chip system provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

具体内容本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。Specific content The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that "/" means or, for example, A/B can mean A or B; "and/or" in the text is merely a description of an association relationship of associated objects, indicating that three relationships can exist, for example, A and/or B can mean: the existence of A alone, the existence of A and B at the same time, and the existence of B alone.

在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

本申请以下实施例中的术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first" and "second" in the following embodiments of this application are used for descriptive purposes only and should not be understood as implying or suggesting relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

首先,对本申请实施例中涉及名词进行如下说明:First, the nouns involved in the embodiments of this application are explained as follows:

频段:在通讯领域中,频段指的是电磁波的频率范围。Frequency band: In the field of communications, frequency band refers to the frequency range of electromagnetic waves.

信道:具体指信号在通信系统中传输的通道,由信号从发射端传输到接收端所经过的传输媒介所构成。Wi-Fi常用的每一个频段被划分了多个信道。Channel: Specifically refers to the path through which signals are transmitted in a communication system. It consists of the transmission medium through which signals travel from the transmitter to the receiver. Each commonly used Wi-Fi frequency band is divided into multiple channels.

例如,Wi-Fi使用的2.4GHZ频段划分的信道和中心频率如下表1所示。For example, the channels and center frequencies of the 2.4 GHz frequency band used by Wi-Fi are shown in Table 1 below.

表1

Table 1

如表1所示,2.4GHz频段可以被划分为14个信道,每个信道的有效宽度是20兆赫兹(MHz)。其中,信道14一般不会被使用。无论是802.11b/g标准,还是802.11a/b/g/n/ac标准,一般都支持信道1至信道13这13个信道。换言之,上述Wi-Fi支持的各个信道可以包括信道1至信道13这13个信道。As shown in Table 1, the 2.4 GHz frequency band can be divided into 14 channels, each with an effective bandwidth of 20 MHz. Channel 14 is generally not used. Both 802.11b/g and 802.11a/b/g/n/ac standards generally support channels 1 through 13. In other words, the channels supported by Wi-Fi mentioned above may include all 13 channels.

又例如,Wi-Fi使用的5GHZ频段划分的部分信道和中心频率如下表2所示。For example, some channels and center frequencies of the 5 GHz frequency band used by Wi-Fi are shown in Table 2 below.

表2
Table 2

可扩展的局域网认证协议(extensible authentication protocol over local area network,EAPOL):EAPOL是802.1x协议定义的一种报文封装格式,主要用于在客户端(例如手机等电子设备)和设备端(例如无线路由器)之间传送EAP协议报文,以允许EAP协议报文在LAN上传送。在实际应用中,EAPOL可以对用户进行身份验证,并建立一个共享数据,从中派生出未来的加密密钥。在电子设备与无线路由器之间通过EAPOL完成身份认证后,电子设备便可以使用该加密密钥与作为AP的路由器之间发送消息。Extensible Authentication Protocol over Local Area Network (EAPOL): EAPOL is a message encapsulation format defined by the 802.1x protocol. It is primarily used to transmit EAP protocol messages between clients (such as mobile phones and other electronic devices) and devices (such as wireless routers), allowing EAP protocol messages to be transmitted on a LAN. In practical applications, EAPOL can authenticate users and establish shared data from which future encryption keys are derived. After completing identity authentication between an electronic device and a wireless router using EAPOL, the electronic device can use the encryption key to send messages to the router as an access point.

动态主机配置协议(dynamic host configuration protocol,DHCP):DHCP是RFC 1541(已被RFC 2131取代)定义的标准协议,该协议允许DHCP服务器向客户端(例如手机等电子设备)动态分配网络互连协议(internet protocol,IP)地址、子网掩码、网关等网络配置信息。DHCP通常被应用在大型的局域网络环境中,主要作用是集中地管理、分配IP地址,能够提升地址的使用率。Dynamic Host Configuration Protocol (DHCP): DHCP is a standard protocol defined in RFC 1541 (superseded by RFC 2131). It allows a DHCP server to dynamically assign network configuration information, such as Internet Protocol (IP) addresses, subnet masks, and gateway addresses, to clients (e.g., mobile phones and other electronic devices). DHCP is typically used in large local area networks, primarily to centrally manage and allocate IP addresses, thereby increasing address utilization.

在Wi-Fi场景下,当手机等电子设备连接到Wi-Fi网络并通过DHCP交互获取IP地址时,DHCP服务器(通常是路由器或路由器外接的网络设备)会为手机分配一个可用的IP地址,并同时提供网关的IP地址。一般情况下,在Wi-Fi场景下,网关就是连接到Wi-Fi网络的路由器。路由器作为网络的边界设备,负责将来自内部网络的报文转发到外部网络,同时也将来自外部网络的报文转发到内部网络。手机获取到的网关IP地址就是指向路由器的IP地址,通过将报文发送到网关,路由器可以进行网络地址转换(network address translation,NAT)、路由选择等操作,从而实现手机与外部网络的通信。In a Wi-Fi scenario, when an electronic device such as a mobile phone is connected to a Wi-Fi network and obtains an IP address through DHCP interaction, the DHCP server (usually a router or a network device connected to the router) will assign an available IP address to the mobile phone and provide the IP address of the gateway at the same time. Generally speaking, in a Wi-Fi scenario, the gateway is a router connected to a Wi-Fi network. As a network boundary device, the router is responsible for forwarding messages from the internal network to the external network, and also forwarding messages from the external network to the internal network. The gateway IP address obtained by the mobile phone is the IP address pointing to the router. By sending the message to the gateway, the router can perform network address translation (NAT), routing selection and other operations, thereby realizing communication between the mobile phone and the external network.

地址解析协议(address resolution protocol,ARP):ARP是根据IP地址获取物理地址(media access control address,MAC)的一个TCP/IP协议。由于IP地址是逻辑上的标识,任何人都可以随意修改,所谓为了保证安全,在局域网中,是要采用MAC地址来标识具体设备的。而在网络通信过程中,手机等电子设备首先是通过DHCP协议获取到自身的IP地址,和所属局域网的网关的IP地址的。此时就需要利用ARP将网关的IP地址转换为网关的MAC地址。这样一来,电子设备才可以准确的将数据发送给网关,进而使得网关将数据转发给互联网上的其他设备。Address Resolution Protocol (ARP): ARP is a TCP/IP protocol that obtains a physical address (media access control address, MAC) based on an IP address. Since the IP address is a logical identifier and can be modified at will by anyone, in order to ensure security, MAC addresses are used to identify specific devices in a local area network. In the process of network communication, electronic devices such as mobile phones first obtain their own IP addresses and the IP address of the gateway of the local area network to which they belong through the DHCP protocol. At this time, ARP is needed to convert the IP address of the gateway into the MAC address of the gateway. In this way, electronic devices can accurately send data to the gateway, and the gateway can then forward the data to other devices on the Internet.

在Wi-Fi场景下,当手机等电子设备连接到Wi-Fi场景并通过DHCP获取到自身的IP地址以及网关(一般为路由器或者与路由器连接的光猫等设备)的IP地址后,电子设备便可以在Wi-Fi局域网的广播域中发送ARP请求报文。该ARP请求报文中包含了目标IP地址(即网关的IP)和电子设备的IP地址,以及一个空的MAC地址字段。Wi-Fi局域网中的其他设备会收到这个ARP请求包,并检查自己的IP地址是否与ARP请求报文中的目标IP地址匹配。如果匹配,该设备会将自己的MAC地址回复给发送者。这样,电子设备就可以将IP地址转换为对应的MAC地址,从而实现网络通信。In a Wi-Fi scenario, when a mobile phone or other electronic device is connected to the Wi-Fi scene and obtains its own IP address and the IP address of the gateway (usually a router or an optical modem connected to the router) through DHCP, the electronic device can send an ARP request message in the broadcast domain of the Wi-Fi local area network. The ARP request message contains the target IP address (i.e. the IP of the gateway) and the IP address of the electronic device, as well as an empty MAC address field. Other devices in the Wi-Fi local area network will receive this ARP request packet and check whether their IP address matches the target IP address in the ARP request message. If it matches, the device will reply its MAC address to the sender. In this way, the electronic device can convert the IP address into the corresponding MAC address, thereby achieving network communication.

示例性的,参照图1所示,若局域网中存在四个设备:主机A、主机B、主机C和主机D。其中,主机A的IP地址为192.168.1.1,主机B的IP地址为192.168.1.2,主机C的IP地址为192.168.1.3,主机D的IP地址为192.168.1.4。若主机A为用户使用的电子设备,则主机A在获取到网关的IP地址为192.168.1.3的情况下,主机A会在广播域中广播ARP请求报文。该ARP请求报文则用于请求IP地址(具体为目标IP地址)为192.168.1.3的MAC地址。之后,主机B、主机C和主机D均会接收到该ARP请求报文,并识别该ARP请求报文中的目标IP地址与自身的IP地址是否相同或匹配。其中,主机B和主机D在确定该ARP请求报文中的目标IP地址与自身的IP地址不相同或不匹配时,则会丢弃该ARP请求报文。而主机C则在确定该ARP请求报文中的目标IP地址与自身的IP地址相同或匹配时,则会将自身的MAC地址返回给主机A。主机A则会将接收到的MAC地址与网关的ID地址关联并存储在ARP表项中。之后,主机A则会使用该MAC地址发送报文。For example, as shown in Figure 1, if there are four devices in the local area network: host A, host B, host C and host D. Among them, the IP address of host A is 192.168.1.1, the IP address of host B is 192.168.1.2, the IP address of host C is 192.168.1.3, and the IP address of host D is 192.168.1.4. If host A is an electronic device used by the user, then when host A obtains the gateway IP address of 192.168.1.3, host A will broadcast an ARP request message in the broadcast domain. The ARP request message is used to request the MAC address of the IP address (specifically the target IP address) of 192.168.1.3. Afterwards, host B, host C and host D will all receive the ARP request message and identify whether the target IP address in the ARP request message is the same as or matches their own IP address. If Host B and Host D determine that the target IP address in the ARP request message is different from or does not match their own IP address, they will discard the ARP request message. If Host C determines that the target IP address in the ARP request message is the same as or matches its own IP address, it will return its MAC address to Host A. Host A will associate the received MAC address with the gateway's ID address and store it in the ARP table entry. Host A will then use this MAC address to send messages.

在正常情况下,在经过上述过程后,电子设备中将网关的IP地址与MAC地址的映射关系存储在ARP表项中,以便在需要时进行快速查找。示例性的,ARP表项的实例如下:

Under normal circumstances, after the above process, the electronic device stores the mapping relationship between the gateway's IP address and MAC address in the ARP table entry so that it can be quickly searched when needed. For example, an example of an ARP table entry is as follows:

其中,IP address为ip地址;HW type为硬件类型;Flags为标志位(用于标识该条ARP记录的属性);HW address为硬件地址即MAC地址;Mask为子网掩码;Device为设备标识。Among them, IP address is the IP address; HW type is the hardware type; Flags is the flag bit (used to identify the attributes of the ARP record); HW address is the hardware address, that is, the MAC address; Mask is the subnet mask; Device is the device identifier.

然而,由于网络拓扑的变化或设备的更换,IP地址与MAC地址的映射关系可能会发生变化,有些映射关系就会失效,这个过程就是ARP老化。为了保持ARP表的准确性,电子设备会定期检查ARP表中的条目(即映射关系),并将过时的条目从表中删除。当ARP表中的条目过时的情况下,电子设备需要重新在广播域中发送ARP请求来获取最新的MAC地址。ARP老化的时间通常由电子设备的配置参数决定,可以根据网络的需求进行调整。However, due to changes in network topology or device replacement, the mapping relationship between IP addresses and MAC addresses may change, and some mapping relationships will become invalid. This process is called ARP aging. In order to maintain the accuracy of the ARP table, electronic devices will regularly check the entries in the ARP table (i.e., mapping relationships) and delete outdated entries from the table. When an entry in the ARP table is outdated, the electronic device needs to resend the ARP request in the broadcast domain to obtain the latest MAC address. The ARP aging time is usually determined by the configuration parameters of the electronic device and can be adjusted according to the needs of the network.

域名系统(domain name system,DNS):DNS是互联网的一项服务,它作为将域名和IP地址相互映射的一个分布式数据库,能够使人更方便地访问互联网。DNS(Domain Name System)提供了一个将易于记忆的域名转换为IP地址的服务。通过DNS,电子设备可以将应用程序对应的应用服务器的主机名(例如www.example.com)转换为相应的IP地址(例如192.0.2.1)。此外,用户在浏览器中输入一个域名时,电子设备也可以通过DNS需要将其转换为对应的IP地址后完成相应的通信。Domain Name System (DNS): DNS is an internet service that acts as a distributed database that maps domain names to IP addresses, making internet access more convenient. DNS (Domain Name System) provides a service that converts easy-to-remember domain names into IP addresses. Through DNS, electronic devices can convert the host name of an application server (e.g., www.example.com) to the corresponding IP address (e.g., 192.0.2.1). Furthermore, when a user enters a domain name in a browser, the electronic device can also use DNS to convert it into the corresponding IP address to complete the corresponding communication.

传输控制协议(transmission control protocol,TCP):TCP是一种面向连接的、可靠的、基于字节流的传输层通信协议。TCP在因特网协议族(TCP/IP协议族)中担任主要的传输协议,为许多应用程序(如Web浏览器和电子邮件客户端)提供可靠的数据传输服务。TCP的主要作用是在网络中提供可靠的、面向连接的通信。它确保数据在传输过程中不会丢失、重复或乱序,同时提供拥塞控制机制,以避免网络拥塞。在用户开始使用电子设备上的某个需要联网的应用时,电子设备会与该应用所属的应用服务器建立TCP连接,从而可以顺利依据用户需求与该应用服务器产生数据交互,从而展示相应的内容给用户查看。Transmission Control Protocol (TCP): TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP serves as the primary transmission protocol in the Internet Protocol Suite (TCP/IP protocol suite), providing reliable data transmission services for many applications (such as web browsers and email clients). The main function of TCP is to provide reliable, connection-oriented communication in the network. It ensures that data is not lost, duplicated, or out of order during transmission, and provides congestion control mechanisms to avoid network congestion. When a user starts using an application on an electronic device that requires an Internet connection, the electronic device will establish a TCP connection with the application server to which the application belongs, so that it can smoothly interact with the application server according to user needs, thereby displaying the corresponding content for the user to view.

队列:IEEE 802.11e为基于802.11协议的无线局域网(wireless local area network,WLAN)体系添加了服务质量(quality of service,QoS)功能。这个协议的标准化时间很长,在这个过程中,Wi-Fi组织为了满足不同WLAN厂商对QoS的需求,定义了Wi-Fi多媒体(Wi-Fi multimedia,WMM)协议。WMM协议用于保证优先发送高优先级的报文,从而保证语音、视频等应用在无线网络中有更好的服务质量。Queuing: IEEE 802.11e adds quality of service (QoS) functionality to wireless local area networks (WLANs) based on the 802.11 protocol. The standardization of this protocol took a long time. During this process, the Wi-Fi organization defined the Wi-Fi Multimedia (WMM) protocol to meet the QoS requirements of different WLAN vendors. WMM ensures that high-priority packets are sent first, thereby ensuring better quality of service for applications such as voice and video on wireless networks.

WMM定义了四种不同优先级的传输队列,这些传输队列按优先级从高到低的顺序分为语音队列(voice optimized queue,VO)、视频队列(video optimized queue,VI)、尽力而为队列(best effort queue,BE)、背景队列(background optimized queue,BK)。VO队列主要用于语音数据,以低延迟为主要目标;VI队列专注于视频数据,旨在保证视频流的流畅性;BE队列满足尽力而为的业务需求,不保证严格的QoS;BK队列则针对后台应用,对延迟和丢失有一定的容忍度。WMM defines four transmission queues with different priorities: voice optimized queue (VO), video optimized queue (VI), best effort queue (BE), and background optimized queue (BK). The VO queue is primarily used for voice data, with low latency as its primary goal; the VI queue focuses on video data, aiming to ensure smooth video streaming; the BE queue meets best-effort service requirements without strict QoS guarantees; and the BK queue targets background applications, with a certain tolerance for delay and loss.

VO、VI、BE和BK四个传输队队列中,传输优先级越高的传输队列中的报文(或称为为报文)抢占信道的能力越强。WMM协议定义了一套增强的分布式信道访问(enhanced distributed channel access,EDCA)参数,可以区分高传输优先级报文(即高优先级队列中的报文)并保证高传输优先级报文优先占用信道资源,以满足不同的业务需求。目前,EDCA参数主要包括有仲裁帧间间隔(arbitration interframe space,AIFS)参数、随机回退(backoff)参数以及传输机会限制(transmission opportunity Limit,TXOP limit)。Among the four transmission queues (VO, VI, BE, and BK), packets in queues with higher transmission priorities have a stronger ability to seize the channel. The WMM protocol defines a set of enhanced distributed channel access (EDCA) parameters that distinguish high-priority packets (i.e., packets in high-priority queues) and ensure that they receive priority in channel resources to meet diverse service requirements. Currently, EDCA parameters primarily include the arbitration interframe space (AIFS), random backoff, and transmission opportunity limit (TXOP limit).

AIFS定义了每个优先级报文在竞争介质上开始发送之前需要等待的时间,即AIFS包含了一个优先级相关的定时器。较高传输优先级的报文可以配置更短的AIFS,这样它们可以更早地参与竞争,从而提高了其在竞争介质(即信道)上获得发送机会的概率,这也有助于满足对实时性较高的应用的要求。也就是说,传输优先级越高的传输队列,其AIFS参数的时间越短,使得传输优先级越高的传输队列竞争上信道的概率越高。具体的,AIFS参数由小到大的传输队列依次为VO、VI、BE和BK。例如,VO队列的AIFS参数可以为24us,VI队列的AIFS参数可以为34us,BE队列的AIFS参数可以为43us,BK队列的AIFS参数可以为79us。AIFS defines the time each priority message needs to wait before starting to send on the contention medium, that is, AIFS includes a priority-related timer. Messages with higher transmission priorities can be configured with a shorter AIFS so that they can participate in the competition earlier, thereby increasing their probability of obtaining a transmission opportunity on the contention medium (i.e., channel), which also helps meet the requirements of applications with higher real-time performance. In other words, the higher the transmission priority of the transmission queue, the shorter the AIFS parameter time, so that the higher the transmission priority of the transmission queue, the higher the probability of competing for the channel. Specifically, the transmission queues with AIFS parameters from small to large are VO, VI, BE, and BK. For example, the AIFS parameter of the VO queue can be 24us, the AIFS parameter of the VI queue can be 34us, the AIFS parameter of the BE queue can be 43us, and the AIFS parameter of the BK queue can be 79us.

随机回退(backoff)参数是一个范围,具体为[CWmin,CWmax]。随机回退的机制是,在[CWmin,CWmax]中得到CW,初始值CW=CWmin,竞争信道失败后翻倍,更新CW=2CW,直到CW达到CWmax;竞争信道成功后CW恢复成CWmin。传输优先级越高的传输队列对应的[CWmin,CWmax]越小。随机回退参数的范围由小到大的传输队列依次为VO、VI、BE和BK。例如,对于BK传输队列,CWmin(BK)=32,CWmax(BK)=1024;对于BE传输队列,CWmin(BE)=16,CWmax(BE)=512;对于VI传输队列,CWmin(VI)=8,CWmax(VI)=16;对于VO传输队列,CWmin(VO)=4,CWmax(VO)=8。The random backoff parameter is a range, specifically [CWmin, CWmax]. The random backoff mechanism is to derive CW from [CWmin, CWmax]. The initial value CW = CWmin. After a contention failure, it is doubled, and then updated to CW = 2CW until CW reaches CWmax. After a contention success, CW returns to CWmin. The higher the transmission priority of a transmission queue, the smaller the corresponding [CWmin, CWmax]. The random backoff parameter ranges, from smallest to largest, are for the following transmission queues: VO, VI, BE, and BK. For example, for the BK transmission queue, CWmin(BK) = 32, CWmax(BK) = 1024; for the BE transmission queue, CWmin(BE) = 16, CWmax(BE) = 512; for the VI transmission queue, CWmin(VI) = 8, CWmax(VI) = 16; and for the VO transmission queue, CWmin(VO) = 4, CWmax(VO) = 8.

随机回退参数对应的随机回退时间就是在[0,CW-1]中间随机选取一个数n,随机回退时间(Backoff Time)n*9us。基于传输优先级越高的传输队列的随机回退参数的范围越小,所以传输优先级越高的传输队列对应的随机回退时间也就越小。The random backoff parameter corresponds to a random backoff time of n*9us, a number randomly selected from the range [0, CW-1]. The higher the transmission priority, the smaller the range of the random backoff parameter. Therefore, the higher the transmission priority, the smaller the random backoff time.

TXOP Limit是指在无线局域网中,给定一个电子设备或站点(station,STA)在一次竞争性或非竞争性传输期间可以发送的最大持续时间。在IEEE 802.11标准中,TXOP Limit是指在网络的共享介质上,一个STA获得传输机会并且连续传输数据的最大时间量。TXOP Limit对于不同的QoS类别有不同的配置方式。通过在传输机会期间允许STA传输更长的时间,TXOP Limit可以提高对高传输优先级报文的服务质量,例如语音和视频报文。而对于低传输优先级的报文,TXOP Limit较小,以便让更多的站点有机会进行传输。也就是说,传输优先级越高的传输队列的TXOP Limit越大,传输优先级越低的传输队列的TXOP Limit越小。TXOP Limit refers to the maximum duration that a given electronic device or station (STA) can transmit during a competitive or non-competitive transmission in a wireless local area network. In the IEEE 802.11 standard, TXOP Limit refers to the maximum amount of time that a STA obtains a transmission opportunity and continuously transmits data on the shared medium of the network. TXOP Limit has different configuration methods for different QoS categories. By allowing STAs to transmit for a longer time during the transmission opportunity, TXOP Limit can improve the quality of service for high transmission priority messages, such as voice and video messages. For messages with low transmission priority, the TXOP Limit is smaller to give more stations the opportunity to transmit. In other words, the TXOP Limit of the transmission queue with a higher transmission priority is larger, and the TXOP Limit of the transmission queue with a lower transmission priority is smaller.

当信道空闲时,这四个传输队列会竞争信道。竞争信道的方式是,根据AIFS参数加上随机回退参数的时间进行倒计时,在倒计时到0后,若信道仍空闲,则占据信道,若信道已被占据,则需要在信道空闲后重新进行倒计时操作。在某个传输队列竞争到信道后,则可以使用该信道的时长为TXOP Limit。When a channel is idle, these four transmission queues compete for the channel. They compete by counting down based on the AIFS parameter plus the random backoff parameter. If the channel is still idle after the countdown reaches 0, the queue will occupy it. If the channel is already occupied, the queue will restart the countdown after the channel becomes idle. After a transmission queue wins the channel, it can use the channel for the duration of the TXOP limit.

此外,Wi-Fi驱动在驱动电子设备中Wi-Fi通信模块发送数据时,会为传输优先级更高的队列分配更多的空口资源,使得传输优先级越高的队列能够更大概率的抢占到信道,从而使得处于队列中的消息更可靠的被发送。例如,在发送VO队列中的报文时Wi-Fi通信模块的发射功率会相比于发送BE队列中的报文时的发射功率更大,且发送VO队列中的报文时Wi-Fi通信模块的传输速率会相比于发送BE队列中的报文时的传输速率更小。In addition, when the Wi-Fi driver drives the Wi-Fi communication module in the electronic device to send data, it will allocate more air interface resources to queues with higher transmission priority, so that queues with higher transmission priority have a greater probability of preempting the channel, thereby ensuring that messages in the queue are sent more reliably. For example, when sending messages in the VO queue, the transmission power of the Wi-Fi communication module will be higher than when sending messages in the BE queue, and the transmission rate of the Wi-Fi communication module when sending messages in the VO queue will be lower than when sending messages in the BE queue.

在现有技术中,提供Wi-Fi网络的AP设备是工作在2.4G频段和5G频段的。其中,2.4G频段由于是公共频段,易受到日常环境中其他设备(例如电磁率产生电磁波)产生信号的干扰,导致电子设备与AP之间的空口信号受到较大干扰。而5G频段的电磁波的穿透能力则较弱,一旦电子设备和AP之间存在障碍物时,则也会使得空口信号变差。基于此,目前用户在使用电子设备通过Wi-Fi上网时,会因为网络环境对空口的干扰或者空口信号比较差,使得用户的上网体验不佳(例如,无法上网或网速较慢)。In the prior art, the AP devices that provide Wi-Fi networks operate in the 2.4G frequency band and the 5G frequency band. Among them, the 2.4G frequency band is a public frequency band and is easily interfered with by signals generated by other devices in the daily environment (such as electromagnetic waves generated by electromagnetic waves), resulting in greater interference to the air interface signal between the electronic device and the AP. The penetration ability of electromagnetic waves in the 5G frequency band is relatively weak. Once there is an obstacle between the electronic device and the AP, the air interface signal will also be deteriorated. Based on this, when users currently use electronic devices to access the Internet via Wi-Fi, the network environment will interfere with the air interface or the air interface signal is relatively poor, resulting in a poor Internet experience for users (for example, they cannot access the Internet or the Internet speed is slow).

TCP/IP协议栈中包括的协议可以有:EAPOL、DHCP、ARP、DNS、TCP、FTP(file transfer Protocol,文件传输协议)、SLP(service location protocol,服务定位协议)、BOOTP(bootstrap protocol,引导程序协议)等数十种协议。The protocols included in the TCP/IP protocol stack may include: EAPOL, DHCP, ARP, DNS, TCP, FTP (file transfer protocol), SLP (service location protocol), BOOTP (bootstrap protocol) and dozens of other protocols.

在空口信号受到干扰或空口信号较差的场景中,本申请的一些实施例中可以通过优先保障tcp/ip(Transmission Control Protocol/Internet Protocol,传输控制协议/网际协议)协议栈里的重要协议(与用户上网体验强相关的部分协议)的信令报文的传输,提高这些重要协议的信令报文的传输可靠性,来改善用户的上网体验。In scenarios where the air interface signal is interfered with or the air interface signal is poor, some embodiments of the present application can improve the user's Internet experience by prioritizing the transmission of signaling messages of important protocols in the TCP/IP (Transmission Control Protocol/Internet Protocol) protocol stack (some protocols that are strongly related to the user's Internet experience) and improving the transmission reliability of the signaling messages of these important protocols.

其中,TCP/IP协议栈中的重要协议是与用户上网体验强相关的部分协议,例如EAPOL、DHCP、ARP、DNS和TCP。在空口信号受到干扰或空口信号较差时,对于协议报文中传递实际业务数据(例如听音乐、看视频、打电话等业务相关的数据)的数据报文而言,发送方(例如电子设备)会一次性发送多个数据报文,例如100个。每个数据报文都有相应的序列号,接收方(例如应用服务器)在接收到多个报文后可以识别其中的序列号,进而可以准确的确定是否存在某个数据报文丢失或未发送过来,从而及时告知发送方,以方便发送方重新发送缺失的报文。例如,接收方接收到了99个数据报文,这99个数据报文的序列号包括1-54以及56-100。此时,接收方可以准确的确定缺少了序列号为55的数据报文。之后,接收方则可以及时的将该情况告知发送方,以使得发送方可以将缺失的序列号为55的数据报文重新发送给接收方。这样一来,即便空口信号受到干扰或空口信号较差,也可以保证业务数据可以顺利完成传输,使得用户顺利完成相应业务的使用。Among them, important protocols in the TCP/IP protocol stack are those that are strongly related to the user's Internet experience, such as EAPOL, DHCP, ARP, DNS, and TCP. When the air interface signal is interfered or poor, the sender (e.g., an electronic device) will send multiple data packets at once, for example, 100, for data packets that carry actual service data (such as listening to music, watching videos, making phone calls, etc.). Each data packet has a corresponding sequence number. After receiving multiple packets, the receiver (e.g., an application server) can identify the sequence numbers and accurately determine whether any data packets are lost or not sent. This allows the sender to promptly notify the sender, facilitating the retransmission of the missing packets. For example, if the receiver receives 99 data packets with sequence numbers ranging from 1 to 54 and 56 to 100, the receiver can accurately determine that the data packet with sequence number 55 is missing. The receiver can then promptly notify the sender of this situation, allowing the sender to resend the missing data packet with sequence number 55. In this way, even if the air interface signal is interfered with or the air interface signal is poor, it can ensure that the service data can be transmitted smoothly, allowing users to successfully complete the use of the corresponding services.

在用户使用电子设备传输包含有真正业务数据(例如听音乐、看视频、打电话等业务相关的数据)的业务数据报文之前,电子设备还会产生并发送用于传递信令消息的信令报文。这类信令报文则负责用于完成建立、维护和终止网络连接,以及管理和解析网络地址等任务。也就是说,这类信令报文用于保障用户能够上网,进而顺利使用电子设备完成用户需求的业务。Before users use electronic devices to transmit service data packets containing real business data (such as listening to music, watching videos, making phone calls, and other business-related data), electronic devices will also generate and send signaling messages for transmitting signaling messages. This type of signaling message is responsible for completing tasks such as establishing, maintaining, and terminating network connections, as well as managing and resolving network addresses. In other words, this type of signaling message is used to ensure that users can access the Internet and then successfully use electronic devices to complete the services required by users.

对于这类传递信令消息的信令报文而言,发送方每次仅会向发送方发送一个报文。在空口信号受到干扰或空口信号较差的情况下,如果接收方没有接收到该信令报文,则接收方是无法知道发送方是否发送了该信令报文的,也就无法及时通知发送方重新发送信令报文。之后,基于重传机制,发送方在发送信令报文后经过预设时长(可称为重传时间间隔)后,也没有接收到接收方返回的针对该信令报文的响应(例如确认应答(acknowledge character,ACK)报文)的情况下,可以确定信令报文发送失败,进而可以重新发送该信令报文。而由于预设时长较长且连续多次的重传中每次重传对应的预设时长会变得更长(例如从1s变为2s、4s等),且信令报文未能发送成功的情况下,用户是无法正常通过电子设备上网的。这也就会导致,用户上网至少会产生预设时长的卡顿,这将会对用户的上网体验造成不良影响。For signaling messages, the sender only sends one message at a time. If the air interface signal is interfered with or poor, and the receiver fails to receive the signaling message, it cannot determine whether the sender has sent the message and cannot promptly notify the sender to resend the message. Subsequently, based on the retransmission mechanism, if the sender does not receive a response (e.g., an acknowledgment (ACK) message) from the receiver after a preset duration (retransmission interval) has passed after sending the signaling message, the sender can determine that the signaling message has failed and can resend the message. However, due to the long preset duration and the fact that the preset duration becomes longer with each successive retransmission (e.g., from 1s to 2s, 4s, etc.), users will not be able to access the Internet properly through their electronic devices if the signaling message fails to send. This can result in at least a preset duration of lag in Internet access, negatively impacting the user's Internet experience.

在本申请实施例中,信令报文可以理解为仅通过一个报文发出的协议报文,数据报文可以理解为同时通过多个报文发出的协议报文。In the embodiment of the present application, a signaling message can be understood as a protocol message sent through only one message, and a data message can be understood as a protocol message sent through multiple messages at the same time.

针对上述问题,本申请实施例提供一种数据传输方法,应用于电子设备中。在该技术方案中,参照图2所示,在Wi-Fi场景下,电子设备获取到自身生成的待发送的第一协议报文后,首先会对第一协议报文进行解析,以判断第一协议报文是否为预设协议的信令报文。其中,预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP。To address the above issues, embodiments of the present application provide a data transmission method for use in an electronic device. In this technical solution, as shown in FIG2 , in a Wi-Fi scenario, after the electronic device receives a first protocol message generated by itself to be sent, it first parses the first protocol message to determine whether it is a signaling message of a preset protocol. The preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS, or TCP.

在确定第一协议报文为预设协议的信令报文时,则将第一协议报文放入第一传输队列中。在确定第一协议报文不是信令报文时,则将第一协议报文放入第二传输队列中。其中,第一传输队列为VO队列,第二传输队列为VI队列或BE队列或BK队列。If the first protocol message is determined to be a signaling message of a preset protocol, the first protocol message is placed in a first transmission queue. If the first protocol message is determined not to be a signaling message, the first protocol message is placed in a second transmission queue. The first transmission queue is a VO queue, and the second transmission queue is a VI queue, a BE queue, or a BK queue.

之后,电子设备则可以基于特定的队列调度规则,对处于第一传输队列或第二传输队列中的第一协议报文进行发送。其中,预设队列报文发送规则包括所述第一优先级传输队列的传输优先级高于所述第二优先级传输队列的传输优先级。Afterwards, the electronic device may transmit the first protocol message in the first transmission queue or the second transmission queue based on a specific queue scheduling rule, wherein the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.

在本申请提供的技术方案中,电子设备在发送协议报文时,可以将与用户上网密切相关的信令报文放在VO队列中。而VO队列则又是Wi-Fi场景下电子设备抢占信道能力最强的队列。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),信令报文也可以更为可靠的被发送出去(可以理解为接收方可以更大概率的接收到该信令报文),避免了信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户通过Wi-Fi网络上网的体验。In the technical solution provided in the present application, when sending protocol messages, the electronic device can place the signaling messages closely related to the user's Internet access in the VO queue. The VO queue is the queue with the strongest channel seizure capability for electronic devices in Wi-Fi scenarios. In this way, even if the air interface environment is not good enough (that is, the air interface signal is interfered with or the air interface signal is poor), the signaling message can be sent out more reliably (it can be understood that the receiver can receive the signaling message with a greater probability), avoiding the signaling message from being successfully sent due to the air interface environment not being good enough (it can be understood that the receiver failed to successfully receive the signaling message), resulting in the user using the electronic device to access the Internet through the Wi-Fi network. Connection jams, delays or failures, ensuring the user's experience of accessing the Internet through the Wi-Fi network.

下面结合附图对本申请实施例提供的技术方案进行详细表述。The technical solutions provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

本申请提供的技术方案可以应用在具备Wi-Fi功能的电子设备中。在一些实施例中,该电子设备可以是手机、平板电脑、手持计算机、个人计算机(personal computer,PC),超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备等电子设备,本申请实施例对该电子设备的具体类型不作特殊限制。The technical solutions provided in this application can be applied to electronic devices with Wi-Fi capabilities. In some embodiments, the electronic devices can be mobile phones, tablet computers, handheld computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and/or smart city devices. The embodiments of this application do not impose any special restrictions on the specific types of the electronic devices.

示例性的,以电子设备是手机为例,图3示出了本申请实施例提供的一种电子设备的结构示意图。For example, taking the electronic device as a mobile phone as an example, FIG3 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.

参照图3所示,电子设备可以包括处理器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,用户标识模块(subscriber identification module,SIM)卡接口194,以及摄像头195等。其中,传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。3 , the electronic device 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, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a display 193, a subscriber identification module (SIM) card interface 194, and a camera 195. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。在一些实施例中,处理器可以包括SOC。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. In some embodiments, the processor may include a system-on-chip (SoC).

控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

在一些实施例中,处理器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)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface.

外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。The external memory interface 120 can be used to connect to an external non-volatile memory device to expand the storage capacity of the electronic device. The external non-volatile memory device communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory device.

内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。Internal memory 121 may include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). RAMs can be directly read and written by processor 110 and can be used to store executable programs (e.g., machine instructions) for an operating system or other running programs, as well as user and application data. NVMs can also store executable programs and user and application data, and can be preloaded into RAMs for direct reading and writing by processor 110.

显示屏193用于显示图像,视频等。显示屏193包括显示面板。在一些实施例中,电子设备可以包括1个或N个显示屏193,N为大于1的正整数。The display screen 193 is used to display images, videos, etc. The display screen 193 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 193, where N is a positive integer greater than 1.

本申请实施例中,显示屏193可用于显示电子设备需要的页面(例如,向导页面(包括亮点推荐页面和外部模块接入页面)等),并在该界面中显示来自任一个或多个摄像头195拍摄的图像。In an embodiment of the present application, the display screen 193 can be used to display pages required by the electronic device (for example, wizard pages (including highlight recommendation pages and external module access pages), etc.), and display images captured by any one or more cameras 195 in the interface.

电子设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调器以及基带处理器等实现。The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem and baseband processor.

天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.

移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to electronic devices. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, and perform other processing on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

无线通信模块160可以提供应用在电子设备上的包括无线局域网(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转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 can be one or more devices that integrate 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 signals to be sent from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation through the antenna 2.

一些实施例中,无线通信模块160中的WiFi模块用于为电子设备200提供遵循Wi-Fi相关标准协议的网络接入,电子设备可以通过WiFi模块接入到Wi-Fi接入点(AP),进而访问互联网。WiFi模块也可以作为Wi-Fi无线接入点,可以为其他设备提供Wi-Fi网络接入。无线通信模块160中的蓝牙模块用于实现电子设备与其他设备之间的短距离通信。In some embodiments, the WiFi module in the wireless communication module 160 is used to provide the electronic device 200 with network access that complies with Wi-Fi-related standard protocols. The electronic device can access a Wi-Fi access point (AP) through the WiFi module and access the Internet. The WiFi module can also serve as a Wi-Fi wireless access point, providing Wi-Fi network access for other devices. The Bluetooth module in the wireless communication module 160 is used to enable short-range communication between the electronic device and other devices.

WiFi模块可以是集成电路或Wi-Fi芯片等,蓝牙模块可以是集成电路或者蓝牙芯片等。WiFi模块和蓝牙模块分别可以是单独的芯片(FIRMWARE)或集成电路,也可以集成到一起。例如,在一个实施例中,WiFi模块和蓝牙模块可以集成到同一芯片上。在另一个实施例中,WiFi模块,蓝牙模块以及处理器也可以集成到同一芯片中。WiFi模块所在的新品可以集成于电子设备中的系统级芯片(system on a chip,SOC)中。The WiFi module can be an integrated circuit or a WiFi chip, and the Bluetooth module can be an integrated circuit or a Bluetooth chip. The WiFi module and the Bluetooth module can each be a separate chip (FIRMWARE) or integrated circuit, or they can be integrated together. For example, in one embodiment, the WiFi module and the Bluetooth module can be integrated into the same chip. In another embodiment, the WiFi module, the Bluetooth module, and the processor can also be integrated into the same chip. The new product in which the WiFi module is located can be integrated into a system-on-a-chip (SOC) in an electronic device.

SIM卡接口194用于连接SIM卡。SIM卡可以通过插入SIM卡接口194,或从SIM卡接口194拔出,实现和电子设备的接触和分离。电子设备可以支持一个或多个SIM卡接口。SIM卡接口194可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口194可以同时插入多张卡。SIM卡接口194也可以兼容外部存储卡。电子设备通过SIM卡和网络交互,实现通话以及数据通信等功能。一个SIM卡对应一个用户号码。The SIM card interface 194 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device by inserting or removing it from the SIM card interface 194. The electronic device may support one or more SIM card interfaces. The SIM card interface 194 may support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 194 at the same time. The SIM card interface 194 is also compatible with external memory cards. Electronic devices interact with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.

可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在本申请另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

当然,可以理解的,上述图3所示仅仅为电子设备的形态为手机时的示例性说明。若电子设备是平板电脑,手持计算机,PC,PDA,可穿戴式设备(如:智能手表、智能手环)等其他设备形态时,电子设备的结构中可以包括比图3中所示更少的结构,也可以包括比图3中所示更多的结构,在此不作限制。Of course, it is understood that FIG3 is merely an example of an electronic device in the form of a mobile phone. If the electronic device is a tablet computer, handheld computer, PC, PDA, wearable device (such as a smart watch, smart bracelet), or other device form factors, the structure of the electronic device may include fewer or more structures than shown in FIG3, and this is not limited here.

可以理解的是,一般而言,电子设备功能的实现除了需要硬件的支持外,还需要软件的配合。电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的系统为例,示例性说明电子设备的软件结构。It is understandable that, in general, the realization of electronic device functions requires not only hardware support but also software cooperation. The software system of the electronic device can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

图4为本申请实施例提供的电子设备的软件系统的分层架构示意图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口(例如API)通信。Figure 4 is a schematic diagram of the layered architecture of the software system of the electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces (e.g., APIs).

在一些示例中,参照图4所示,在本申请实施例中,将设置在电子设备的系统级芯片SOC中应用处理器(application processor,AP)上的软件系统分为五层,从上至下分别为应用程序层,框架层(或称为应用程序框架层),系统库和安卓运行时(android runtime),HAL层(hardware abstraction layer,硬件抽象层)以及内核层(或称为驱动层)。其中,系统库和安卓运行时还可以称为本地框架层或者native层。In some examples, as shown in FIG4 , in an embodiment of the present application, the software system on the application processor (AP) in the system-on-chip (SOC) of an electronic device is divided into five layers: the application layer, the framework layer (or application framework layer), the system library and Android runtime (Android runtime), the HAL layer (hardware abstraction layer), and the kernel layer (or driver layer). The system library and Android runtime can also be referred to as the native framework layer or the native layer.

其中,应用程序层可以包括一系列的应用程序。如图4所示,应用程序层可以包括相机、图库、日历、地图、WLAN、蓝牙、新闻、音乐、视频、短信息、通话、导航、即时通讯等应用程序(application,APP)。The application layer may include a series of applications. As shown in FIG4 , the application layer may include applications (APPs) such as camera, gallery, calendar, map, WLAN, Bluetooth, news, music, video, short message, call, navigation, and instant messaging.

在本申请实施例中,应用程序层中的应用需要发送数据时,可以通过特定的通信方式直接与内核层中的TCP/IP协议栈进行通信。示例性的,该通信方式可以为socket通信。In the embodiment of the present application, when an application in the application layer needs to send data, it can directly communicate with the TCP/IP protocol stack in the kernel layer through a specific communication method. Exemplarily, the communication method can be socket communication.

框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数或服务。例如,应用程序框架层可以包括活动管理器、窗口管理器、内容提供器、音频服务、视图系统、电话管理器、资源管理器、通知管理器、包管理器等,本申请实施例对此不做任何限制。The framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions or services. For example, the application framework layer may include an activity manager, a window manager, a content provider, an audio service, a view system, a telephony manager, a resource manager, a notification manager, a package manager, etc., which are not limited in this embodiment of the application.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。这些数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

电话管理器用于提供电子设备的通信功能。例如,电话管理器可以管理通话应用的通话状态(包括发起,接通,挂断等)。The phone manager is used to provide communication functions for electronic devices. For example, the phone manager can manage the call status of the call application (including initiation, connection, and hang up).

资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

包管理器在系统中是用于管理应用程序包的。它允许应用程序获取关于已安装应用和它们的服务、权限等的详细信息。包管理器还用于管理应用程序的安装、卸载和升级等事件。Package Manager in The system is used to manage application packages. It allows applications to obtain detailed information about installed applications and their services, permissions, etc. The package manager is also used to manage events such as application installation, uninstallation, and upgrades.

系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),开放式图形库嵌入式系统(open graphics library embedded systems,OpenGL ES),SGL等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。OpenGL ES用于实现三维图形绘图,图像渲染,合成,和图层处理等。SGL是2D绘图的绘图引擎。The system library can include multiple functional modules. For example: surface manager, media libraries, open graphics library embedded systems (OpenGL ES), SGL, etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. SGL is a drawing engine for 2D drawing.

安卓运行时(android runtime)包括核心库和ART虚拟机。android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在ART虚拟机中。ART虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。ART虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The Android runtime consists of the core library and the ART virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for the Java language's function calls and the other for the Android core library. The application layer and the application framework layer run in the ART virtual machine. The ART virtual machine executes the Java files in the application layer and application framework layer as binary files. The ART virtual machine is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

HAL层是位于操作系统内核与硬件电路之间的接口层,其目的在于将硬件抽象化。它隐藏了特定平台的硬件接口细节,为操作系统提供虚拟硬件平台,使其具有硬件无关性,可在多种平台上进行移植。HAL层提供标准界面,向更高级别的Java API框架(即框架层)显示设备硬件功能。HAL层包含多个库模块,其中每个模块都为特定类型的硬件组件实现一个界面,例如:audio HAL音频模块,bluetooth HAL蓝牙模块,camera HAL相机模块(还可称为相机HAL或相机硬件抽象模块),sensors HAL传感器模块(或称为Isensor service,传感器服务),Wi-Fi HAL(Wi-Fi模块)等。The HAL layer is an interface layer located between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms. The HAL layer provides a standard interface to display device hardware capabilities to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as the audio HAL audio module, the bluetooth HAL Bluetooth module, the camera HAL camera module (also known as the camera HAL or camera hardware abstraction module), the sensors HAL sensor module (or Isensor service, sensor service), the Wi-Fi HAL (Wi-Fi module), etc.

内核层是硬件和软件之间的层。内核层至少包含各类驱动和TCP/IP协议栈。各类驱动可以包括显示驱动,摄像头驱动,音频驱动,传感器驱动、电池驱动、Wi-Fi驱动等,本申请不做限定。The kernel layer is the layer between hardware and software. It contains at least various drivers and the TCP/IP protocol stack. These drivers can include display drivers, camera drivers, audio drivers, sensor drivers, battery drivers, Wi-Fi drivers, and more, though this application does not limit these.

TCP/IP协议栈是一组网络通讯协议的集合,其主要作用是确保数据在网络中正确、高效地传输。它提供了一组标准化的协议,使得不同类型的主机、路由器和其他设备能够进行通信和交换数据。通过使用TCP/IP协议栈,各种设备可以在复杂的网络中相互寻找路径、交换数据、发送和接收信息,并保证数据传输的可靠性和安全性。TCP/IP协议栈通常包括多个层级,如物理层、数据链路层、网络层、传输层和应用层。每一层都有特定的功能,例如网络层负责寻址和路由,传输层负责数据分割和传输控制。The TCP/IP protocol stack is a collection of network communication protocols whose primary function is to ensure the correct and efficient transmission of data across a network. It provides a set of standardized protocols that enable different types of hosts, routers, and other devices to communicate and exchange data. By using the TCP/IP protocol stack, various devices can find paths between each other, exchange data, send and receive information, and ensure reliable and secure data transmission within complex networks. The TCP/IP protocol stack typically consists of multiple layers, such as the physical layer, data link layer, network layer, transport layer, and application layer. Each layer has specific functions, such as the network layer responsible for addressing and routing, and the transport layer responsible for data segmentation and transmission control.

示例性的,TCP/IP协议栈中的传输层通常可以包括有TCP/UDP(user datagram protocol,用户数据报协议)协议栈;TCP/IP协议栈中的网络层则可以包括有IP协议栈。TCP/UDP协议栈则负责在传输层进行数据传输的功能。传输层主要负责将应用层的数据分割为较小的数据块,并负责将这些数据块传递给网络层,以便在网络中进行可靠的传输。IP协议栈负责网络层的功能,它是互联网中数据传输的基础,IP协议栈使用IP地址来标识和寻址网络上的设备,以便在不同的网络节点之间路由数据。For example, the transport layer in a TCP/IP protocol stack typically includes a TCP/UDP (user datagram protocol) protocol stack; the network layer in a TCP/IP protocol stack may include an IP protocol stack. The TCP/UDP protocol stack is responsible for data transmission at the transport layer. The transport layer is primarily responsible for breaking application layer data into smaller data blocks and passing these blocks to the network layer for reliable transmission across the network. The IP protocol stack is responsible for the network layer, which is the foundation of data transmission on the internet. The IP protocol stack uses IP addresses to identify and address devices on the network, thereby routing data between different network nodes.

在电子设备需要通过Wi-Fi网络进行上网时,则会通过TCP/IP协议栈产生不同的协议报文(包括数据报文和信令报文),以实现上网的目的。When an electronic device needs to access the Internet through a Wi-Fi network, different protocol messages (including data messages and signaling messages) will be generated through the TCP/IP protocol stack to achieve the purpose of accessing the Internet.

例如,应用程序层中各类应用程序需要发送的业务数据会先交由TCP/IP协议栈进行封装,进而通过Wi-Fi驱动控制Wi-Fi芯片发送。For example, the business data that needs to be sent by various applications in the application layer will first be encapsulated by the TCP/IP protocol stack, and then sent through the Wi-Fi driver to control the Wi-Fi chip.

又例如,为了实现电子设备上网的目的,TCP/IP协议栈会产生EAPOL交互过程中的信令报文、DHCP交互过程中的信令报文、ARP交互过程中的信令报文、DNS交互过程中的信令报文和TCP交互过程中的信令报文等。每一种交互过程中的信令报文则可以是由TCP/IP协议栈中的一层或多层的协议栈生成的,具体根据实际而定,本申请对此不做具体限制。For another example, to enable an electronic device to access the Internet, the TCP/IP protocol stack may generate signaling messages during EAPOL interaction, signaling messages during DHCP interaction, signaling messages during ARP interaction, signaling messages during DNS interaction, and signaling messages during TCP interaction. Signaling messages in each interaction process may be generated by one or more layers of the TCP/IP protocol stack, depending on actual circumstances, and this application does not impose any specific restrictions on this.

在电子设备在Wi-Fi场景下使用Wi-Fi网络上网的情况下,TCP/IP协议栈产生了协议报文时,TCP/IP协议栈会将该报文发送给Wi-Fi驱动,以使得Wi-Fi驱动将协议报文发送给相应的接收方。When an electronic device uses a Wi-Fi network to access the Internet in a Wi-Fi scenario, when the TCP/IP protocol stack generates a protocol message, the TCP/IP protocol stack sends the message to the Wi-Fi driver, so that the Wi-Fi driver sends the protocol message to the corresponding recipient.

Wi-Fi驱动用于驱动Wi-Fi模块(或可称为Wi-Fi芯片),建立Wi-Fi连接,以使得电子设备可以通过Wi-Fi网络上网。The Wi-Fi driver is used to drive the Wi-Fi module (or Wi-Fi chip) to establish a Wi-Fi connection so that the electronic device can access the Internet through the Wi-Fi network.

在本申请实施例中,Wi-Fi驱动中可以包括有报文解析模块、队列分配模块和数据发送模块。其中,报文解析模块用于对来自TCP/IP协议栈的协议报文进行解析,并基于解析结果确定该协议报文是否为预设协议的信令报文。队列分配模块则用于根据报文解析模块对解析结果的判定,对来自TCP/IP协议栈的协议报文分配队列。具体的,在报文解析模块确定该协议报文是预设协议的信令报文的情况下,队列分配报文则将该协议报文分配至VO队列中;在报文解析模块确定该协议报文不是预设协议的信令报文的情况下,队列分配报文则将该协议报文分配至VO队列以外的传输队列中。之后,数据发送模块则可以基于队列分配报文对协议报文的分配结果,按照特定的队列报文发送规则对该协议报文进行发送。In an embodiment of the present application, the Wi-Fi driver may include a message parsing module, a queue allocation module and a data sending module. Among them, the message parsing module is used to parse the protocol message from the TCP/IP protocol stack, and determine whether the protocol message is a signaling message of the preset protocol based on the parsing result. The queue allocation module is used to allocate queues to the protocol messages from the TCP/IP protocol stack according to the judgment of the message parsing module on the parsing result. Specifically, when the message parsing module determines that the protocol message is a signaling message of the preset protocol, the queue allocation message allocates the protocol message to the VO queue; when the message parsing module determines that the protocol message is not a signaling message of the preset protocol, the queue allocation message allocates the protocol message to a transmission queue other than the VO queue. Afterwards, the data sending module can send the protocol message according to a specific queue message sending rule based on the allocation result of the queue allocation message to the protocol message.

需要说明的是,本申请实施例虽然以Android系统为例进行说明,但是其基本原理同样适用于基于iOS、Windows等操作系统的电子设备。It should be noted that although the embodiment of the present application is described using the Android system as an example, its basic principles are also applicable to Electronic devices running iOS, Windows, and other operating systems.

本申请实施例中提供的技术方案均可以在具有上述硬件架构或者软件架构的电子设备中实现。The technical solutions provided in the embodiments of this application can be implemented in electronic devices having the above-mentioned hardware architecture or software architecture.

在Wi-Fi场景下,若电子设备需要通过Wi-Fi网络上网,则电子设备需要完成以下五个信令交互过程:In a Wi-Fi scenario, if an electronic device needs to access the Internet through a Wi-Fi network, it must complete the following five signaling interaction processes:

(1)首先要与提供Wi-Fi网络的AP建立有效的Wi-Fi连接。在这个过程中,电子设备需要完成与AP之间的EAPOL交互过程,从而完成身份认证。若用户网络环境很差(即空口信号受到干扰或者空口信号较差),导致EAPOL交互过程中电子设备未能将需要发送给AP的信令报文成功发送给AP,则无法完成身份认证,电子设备也将无法通过AP完成上网。(1) First, it is necessary to establish a valid Wi-Fi connection with the AP that provides the Wi-Fi network. During this process, the electronic device needs to complete the EAPOL interaction process with the AP to complete identity authentication. If the user's network environment is very poor (i.e., the air interface signal is interfered with or the air interface signal is poor), the electronic device fails to successfully send the signaling message that needs to be sent to the AP during the EAPOL interaction process, and identity authentication cannot be completed. The electronic device will also be unable to access the Internet through the AP.

(2)在建立了与AP之间的Wi-Fi连接后,电子设备需要借助AP与DHCP服务器完成DHCP交互过程,从而获取到被分配给电子设备的IP地址以及网关的IP地址。DHCP是获取手机IP的重要协议,通常情况下,由DHCP服务器发送的信令报文-DHCP OFFER(DHCP提供)给电子设备提供IP,而如果用户网络环境很差(即空口信号受到干扰或者空口信号较差),导致DHCP服务器没有收到电子设备发出的DHCP DISCOVER(DHCP发现)这一信令报文,那么电子设备在基于重试机制重新发送该信令报文之前就处于没有IP的状态,完全无法上网。此后,在电子设备几秒后再次发送该信令报文之前,这几秒内,因为没有IP,Wi-Fi网络都将无法使用。(2) After establishing a Wi-Fi connection with the AP, the electronic device needs to complete the DHCP interaction process with the AP and the DHCP server to obtain the IP address assigned to the electronic device and the IP address of the gateway. DHCP is an important protocol for obtaining the IP of a mobile phone. Normally, the signaling message sent by the DHCP server - DHCP OFFER (DHCP offer) provides the IP to the electronic device. If the user's network environment is very poor (that is, the air interface signal is interfered with or the air interface signal is poor), the DHCP server does not receive the DHCP DISCOVER (DHCP discovery) signaling message sent by the electronic device. Then, the electronic device is in a state of no IP before resending the signaling message based on the retry mechanism, and is completely unable to access the Internet. After that, before the electronic device sends the signaling message again a few seconds later, the Wi-Fi network will be unusable because there is no IP.

进一步的,如果DHCP服务器没有收到电子设备发出的DHCP REQUEST(DHCP请求)这一信令报文,则DHCP服务器无法确认电子设备选取的IP,则会导致IP分配失败或者续约失败,电子设备将无法使用IP上网。具体的,该情况会导致用户这次的上网会卡在加载页面,如果应用没有重试机制,该次上网就会失败。Furthermore, if the DHCP server does not receive the DHCP REQUEST signaling message sent by the electronic device, it cannot confirm the IP address selected by the electronic device, resulting in a failure in IP allocation or renewal, and the electronic device will be unable to use the IP address to access the Internet. Specifically, this situation will cause the user's Internet access to be stuck on the loading page. If the application does not have a retry mechanism, the Internet access will fail.

(3)在电子设备获取到自身的IP地址以及网关的IP地址后,考虑到电子设备在通过Wi-Fi网络上网时,必须要将相应的报文在Wi-Fi局域网中交由网关转发。而Wi-Fi局域网中数据的传输走的是数据链路层,所以此时电子设备需要通过ARP交互获取到网关的MAC地址,以方便后续将数据交由网关转发至互联网。如果用户网络环境很差(即空口信号受到干扰或者空口信号较差),导致电子设备发出的ARP请求报文这一信令报文长时间没有被网关收到,就会导致手机上的ARP表项老化,之后电子设备将没有办法发送任何协议报文到网关,导致用户彻底无法上网。(3) After the electronic device obtains its own IP address and the IP address of the gateway, considering that the electronic device accesses the Internet through the Wi-Fi network, it must forward the corresponding message to the gateway in the Wi-Fi local area network. The data transmission in the Wi-Fi local area network is through the data link layer, so at this time the electronic device needs to obtain the MAC address of the gateway through ARP interaction to facilitate the subsequent forwarding of the data to the Internet by the gateway. If the user's network environment is very poor (that is, the air interface signal is interfered with or the air interface signal is poor), the ARP request message sent by the electronic device is not received by the gateway for a long time, which will cause the ARP table on the mobile phone to age. After that, the electronic device will not be able to send any protocol message to the gateway, resulting in the user being completely unable to access the Internet.

(4)在电子设备获取到网管的MAC地址后,电子设备便可以开始通过Wi-Fi网络进行上网。此时,电子设备则可以响应于用户对某个应用程序的操作或者浏览器中输入的域名开始进行上网。电子设备进行上网时,主要是要与特定的应用服务器建立TCP连接,从而进行数据交互,进而提供给可供用户查看的数据。而TCP连接的建立,则需要知道应用服务器的IP地址(即目的IP)。所以,此时电子设备需要通过与DNS服务之间的DNS交互,获取到应用程序的域名或用户输入的域名对应的IP地址。该域名对应的IP地址即为应用服务器的IP地址。在DNS交互过程中,首先电子设备会向DNS服务器发送DNS请求报文这一携带有域名的信令报文,只有DNS服务器给返回请求结果(即域名对应的IP地址),才能去访问对应的网站/网页。那么如果用户网络环境很差(即空口信号受到干扰或者空口信号较差),这个DNS请求报文在空口丢失,此次上网行为就会失败,现象就是网站/网页无法打开。(4) After the electronic device obtains the MAC address of the network manager, it can start to access the Internet through the Wi-Fi network. At this time, the electronic device can start to access the Internet in response to the user's operation on a certain application or the domain name entered in the browser. When the electronic device accesses the Internet, it mainly needs to establish a TCP connection with a specific application server to exchange data and then provide data for the user to view. The establishment of a TCP connection requires knowing the IP address of the application server (i.e., the destination IP). Therefore, at this time, the electronic device needs to obtain the domain name of the application or the IP address corresponding to the domain name entered by the user through DNS interaction with the DNS service. The IP address corresponding to the domain name is the IP address of the application server. During the DNS interaction process, the electronic device will first send a DNS request message, a signaling message carrying a domain name, to the DNS server. Only when the DNS server returns the request result (i.e., the IP address corresponding to the domain name) can the corresponding website/webpage be accessed. If the user's network environment is very poor (i.e., the air interface signal is interfered with or the air interface signal is poor), the DNS request message will be lost at the air interface, and the Internet access behavior will fail, and the phenomenon is that the website/webpage cannot be opened.

(5)在电子设备获取到了应用服务器的IP地址后,则可以通过与应用服务器之间的TCP交互,完成TCP连接(或称为建立TCP流)的建立。建立了TCP连接之后,电子设备便可以正常与应用服务器进行数据交互,完成上网的目的。在TCP交互过程中,电子设备和TCP服务器会通过三次握手建立TCP连接。其中,传输控制协议同步序列编号(TCP SYN)报文这一信令报文是第一次握手报文,如果用户网络环境很差(即空口信号受到干扰或者空口信号较差),导致该信令报文发生丢失的话,TCP服务器则完全无法感知有电子设备要访问。之后只能被动的通过电子设备发起TCP SYN报的文重传才能恢复,而通常情况下TCP SYN报文的重传时间间隔为1->2->4s,也就意味着TCP SYN报文的丢失,至少会造成1s以上的连接卡顿。(5) After the electronic device obtains the IP address of the application server, it can complete the establishment of a TCP connection (or TCP stream) through TCP interaction with the application server. After the TCP connection is established, the electronic device can normally exchange data with the application server to achieve the purpose of Internet access. During the TCP interaction process, the electronic device and the TCP server will establish a TCP connection through a three-way handshake. Among them, the Transmission Control Protocol Synchronization Sequence Number (TCP SYN) message is the first handshake message. If the user's network environment is very poor (that is, the air interface signal is interfered or the air interface signal is poor), resulting in the loss of the signaling message, the TCP server will be completely unable to perceive that there is an electronic device trying to access. After that, it can only passively initiate the retransmission of the TCP SYN message through the electronic device to recover. Under normal circumstances, the retransmission time interval of the TCP SYN message is 1->2->4s, which means that the loss of the TCP SYN message will cause at least 1s of connection lag.

此外,若的第三次握手报文(或称为ACK报文)这一信令报文未能成功发送给TCP服务器,且第三次握手报文未携带有业务数据,则TCP无法及时感知到第三次握手报文未成功发送的情况。那么,TCP服务器会等待一段时间(通常是几个重传超时时间),如果在这段时间内仍然没有收到客户端的ACK报文,那么服务器会认为TCP连接建立失败,并断开TCP连接。此时,TCP连接建立过程将失败,电子设备和TCP服务器之间的通信将无法进行,用户则无法上网。In addition, if the third handshake message (or ACK message) is not successfully sent to the TCP server, and the third handshake message does not carry business data, TCP will not be able to promptly perceive that the third handshake message has not been successfully sent. Then, the TCP server will wait for a period of time (usually several retransmission timeouts). If it still does not receive an ACK message from the client during this period, the server will consider that the TCP connection establishment has failed and disconnect the TCP connection. At this point, the TCP connection establishment process will fail, communication between the electronic device and the TCP server will not be possible, and the user will not be able to access the Internet.

基于上述表述,本申请提供的数据传输方法则可以包括有相应的五个流程,这个五个流程分别可以为:EAPLO数据传输流程、DHCP数据传输流程、ARP数据传输流程、DNS数据传输流程和TCP数据传输流程。基于上述图4所示的软件架构,以下结合图5所示,对本申请实施例提供的数据传输方法中的EAPLO数据传输流程进行介绍。图5为本申请实施例提供的EAPLO数据传输流程的示意图。参照图5所示,以电子设备(即客户端STA(station))为手机,AP为路由器为例,EAPLO数据传输流程可以包括S501-S516:Based on the above description, the data transmission method provided by the present application may include five corresponding processes, which may be: EAPLO data transmission process, DHCP data transmission process, ARP data transmission process, DNS data transmission process and TCP data transmission process. Based on the software architecture shown in FIG4 above, the EAPLO data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG5. FIG5 is a schematic diagram of the EAPLO data transmission process provided by the embodiment of the present application. Referring to FIG5, taking the electronic device (i.e., the client STA (station)) as a mobile phone and the AP as a router as an example, the EAPLO data transmission process may include S501-S516:

S501、路由器向手机发送第一次握手报文。S501. The router sends the first handshake message to the mobile phone.

该第一次握手报文Messag1可以为包括有ANonce的EAPOL-Key消息。该EAPOL-Key消息中可以携带有路由器产生的随机字符串-ANonce。在EAPOL交互过程中,与路由器交互的手机也可以称为站点STA。The first handshake message Messag1 may be an EAPOL-Key message including ANonce. The EAPOL-Key message may carry a random string -ANonce generated by the router. During the EAPOL interaction process, the mobile phone interacting with the router may also be referred to as a station STA.

需要说明的是,在进行EAPOL交互过程之前,手机作为STA,已经和路由器之间已经建立了Wi-Fi网络连接。具体可以是经历了探测(probr)和认证(authentication)后,通过关联请求/响应Association Request/Response(Assoc Req/Rsp)过程完成的。其中,关联请求Association Request是STA(即手机)向AP(即路由器)发送的请求,用于请求与特定的BSSID(Basic Service Set Identifier,基本服务集标识符)建立关联。手机通过发送Association Request消息来向路由器表明自己的存在,并请求加入无线网络。其中,BSSID具体为路由器的标识。而在发送关联请求前,STA则会获取到预共享密钥(pre-shared key,PSK)。在一些实施例中,PSK是用户配置路由器的Wi-Fi网络时设置的,例如该PSK可以是用户通过手机接入Wi-Fi网络时,需要输入的密码。It should be noted that before the EAPOL interaction process begins, the mobile phone, acting as a STA, has already established a Wi-Fi network connection with the router. This connection is typically established through the Association Request/Response (Assoc Req/Rsp) process, after probing and authenticating. An Association Request is a request sent by the STA (i.e., the mobile phone) to the AP (i.e., the router) to establish an association with a specific Basic Service Set Identifier (BSSID). The mobile phone sends an Association Request message to indicate its presence to the router and request to join the wireless network. The BSSID is the router's identifier. Before sending the Association Request, the STA obtains a pre-shared key (PSK). In some embodiments, the PSK is set by the user when configuring the router's Wi-Fi network. For example, the PSK can be the password a user enters when accessing the Wi-Fi network via their mobile phone.

关联响应Association Response是路由器对手机的Association Request的响应。路由器接收到Association Request后,会根据网络策略和可用资源等因素来决定是否接受手机的关联请求。如果接受,路由器会发送Association Response给手机,其中包含关联成功的指示以及分配给手机的一些参数,如AA(authenticator address)、支持的数据传输速率等。An Association Response is the router's response to a phone's Association Request. Upon receiving the Association Request, the router decides whether to accept the phone's association request based on factors such as network policy and available resources. If accepted, the router sends an Association Response to the phone, which contains an indication of successful association and parameters assigned to the phone, such as the authenticator address (AA) and supported data rates.

S502、手机的Wi-Fi芯片接收来自路由器的第一次握手报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该第一次握手报文。S502: The Wi-Fi chip of the mobile phone receives the first handshake message from the router, and sends the first handshake message to the TCP/IP protocol stack through the Wi-Fi driver.

S503、手机的TCP/IP协议栈基于第一次握手报文中携带的ANonce,生成第一报文并向Wi-Fi驱动发送。S503: The TCP/IP protocol stack of the mobile phone generates a first message based on the ANonce carried in the first handshake message and sends the first message to the Wi-Fi driver.

具体的,TCP/IP协议栈在接收到第一次握手报文后,会基于预设算法计算后续手机与路由器之间通信时进行数据加密的密钥(pairwise transient key,PTK)。Specifically, after receiving the first handshake message, the TCP/IP protocol stack will calculate the key (pairwise transient key, PTK) for data encryption during subsequent communications between the mobile phone and the router based on a preset algorithm.

示例性的,该预设算法可以为伪随机函数(pseudo-random function,PRF)算法。具体的,PTK=PRF(Snonce+Anonce+PMK+AA+SA)。Exemplarily, the preset algorithm may be a pseudo-random function (PRF) algorithm. Specifically, PTK = PRF (Snonce + Anonce + PMK + AA + SA).

其中,Snonce为TCP/IP协议栈生成的随机数,AA为路由器(作为认证者authenticator)的MAC地址,SA(supplicant address)为手机(作为申请者supplicant)的MAC地址,PMK(pairwise master key,成对主密钥)是TCP/IP协议栈基于PSK和BSSID生成的(生成方式不限)。Among them, Snonce is a random number generated by the TCP/IP protocol stack, AA is the MAC address of the router (as the authenticator), SA (supplicant address) is the MAC address of the mobile phone (as the supplicant), and PMK (pairwise master key) is generated by the TCP/IP protocol stack based on PSK and BSSID (the generation method is not limited).

此外,TCP/IP协议栈在接收到第一次握手报文后还会使用HMAC_MD5这一哈希函数,计算完整码消息完整性代码(message integrity code,MIC)。具体的,可以使用MIC key作为密钥,对802.1x data进行散列计算,输出16位的MIC1(sta)值,即MIC1(sta)=HMAC_MD5(MIC key,16,802.1x data)。In addition, after receiving the first handshake message, the TCP/IP protocol stack uses the HMAC_MD5 hash function to calculate the message integrity code (MIC). Specifically, the MIC key is used as the key to hash the 802.1x data and output the 16-bit MIC1(sta) value, i.e., MIC1(sta) = HMAC_MD5(MIC key, 16, 802.1x data).

其中,MIC key是EAPOL交互之前手机与路由器之间进行认证过程中确定得到的。在一些实施例中,MIC key可以是PTK的前16个字节。The MIC key is determined during the authentication process between the mobile phone and the router before the EAPOL interaction. In some embodiments, the MIC key can be the first 16 bytes of the PTK.

802.1x data是指用于计算MIC1(sta)的数据,通常包括一次握手消息-携带有Anonce的EAPOL-Key消息的内容、STA(即手机)的MAC地址、路由器的BSSID等信息。802.1x data refers to the data used to calculate MIC1(sta), which usually includes a handshake message - the content of the EAPOL-Key message carrying Anonce, the MAC address of the STA (i.e., the mobile phone), the BSSID of the router, and other information.

TCP/IP协议栈最终生成的第一报文可以称为第二次握手报文Message2,具体可以为携带有Snonce和MIC1(sta)的EAPOL-Key消息。The first message finally generated by the TCP/IP protocol stack may be referred to as the second handshake message Message2, and specifically may be an EAPOL-Key message carrying Snonce and MIC1(sta).

S504、手机的Wi-Fi驱动对第一报文进行解析,并基于解析结果判断第一报文是否为预设协议的信令报文。S504: The Wi-Fi driver of the mobile phone parses the first message and determines whether the first message is a signaling message of a preset protocol based on the parsing result.

其中,Wi-Fi驱动对第一报文的解析可以采用任意可行的方式。预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP,后续实施例中同理。The Wi-Fi driver may parse the first message in any feasible manner. The preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP, and the same applies to the subsequent embodiments.

Wi-Fi驱动通过对第一报文进行解析,可以得到第一报文具体是什么协议报文以及是什么协议报文交互过程的第几个,即解析结果。例如,针对第一报文解析后,可以确定第一报文是EAPOL协议报文,且是EAPOL四次握手交互过程中的第二次握手时的EAPOL协议报文。By parsing the first message, the Wi-Fi driver can determine the specific protocol message of the first message and the number of the protocol message interaction process, i.e., the parsing result. For example, after parsing the first message, it can be determined that the first message is an EAPOL protocol message and is an EAPOL protocol message in the second handshake of the EAPOL four-way handshake interaction process.

在Wi-Fi驱动确定第一报文为预设协议的信令报文的情况下,则可以认为接收方式无法及时确定是否接收到该第一报文的,一旦第一报文丢失,则需要等发送方在较长时间后基于重传机制重传。When the Wi-Fi driver determines that the first message is a signaling message of a preset protocol, it can be considered that the receiving method cannot promptly determine whether the first message is received. Once the first message is lost, it is necessary to wait for the sender to retransmit it based on the retransmission mechanism after a long time.

而在这段等待时间内,用户则无法正常上网。也就是说,第一报文的可靠发送对用户能否正常上网的影响较大。基于此,为了保障对用户上网影响较大的第一报文被可靠的发送,保障用户可以正常通过Wi-Fi网络上网,则可以将第一报文放入VO队列中,即执行S505。During this waiting time, the user cannot access the Internet normally. In other words, the reliable transmission of the first message has a significant impact on whether the user can access the Internet normally. Based on this, in order to ensure that the first message, which has a significant impact on the user's Internet access, is reliably transmitted and that the user can access the Internet normally through the Wi-Fi network, the first message can be placed in the VO queue, that is, S505 is executed.

在Wi-Fi驱动确定第一报文不为信令报文的情况下,则可以认为第一报文即便丢失,接收方也可以及时发现并告知发送方重新发送,不会使得用户的上网过程停滞等待。基于此,该情况下则可以将第一报文放入VO队列以外的传输队列(例如BE队列或VI队列或BK队列)中,即执行S506。If the Wi-Fi driver determines that the first message is not a signaling message, then even if the first message is lost, the receiver can still detect it and notify the sender to resend it, without causing the user's Internet access to stall. Based on this, in this case, the first message can be placed in a transmission queue other than the VO queue (e.g., the BE queue, the VI queue, or the BK queue), that is, executing S506.

S505、手机的Wi-Fi驱动将第一报文放入VO队列中。S505: The Wi-Fi driver of the mobile phone puts the first message into the VO queue.

在本申请中,VO队列可以称为第一优先级传输队列。后续实施例中同理。In this application, the VO queue may be referred to as a first priority transmission queue. The same applies to the subsequent embodiments.

S506、手机的Wi-Fi驱动将第一报文放入VO队列以外的传输队列中。S506: The Wi-Fi driver of the mobile phone puts the first message into a transmission queue other than the VO queue.

在本申请中,VO队列以外的传输队列可以称为第二优先级传输队列。第二优先级传输队列与第一优先级传输队列不同。后续实施例中同理。In this application, the transmission queue other than the VO queue can be referred to as the second priority transmission queue. The second priority transmission queue is different from the first priority transmission queue. The same applies to the subsequent embodiments.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第一报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the first message that is not a signaling message of the preset protocol in the BE queue.

当然,需要说明的是,由于在EAPOL四次握手过程中,手机和路由器之间的四次握手消息均为预设协议的信令报文,即每次握手消息均为接收方在缺失时无法及时确定未能收到的数据报文,且对用户能够正常上网强相关。所以这里Wi-Fi驱动基于对第一报文解析的解析结果,可以确定第一报文为预设协议的信令报文。所以实际中不会执行S506。本申请实施例对S506的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the four-way handshake messages between the mobile phone and the router during the EAPOL four-way handshake are all signaling messages of the preset protocol, that is, each handshake message is a data message that the receiver cannot promptly determine has not been received when it is missing, and is strongly related to the user's ability to access the Internet normally. Therefore, based on the parsing result of the first message, the Wi-Fi driver can determine that the first message is a signaling message of the preset protocol. Therefore, S506 will not be executed in practice. The description of S506 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S507、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向路由器发送该第一报文。S507: The Wi-Fi driver of the mobile phone sends the first message to the router through the Wi-Fi chip according to the preset queue message sending rule.

其中,预设队列报文发送规则包括第一优先级传输队列的传输优先级高于第二优先级传输队列的传输优先级。The preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.

S508、路由器接收来自手机的第一报文,并基于第一报文中携带的SNonce和MIC1(sta),生成第三次握手报文。S508: The router receives the first message from the mobile phone, and generates a third handshake message based on the SNonce and MIC1(sta) carried in the first message.

在路由器接收到第一报文后,则可以按照手机生成PTK和MIC(sta)的方式,生成PTK和MIC1(ap)。在MIC1(sta)和MIC1(ap)相同的情况下,则可以确定路由器计算得出的PTK是正确的。在MIC1(sta)和MIC1(ap)不相同的情况下,则可以认为手机计算的PTK和路由器计算的PTK是不同的,进而可以丢弃第一报文并向手机返回认证失败报文,结束整个EAPOL交互流程。After receiving the first message, the router can generate a PTK and MIC1(ap) in the same way as the mobile phone generates the PTK and MIC(sta). If MIC1(sta) and MIC1(ap) are the same, the PTK calculated by the router can be determined to be correct. If MIC1(sta) and MIC1(ap) are different, it can be assumed that the PTK calculated by the mobile phone and the PTK calculated by the router are different. The router can then discard the first message and return an authentication failure message to the mobile phone, ending the entire EAPOL interaction process.

在确定MIC1(sta)和MIC1(ap)相同的情况下,路由器可以根据组主密钥(group master key,GMK)、Anonce和AA生成组临时密钥(group temporal key,GTK)。生成方式不限,本申请对此不做具体限制。If MIC1(sta) and MIC1(ap) are identical, the router can generate a group temporal key (GTK) based on the group master key (GMK), Anonce, and AA. The generation method is not limited and this application does not impose any specific restrictions on this.

其中,GMK可以是路由器预先配置的秘密信息、认证凭证或其他安全因素进行计算得出的。本申请对此不做具体限制。The GMK may be calculated based on secret information pre-configured by the router, authentication credentials, or other security factors. This application does not impose any specific restrictions on this.

为了保护消息完整性和供手机验证消息的真实性,路由器还可以使用PTK的前16字节和第一报文,生成MIC2(ap)。具体生成方式可以参考MIC1(ap)的生成方式。To protect message integrity and verify the authenticity of the message for the mobile phone, the router can also use the first 16 bytes of the PTK and the first message to generate MIC2 (ap). The specific generation method can refer to the generation method of MIC1 (ap).

此外,为了防止密钥泄露,路由器还可以采用预设加密方法对GTK加密后,生成携带有MIC2(ap)和加密后的GTK的第三次握手报文Message3。该第三次握手报文具体可以是携带有MIC2(ap)和加密后的GTK的EAPOL-Key消息。示例性的,预设加密方法可以是使用PTK中间的16为字节采用任意可行的加密方法(例如计数器模式及密码块链消息认证码协议(counter cipher mode with block chaining message authentication code protocol,CCMP))加密GTK。In addition, to prevent key leakage, the router can also encrypt the GTK using a preset encryption method and generate a third handshake message Message3 carrying MIC2(ap) and the encrypted GTK. The third handshake message can specifically be an EAPOL-Key message carrying MIC2(ap) and the encrypted GTK. Exemplarily, the preset encryption method can be to use the middle 16 bytes of the PTK to encrypt the GTK using any feasible encryption method (such as counter cipher mode with block chaining message authentication code protocol (CCMP)).

S509、路由器向手机发送第三次握手报文。S509: The router sends a third handshake message to the mobile phone.

S510、手机的Wi-Fi芯片接收来自路由器的第三次握手报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该第三次握手报文。S510: The Wi-Fi chip of the mobile phone receives the third handshake message from the router, and sends the third handshake message to the TCP/IP protocol stack through the Wi-Fi driver.

S511、手机的TCP/IP协议栈对第三次握手报文中携带的加密后的GTK进行解密后,安装PTK和GTK,生成第二报文,并向Wi-Fi驱动发送第二报文。S511. The TCP/IP protocol stack of the mobile phone decrypts the encrypted GTK carried in the third handshake message, installs the PTK and GTK, generates a second message, and sends the second message to the Wi-Fi driver.

具体的,TCP/IP协议栈在接收到第三次握手报文后,首先会基于与路由器生成MIC2(ap)相同的方式,生成MIC2(sta)。然后,判断MIC2(sta)和MIC2(ap)是否相同。Specifically, after receiving the third handshake message, the TCP/IP protocol stack first generates MIC2(sta) in the same way as the router generates MIC2(ap), and then determines whether MIC2(sta) is the same as MIC2(ap).

在MIC2(sta)和MIC2(ap)相同的情况下,则可以认为第三次握手报文未被修改过且路由器计算的GTK无误,进而手机可以利用PTK对加密后的GTK解密得到GTK后,安装PTK和GTK,并生成第二报文。在MIC2(sta)和MIC2(ap)不相同的情况下,则可以认为第三次握手报文被修改过或路由器计算的GTK有误,进而可以丢弃第三次握手报文并向路由器返回认证失败报文,结束整个EAPOL交互流程。If MIC2(sta) and MIC2(ap) are the same, the third handshake message can be considered unmodified and the GTK calculated by the router is correct. The mobile phone can then use the PTK to decrypt the encrypted GTK to obtain the GTK, install the PTK and GTK, and generate the second message. If MIC2(sta) and MIC2(ap) are different, the third handshake message can be considered modified or the GTK calculated by the router is incorrect. The third handshake message can be discarded and an authentication failure message can be returned to the router, ending the entire EAPOL interaction process.

其中,安装PTK和GTK可以是指在之后使用PTK加密手机和路由器之间的单播数据帧,并使用GTK加密手机和路由器之间的组播数据帧和广播数据帧。Installing the PTK and the GTK may refer to subsequently using the PTK to encrypt unicast data frames between the mobile phone and the router, and using the GTK to encrypt multicast data frames and broadcast data frames between the mobile phone and the router.

第二报文可以为第四次握手报文Message4,具体可以为携带有ACK和MIC3(sta)的EAPOL-Key Ack消息。手机具体可以使用PTK的前16字节和第三次握手报文,生成MIC3(sta)。具体生成方式可以参考MIC1(sta)的生成方式。The second message can be the fourth handshake message, Message 4, specifically an EAPOL-Key Ack message carrying an ACK and MIC3(sta). The mobile phone can use the first 16 bytes of the PTK and the third handshake message to generate MIC3(sta). The specific generation method can refer to the generation method of MIC1(sta).

S512、手机的Wi-Fi驱动对第二报文进行解析,并基于解析结果判断第二报文是否为预设协议的信令报文。S512: The Wi-Fi driver of the mobile phone parses the second message, and determines whether the second message is a signaling message of a preset protocol based on the parsing result.

其中,Wi-Fi驱动对第二报文的解析可以采用任意可行的方式。Wi-Fi驱动通过对第二报文进行解析,可以得到第二报文具体是什么协议报文以及是什么协议报文交互过程的第几个,即解析结果。例如,针对第二报文解析后,可以确定第二报文是EAPOL协议报文,且是EAPOL协议报文交互过程中的第四个EAPOL协议报文。The Wi-Fi driver may parse the second message in any feasible manner. By parsing the second message, the Wi-Fi driver may determine the specific protocol message of the second message and the number of the protocol message interaction process, i.e., the parsing result. For example, after parsing the second message, it may be determined that the second message is an EAPOL protocol message and is the fourth EAPOL protocol message in the EAPOL protocol message interaction process.

在Wi-Fi驱动确定第二报文为预设协议的信令报文的情况下,则可以认为接收方式无法及时确定是否接收到该第二报文的,一旦第二报文丢失,则需要等发送方在较长时间后基于重传机制重传。而在这段等待时间内,用户则无法正常上网。也就是说,第二报文的可靠发送对用户能否正常上网的影响较大。基于此,为了保障对用户上网影响较大的第二报文被可靠的发送,保障用户可以正常通过Wi-Fi网络上网,则可以将第二报文放入VO队列中,即执行S513。In the case where the Wi-Fi driver determines that the second message is a signaling message of a preset protocol, it can be considered that the receiving method cannot promptly determine whether the second message is received. Once the second message is lost, it is necessary to wait for the sender to retransmit it based on the retransmission mechanism after a long time. During this waiting time, the user cannot access the Internet normally. In other words, the reliable transmission of the second message has a greater impact on whether the user can access the Internet normally. Based on this, in order to ensure that the second message that has a greater impact on the user's Internet access is reliably sent and that the user can access the Internet normally through the Wi-Fi network, the second message can be placed in the VO queue, that is, S513 is executed.

在Wi-Fi驱动确定第二报文不为预设协议的信令报文的情况下,则可以认为第二报文即便丢失,接收方也可以及时发现并告知发送方重新发送,不会使得用户的上网过程停滞等待。基于此,该情况下则可以将第二报文放入VO队列以外的传输队列(例如BE队列或VI队列或BK队列)中,即执行S514。If the Wi-Fi driver determines that the second message is not a signaling message for the preset protocol, then even if the second message is lost, the receiver can promptly detect it and notify the sender to resend it, without causing the user's Internet access to stall. Based on this, in this case, the second message can be placed in a transmission queue other than the VO queue (e.g., the BE queue, the VI queue, or the BK queue), executing S514.

S513、手机的Wi-Fi驱动将第二报文放入VO队列中。S513: The Wi-Fi driver of the mobile phone puts the second message into the VO queue.

S514、手机的Wi-Fi驱动将第二报文放入VO队列以外的传输队列中。S514: The Wi-Fi driver of the mobile phone puts the second message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第二报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the second message that is not a signaling message of the preset protocol in the BE queue.

当然,需要说明的是,由于在EAPOL四次握手过程中,手机和路由器之间的四次握手消息均为单个的信令报文。所以这里Wi-Fi驱动基于对第二报文解析的解析结果,可以确定第二报文为预设协议的信令报文。所以实际中不会执行S514。本申请实施例对S514的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the four-way handshake messages between the mobile phone and the router during the EAPOL four-way handshake are all single signaling messages, the Wi-Fi driver can determine that the second message is a signaling message of the preset protocol based on the parsing result of the second message. Therefore, S514 will not be executed in practice. The description of S514 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S515、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向路由器发送该第二报文。S515 : The Wi-Fi driver of the mobile phone sends the second message to the router through the Wi-Fi chip according to the preset queue message sending rule.

S516、路由器在接收到来自手机的第二报文的情况下,安装GTK和PTK。S516. When the router receives the second message from the mobile phone, it installs GTK and PTK.

具体的,路由器在接收到第二报文后,首先会基于与手机生成MIC3(ap)相同的方式,生成MIC3(ap)。然后,判断MIC3(sta)和MIC3(ap)是否相同。Specifically, after receiving the second message, the router first generates MIC3(ap) in the same manner as the mobile phone generates MIC3(ap), and then determines whether MIC3(sta) and MIC3(ap) are the same.

在MIC3(sta)和MIC3(ap)相同的情况下,则可以认为第二报文未被修改过且手机已成功安装PTK和GTK,路由器此时则可以安装PTK和GTK,并结束整个EAPOL交互流程。在MIC3(sta)和MIC3(ap)不相同的情况下,则可以认为第二报文被修改过或手机未能成功安装PTK和GTK,进而路由器可以丢弃第二报文并向手机返回认证失败报文,结束整个EAPOL交互流程。If MIC3(sta) and MIC3(ap) are the same, it can be assumed that the second message has not been modified and the mobile phone has successfully installed the PTK and GTK. The router can then install the PTK and GTK and end the entire EAPOL interaction process. If MIC3(sta) and MIC3(ap) are different, it can be assumed that the second message has been modified or the mobile phone has failed to successfully install the PTK and GTK. The router can then discard the second message and return an authentication failure message to the mobile phone, ending the entire EAPOL interaction process.

需要说明的是,实际中进行EAPOL的电子设备和AP还可以是其他设备,在为其他设备的情况下,实现方式和上述流程相同,本申请对此不做限制和赘述。It should be noted that, in practice, the electronic device and AP performing EAPOL may also be other devices. In the case of other devices, the implementation method is the same as the above process, and this application does not limit or elaborate on this.

基于上述EAPOL数据传输流程,手机可以将EAPOL对应的所有信令报文放在传输优先级高的第一优先级传输队列如VO队列中进行传输。而Wi-Fi场景下,传输优先级最高的传输队列,传输优先级高的队列中的报文抢占信道能力更强,传输成功率更高。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),EAPOL数据传输流程中放在第一优先级传输队列中的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功的接收到该信令报文的概率更高),进而可以使得手机与路由器顺利完成EAPOL数据传输流程,避免了预设协议的信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,后续手机则可以通过路由器进行后续的上网流程,进而顺利上网,保障了用户通过Wi-Fi网络上网的体验。Based on the aforementioned EAPOL data transmission process, the mobile phone can place all EAPOL signaling messages in the first-priority transmission queue with a higher transmission priority, such as the VO queue, for transmission. In Wi-Fi scenarios, the highest priority transmission queue is used, and messages in this queue have a stronger ability to seize the channel and a higher transmission success rate. This allows signaling messages placed in the first-priority transmission queue in the EAPOL data transmission process to be transmitted more reliably (i.e., with interference or poor signal quality), even in less-than-optimal air interface conditions (i.e., with a higher probability of successful reception at the receiver), allowing the mobile phone and router to successfully complete the EAPOL data transmission process. This prevents signaling messages for the pre-defined protocol from being successfully transmitted (i.e., with the receiver failing to receive the message) due to a less-than-optimal air interface condition, which could result in connection freezes, delays, or failures when the user uses the electronic device to access the internet via the Wi-Fi network. The mobile phone can then proceed to the subsequent internet access process through the router, ensuring a smooth internet access experience, ensuring a better Wi-Fi experience.

在手机完成EAPOL数据传输流程后,手机便可以开始与DHCP服务器交互,以获取自身可用的IP地址以及Wi-Fi局域网中网关的IP地址,以方便后续基于IP地址上网。After the mobile phone completes the EAPOL data transmission process, it can start interacting with the DHCP server to obtain its own available IP address and the IP address of the gateway in the Wi-Fi LAN, so as to facilitate subsequent Internet access based on the IP address.

基于上述图4所示的软件架构,以下结合图6所示,对本申请实施例提供的数据传输方法中的DHCP数据传输流程进行介绍。图6为本申请实施例提供的DHCP数据传输流程的示意图。参照图6所示,以电子设备(充当DHCP客户端Client)为手机为例,DHCP数据传输流程可以包括S601-S618:Based on the software architecture shown in FIG4 above, the DHCP data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG6. FIG6 is a schematic diagram of the DHCP data transmission process provided by the embodiment of the present application. Referring to FIG6, taking the electronic device (acting as a DHCP client) as a mobile phone as an example, the DHCP data transmission process may include S601-S618:

S601、手机的TCP/IP协议栈生成第三报文,并向Wi-Fi驱动发送第三报文。S601: The TCP/IP protocol stack of the mobile phone generates a third message and sends the third message to the Wi-Fi driver.

其中,第三报文可以为DHCP DISCOVER报文。该DHCP DISCOVER报文可以携带有手机的MAC地址等信息,该DHCP DISCOVER报文用于请求IP地址。The third message may be a DHCP DISCOVER message. The DHCP DISCOVER message may carry information such as the MAC address of the mobile phone and is used to request an IP address.

在手机接入Wi-Fi网络,完成了EAPOL数据传输流程后,TCP/IP协议栈则可以生成DHCP Discover报文。After the mobile phone connects to the Wi-Fi network and completes the EAPOL data transmission process, the TCP/IP protocol stack can generate a DHCP Discover message.

S602、手机的Wi-Fi驱动对第三报文进行解析,并基于解析结果判断第三报文是否为预设协议的信令报文。S602: The Wi-Fi driver of the mobile phone parses the third message and determines whether the third message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第三报文进行解析的解析结果,确定第三报文为预设协议的信令报文的情况下,可以将第三报文放入VO队列中进行发送,即执行S603。When the Wi-Fi driver determines that the third message is a signaling message of a preset protocol based on the parsing result of the third message, the third message may be put into a VO queue for sending, that is, S603 is executed.

在Wi-Fi驱动基于对第三报文进行解析的解析结果,确定第三报文不为预设协议的信令报文的情况下,可以将第三报文放入VO队列以外的传输队列中进行发送,即执行S604。If the Wi-Fi driver determines that the third message is not a signaling message of the preset protocol based on the parsing result of the third message, the third message may be placed in a transmission queue other than the VO queue for sending, that is, S604 is executed.

S602的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S602 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S603、手机的Wi-Fi驱动将第三报文放入VO队列中。S603: The Wi-Fi driver of the mobile phone puts the third message into the VO queue.

S604、手机的Wi-Fi驱动将第三报文放入VO队列以外的传输队列中。S604: The Wi-Fi driver of the mobile phone puts the third message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第三报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the third message that is not a signaling message of the preset protocol in the BE queue.

当然,需要说明的是,由于在手机通过DHCP服务器获取IP地址的过程中,手机和DHCP服务器之间的交互消息均为预设协议的信令报文,即每次交互的DHCP协议报文均为接收方在缺失时无法及时确定未能收到的数据报文,且与用户能够正常上网强相关。所以这里Wi-Fi驱动基于对第三报文解析的解析结果,可以确定第三报文为预设协议的信令报文。所以实际中不会执行S604。本申请实施例对S604的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the interactive messages between the mobile phone and the DHCP server are all signaling messages of the preset protocol during the process of obtaining an IP address through the DHCP server, that is, each interactive DHCP protocol message is a data message that the recipient cannot promptly determine has not been received when it is missing, and is strongly related to the user's ability to access the Internet normally. Therefore, based on the parsing result of the third message, the Wi-Fi driver here can determine that the third message is a signaling message of the preset protocol. Therefore, S604 will not be executed in practice. The description of S604 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S605、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向DHCP服务器发送该第三报文。S605: The Wi-Fi driver of the mobile phone sends the third message to the DHCP server through the Wi-Fi chip according to the preset queue message sending rule.

在一些实施例中,Wi-Fi驱动可以是通过Wi-Fi芯片在Wi-Fi网络的广播域中发送该第三报文,以使得DHCP服务器可以接收到该第三报文。In some embodiments, the Wi-Fi driver may send the third message in the broadcast domain of the Wi-Fi network through the Wi-Fi chip, so that the DHCP server can receive the third message.

在一些实施例中,DHCP服务器可以预置在提供Wi-Fi网络的路由器中,也可以是Wi-Fi局域网中与路由器连接的设备。在DHCP服务器和路由器不为同一设备的情况下,Wi-Fi芯片可以是将第三报文发送给了路由器,由路由器发送给DHCP服务器的。In some embodiments, the DHCP server may be pre-installed in a router that provides a Wi-Fi network, or may be a device connected to the router in a Wi-Fi local area network. If the DHCP server and the router are different devices, the Wi-Fi chip may send the third message to the router, which then sends it to the DHCP server.

S606、DHCP服务器接收来自手机的第三报文,响应于第三报文从IP地址池中选择未被分配的第一IP地址,并生成携带有第一IP地址的DHCP OFFER报文。S606. The DHCP server receives a third message from the mobile phone, selects an unassigned first IP address from the IP address pool in response to the third message, and generates a DHCP OFFER message carrying the first IP address.

在一些实施例中,DHCP OFFER报文中还可以携带有第一IP地址的租约期限、子网掩码、网关的IP地址和DNS服务器的IP地址等信息。其中,第一IP地址的租约期限即指该第一IP地址可被使用的时间,在第一IP地址的租约期限到达后,需要手机重新续约第一IP地址的使用或重新申请IP地址。In some embodiments, the DHCP OFFER message may also carry information such as the lease term of the first IP address, the subnet mask, the IP address of the gateway, and the IP address of the DNS server. The lease term of the first IP address refers to the time during which the first IP address can be used. After the lease term of the first IP address expires, the mobile phone needs to renew the use of the first IP address or reapply for a new IP address.

S607、DHCP服务器向手机发送该DHCP OFFER报文。S607. The DHCP server sends the DHCP OFFER message to the mobile phone.

在一种可能的实现方式中,DHCP服务器可以在在Wi-Fi网络的广播域中发送该DHCP OFFER报文。手机在发送了第三报文后,可以通过监听广播地址(即监听广播域中的报文)得到该DHCP OFFER报文。In one possible implementation, the DHCP server can send the DHCP Offer message in the broadcast domain of the Wi-Fi network. After sending the third message, the mobile phone can obtain the DHCP Offer message by monitoring the broadcast address (i.e., monitoring messages in the broadcast domain).

在另一种可能的实现方式中,DHCP服务器向手机单播发送该DHCP OFFER报文。具体的,DHCP服务器可以通过第三报文中携带的手机的MAC地址或其他用于标识手机的标识,来实现向手机单播发送该DHCP OFFER报文的目的。In another possible implementation, the DHCP server unicasts the DHCP Offer message to the mobile phone. Specifically, the DHCP server can use the mobile phone's MAC address or other identifier carried in the third message to unicast the DHCP Offer message to the mobile phone.

在一些实施例中,若DHCP服务器和路由器是Wi-Fi网络中相连的不同设备,则DHCP服务器具体可以是通过路由器向手机发送该DHCP OFFER报文。In some embodiments, if the DHCP server and the router are different devices connected in the Wi-Fi network, the DHCP server can specifically send the DHCP OFFER message to the mobile phone through the router.

S608、手机的Wi-Fi芯片接收来自DHCP服务器的DHCP OFFER报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该DHCP OFFER报文。S608. The Wi-Fi chip of the mobile phone receives the DHCP OFFER message from the DHCP server and sends the DHCP OFFER message to the TCP/IP protocol stack through the Wi-Fi driver.

S609、手机的TCP/IP协议栈将DHCP OFFER报文中携带的第一IP地址应用在手机的网络配置中,并生成第四报文。S609. The TCP/IP protocol stack of the mobile phone applies the first IP address carried in the DHCP OFFER message to the network configuration of the mobile phone and generates a fourth message.

其中,将第一IP地址应用在手机的网络配置中是指将第一IP地址配置为手机的IP地址。此外,TCP/IP协议栈还用于将DHCP OFFER报文中携带的第一IP地址的租约期限、子网掩码、网关的IP地址和DNS服务器的IP地址等信息应用在手机的网络配置中,应用方式同理。Applying the first IP address to the mobile phone's network configuration refers to configuring the first IP address as the mobile phone's IP address. Furthermore, the TCP/IP protocol stack is used to apply information such as the lease period of the first IP address, subnet mask, gateway IP address, and DNS server IP address carried in the DHCP OFFER message to the mobile phone's network configuration in a similar manner.

当然,实际中,TCP/IP协议栈在获取到DHCP OFFER报文后,还会通过任意可行的判断方式判断第一IP地址是否有效。在确定第一IP地址有效的情况下,TCP/IP协议栈才会将该第一IP地址应用在手机的网络配置中,并生成第四报文。在确定第一IP地址无效的情况下,手机则可以执行任意可行的处理动作,例如重新向DHCP服务器发送DHCP DISCOVER报文等。Of course, in practice, after receiving the DHCP OFFER message, the TCP/IP protocol stack will also determine whether the first IP address is valid through any available method. If the first IP address is determined to be valid, the TCP/IP protocol stack will apply the first IP address to the phone's network configuration and generate the fourth message. If the first IP address is determined to be invalid, the phone can perform any available processing action, such as resending a DHCP DISCOVER message to the DHCP server.

第四报文具体可以是指DHCP REQUEST报文。该DHCP REQUEST报文用于指示手机接受DHCP服务器分配的第一IP地址。The fourth message may specifically be a DHCP REQUEST message. The DHCP REQUEST message is used to instruct the mobile phone to accept the first IP address assigned by the DHCP server.

S610、手机的TCP/IP协议栈向Wi-Fi驱动发送第四报文。S610: The TCP/IP protocol stack of the mobile phone sends a fourth message to the Wi-Fi driver.

S611、手机的Wi-Fi驱动对第四报文进行解析,并基于解析结果判断第四报文是否为预设协议的信令报文。S611: The Wi-Fi driver of the mobile phone parses the fourth message, and determines whether the fourth message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第四报文进行解析的解析结果,确定第四报文为预设协议的信令报文的情况下,可以将第四报文放入VO队列中进行发送,即执行S612。When the Wi-Fi driver determines that the fourth message is a signaling message of a preset protocol based on the parsing result of the fourth message, the fourth message may be placed in a VO queue for sending, ie, S612 is executed.

在Wi-Fi驱动基于对第四报文进行解析的解析结果,确定第四报文不为预设协议的信令报文的情况下,可以将第四报文放入VO队列以外的传输队列中进行发送,即执行S613。When the Wi-Fi driver determines that the fourth message is not a signaling message of the preset protocol based on the parsing result of the fourth message, the fourth message may be placed in a transmission queue other than the VO queue for sending, that is, S613 is executed.

S611的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S611 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S612、手机的Wi-Fi驱动将第四报文放入VO队列中。S612: The Wi-Fi driver of the mobile phone puts the fourth message into the VO queue.

S613、手机的Wi-Fi驱动将第四报文放入VO队列以外的传输队列中。S613: The Wi-Fi driver of the mobile phone puts the fourth message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第四报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the fourth message, which is not a signaling message of the preset protocol, in the BE queue.

当然,需要说明的是,由于在手机通过DHCP服务器获取IP地址的过程中,手机和DHCP服务器之间的交互消息均为预设协议的信令报文,即每次交互的DHCP协议报文均为接收方在缺失时无法及时确定未能收到的数据报文,其与用户能否正常上网强相关。所以这里Wi-Fi驱动基于对第四报文解析的解析结果,可以确定第四报文为预设协议的信令报文。所以实际中不会执行S613。本申请实施例对S613的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the interactive messages between the mobile phone and the DHCP server are all signaling messages of the preset protocol during the process of obtaining an IP address through the DHCP server, that is, each interactive DHCP protocol message is a data message that the recipient cannot promptly determine if it has not received when it is missing, and it is strongly related to whether the user can access the Internet normally. Therefore, based on the parsing result of the fourth message, the Wi-Fi driver here can determine that the fourth message is a signaling message of the preset protocol. Therefore, S613 will not be executed in practice. The description of S613 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S614、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向DHCP服务器发送该第四报文。S614: The Wi-Fi driver of the mobile phone sends the fourth message to the DHCP server through the Wi-Fi chip according to the preset queue message sending rule.

在一些实施例中,Wi-Fi驱动可以是通过Wi-Fi芯片在Wi-Fi网络的广播域中发送该第四报文,以使得DHCP服务器可以接收到该第四报文。In some embodiments, the Wi-Fi driver may send the fourth message in the broadcast domain of the Wi-Fi network through the Wi-Fi chip, so that the DHCP server can receive the fourth message.

在一些实施例中,DHCP服务器可以预置在提供Wi-Fi网络的路由器中,也可以是Wi-Fi局域网中与路由器连接的设备。在DHCP服务器和路由器不为同一设备的情况下,Wi-Fi芯片可以是将第四报文发送给了路由器,由路由器发送给DHCP服务器的。In some embodiments, the DHCP server may be pre-installed in a router that provides a Wi-Fi network, or may be a device connected to the router in a Wi-Fi local area network. If the DHCP server and the router are different devices, the Wi-Fi chip may send the fourth message to the router, which then sends it to the DHCP server.

在另一些实施例中,若手机预先获取到了DHCP服务器的IP地址,则Wi-Fi芯片可以采用单播的方式向DHCP服务器发送该第四报文。In other embodiments, if the mobile phone has acquired the IP address of the DHCP server in advance, the Wi-Fi chip may send the fourth message to the DHCP server in a unicast manner.

S615、DHCP服务器接收来自手机的第四报文,响应于第四报文,生成DHCP ACK报文。S615. The DHCP server receives the fourth message from the mobile phone and generates a DHCP ACK message in response to the fourth message.

其中,DHCP ACK报文用于指示手机可以开始使用第一IP地址。Among them, the DHCP ACK message is used to indicate that the mobile phone can start using the first IP address.

S616、DHCP服务器向手机发送DHCP ACK报文。S616. The DHCP server sends a DHCP ACK message to the mobile phone.

S617、手机的Wi-Fi芯片接收来自DHCP服务器的DHCP ACK报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该DHCP ACK报文。S617. The Wi-Fi chip of the mobile phone receives the DHCP ACK message from the DHCP server and sends the DHCP ACK message to the TCP/IP protocol stack through the Wi-Fi driver.

S618、手机的TCP/IP协议栈响应于DHCP ACK报文,开始使用第一IP地址。S618. The TCP/IP protocol stack of the mobile phone responds to the DHCP ACK message and starts using the first IP address.

在一些实施例中,由于手机通过DHCP服务器获取到的第一IP地址是由租约期限的,为了保证手机可以正常使用第一IP地址,手机还可以在开始使用第一IP地址达到第一IP地址的租约期限的预设百分比时,向DHCP服务器发送用于延长第一IP地址的租约期限的第五报文(具体可以是DHCP REQUEST(renew)报文)。DHCP REQUEST(renew)报文也属于DHCP REQUEST报文。示例性的,预设百分比可以为50%。In some embodiments, since the first IP address obtained by the mobile phone through the DHCP server has a lease period, to ensure that the mobile phone can normally use the first IP address, the mobile phone may further send a fifth message (specifically, a DHCP REQUEST (renew) message) to the DHCP server to extend the lease period of the first IP address when the mobile phone starts using the first IP address and reaches a preset percentage of the lease period of the first IP address. The DHCP REQUEST (renew) message also belongs to the DHCP REQUEST message. Exemplarily, the preset percentage may be 50%.

之后,若DHCP服务器同意延长第一IP地址的租约期限,则可以向手机发送用于指示可延长第一IP地址的租约期限预设时长的DHCP ACK(renew)报文。在手机接收到该DHCP ACK(renew)报文后,则可以将第一IP地址的租约期限延长预设时长,并继续使用该第一IP地址进行上网。If the DHCP server agrees to extend the lease of the first IP address, it may send a DHCP ACK (renew) message to the mobile phone, indicating that the lease of the first IP address can be extended by a preset time period. After receiving the DHCP ACK (renew) message, the mobile phone can extend the lease of the first IP address by the preset time period and continue to use the first IP address for Internet access.

上述延长第一IP地址的租约期限的交互过程可以参照前述实施例中,S609-S616的相关表述,此处不再赘述。The above-mentioned interactive process of extending the lease term of the first IP address can refer to the relevant descriptions of S609-S616 in the aforementioned embodiment, and will not be repeated here.

基于上述DHCP数据传输流程,手机可以将DHCP对应的所有信令报文放在传输优先级高的第一优先级传输队列如VO队列中进行传输。而Wi-Fi场景下,传输优先级最高的传输队列,传输优先级高的队列中的报文抢占信道能力更强,传输成功率更高。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),DHCP数据传输流程中放在第一优先级传输队列中的预设协议的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功的接收到该信令报文的概率更高),进而可以使得手机与DHCP服务器顺利完成DHCP数据传输流程,避免了预设协议的信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败。后续手机则可以基于通过该流程获取到的分配给手机的第一IP地址和网管的IP地址,进行后续的上网流程,进而顺利上网,保障了用户的上网体验。Based on the above DHCP data transmission process, the mobile phone can place all DHCP-related signaling messages in a first-priority transmission queue with a high transmission priority, such as a VO queue, for transmission. In Wi-Fi scenarios, the highest transmission priority transmission queue is used, as messages in this queue have a stronger ability to seize channels and a higher transmission success rate. This allows the mobile phone and the DHCP server to successfully complete the DHCP data transmission process, even if the air interface environment is poor (i.e., the air interface signal is interfered with or the air interface signal is poor). This prevents signaling messages for the preset protocol placed in the first-priority transmission queue during the DHCP data transmission process from being sent out more reliably (this can be understood as the probability of the receiver successfully receiving the signaling message being higher). This prevents signaling messages for the preset protocol from being successfully sent due to poor air interface conditions (this can be understood as the receiver failing to successfully receive the signaling message), which could cause connection freezes, delays, or failures when the user uses the electronic device to access the Internet via a Wi-Fi network. The mobile phone can then proceed to the subsequent Internet access process based on the first IP address assigned to the mobile phone and the network administrator's IP address obtained through this process, thereby smoothly accessing the Internet and ensuring a good user experience.

在手机完成DHCP数据传输流程后,手机便可以开始使用第一IP地址以及网关的IP地址获取网管的MAC地址,以方便后续通过网关向互联网发送数据。After the mobile phone completes the DHCP data transmission process, the mobile phone can start using the first IP address and the IP address of the gateway to obtain the MAC address of the network manager to facilitate subsequent sending of data to the Internet through the gateway.

基于上述图4所示的软件架构,以下结合图7所示,对本申请实施例提供的数据传输方法中的ARP数据传输流程进行介绍。图7为本申请实施例提供的ARP数据传输流程的示意图。参照图7所示,以电子设备为手机,网关为路由器为例,ARP数据传输流程可以包括S701-S709:Based on the software architecture shown in FIG4 above, the ARP data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG7. FIG7 is a schematic diagram of the ARP data transmission process provided by the embodiment of the present application. Referring to FIG7, taking the electronic device as a mobile phone and the gateway as a router as an example, the ARP data transmission process may include S701-S709:

S701、手机的TCP/IP协议栈生成第六报文,并向Wi-Fi驱动发送第六报文。S701. The TCP/IP protocol stack of the mobile phone generates a sixth message and sends the sixth message to the Wi-Fi driver.

其中,第六报文可以为ARP请求报文。该ARP请求报文中可以携带有网关的IP地址、手机的MAC地址以及手机的IP地址;该ARP请求报文用于请求网关的MAC地址。The sixth message may be an ARP request message, which may carry the IP address of the gateway, the MAC address of the mobile phone, and the IP address of the mobile phone; the ARP request message is used to request the MAC address of the gateway.

S702、手机的Wi-Fi驱动对第六报文进行解析,并基于解析结果判断第六报文是否为预设协议的信令报文。S702: The Wi-Fi driver of the mobile phone parses the sixth message, and determines whether the sixth message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第六报文进行解析的解析结果,确定第六报文为预设协议的信令报文的情况下,可以将第六报文放入VO队列中进行发送,即执行S703。When the Wi-Fi driver determines that the sixth message is a signaling message of a preset protocol based on the parsing result of the sixth message, the sixth message may be placed in a VO queue for sending, ie, S703 is executed.

在Wi-Fi驱动基于对第六报文进行解析的解析结果,确定第六报文不为预设协议的信令报文的情况下,可以将第六报文放入VO队列以外的传输队列中进行发送,即执行S704。When the Wi-Fi driver determines that the sixth message is not a signaling message of the preset protocol based on the parsing result of the sixth message, the sixth message may be placed in a transmission queue other than the VO queue for sending, that is, S704 is executed.

S702的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S702 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S703、手机的Wi-Fi驱动将第六报文放入VO队列中。S703: The Wi-Fi driver of the mobile phone puts the sixth message into the VO queue.

S704、手机的Wi-Fi驱动将第六报文放入VO队列以外的传输队列中。S704: The Wi-Fi driver of the mobile phone puts the sixth message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第六报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the sixth message, which is not a signaling message of the preset protocol, in the BE queue.

当然,需要说明的是,由于在手机通过作为网关的路由器获取路由器的MAC地址的过程中,ARP请求报文为预设协议的信令报文。所以这里Wi-Fi驱动基于对第六报文解析的解析结果,可以确定第六报文为预设协议的信令报文。所以实际中不会执行S704。本申请实施例对S704的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the ARP request message is a signaling message of a preset protocol when the mobile phone obtains the MAC address of the router through the router acting as a gateway, the Wi-Fi driver can determine that the sixth message is a signaling message of a preset protocol based on the parsing result of the sixth message. Therefore, S704 will not be executed in practice. The description of S704 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S705、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向路由器发送该第六报文。S705 : The Wi-Fi driver of the mobile phone sends the sixth message to the router through the Wi-Fi chip according to the preset queue message sending rule.

在一些实施例中,Wi-Fi驱动可以是通过Wi-Fi芯片在Wi-Fi网络的广播域中发送该第六报文,以使得作为网关的路由器可以接收到该第六报文。In some embodiments, the Wi-Fi driver may send the sixth message in the broadcast domain of the Wi-Fi network through the Wi-Fi chip, so that a router serving as a gateway can receive the sixth message.

具体的,作为网关的路由器接收第六报文的实现可以参照前述实施中针对图1的相关表述,此处不再赘述。Specifically, the implementation of the router serving as the gateway receiving the sixth message may refer to the relevant description of FIG. 1 in the aforementioned implementation, which will not be repeated here.

在一些实施例中,网关也可以是Wi-Fi局域网中与路由器连接的其他设备,例如光猫。在该情况下,Wi-Fi芯片可以是将第六报文发送给了路由器,由路由器通过广播域发送给光猫的。In some embodiments, the gateway may also be other devices connected to the router in the Wi-Fi local area network, such as an optical modem. In this case, the Wi-Fi chip may send the sixth message to the router, which then sends the message to the optical modem via the broadcast domain.

S706、路由器接收来自手机的第六报文,响应于第六报文,生成携带有路由器的MAC地址的ARP响应报文。S706: The router receives the sixth message from the mobile phone, and generates an ARP response message carrying the MAC address of the router in response to the sixth message.

作为网管的路由器在确定第六报文中携带的网管的IP地址和自身的IP地址相同时,则可以生成携带有路由器的MAC地址的ARP响应报文。When the router serving as the network manager determines that the IP address of the network manager carried in the sixth message is the same as its own IP address, it may generate an ARP response message carrying the MAC address of the router.

S707、路由器向手机发送ARP响应报文。S707: The router sends an ARP response message to the mobile phone.

在一些实施例中,路由器向手机单播发送该ARP响应报文。具体的,路由器可以通过第六报文中携带的手机的MAC地址和IP地址或其他用于标识手机的标识,来实现向手机单播发送该ARP响应报文的目的。In some embodiments, the router unicasts the ARP response message to the mobile phone. Specifically, the router can achieve the purpose of unicasting the ARP response message to the mobile phone by using the MAC address and IP address of the mobile phone or other identifiers used to identify the mobile phone carried in the sixth message.

S708、手机的Wi-Fi芯片接收来自路由器的ARP响应报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该ARP响应报文。S708. The Wi-Fi chip of the mobile phone receives the ARP response message from the router, and sends the ARP response message to the TCP/IP protocol stack through the Wi-Fi driver.

S709、手机的TCP/IP协议栈将ARP响应报文中携带的路由器的MAC地址与网关的IP地址生成映射,并存储在ARP表项中。S709: The TCP/IP protocol stack of the mobile phone generates a mapping between the MAC address of the router carried in the ARP response message and the IP address of the gateway, and stores the mapping in the ARP table entry.

在ARP表项中存在有网关的MAC地址和IP地址的映射后,手机便可以在Wi-Fi局域网中准确的向网关发送需要转给互联网的报文,进而使得网关将报文转发至互联网,保障手机顺利上网。After the mapping of the gateway's MAC address and IP address exists in the ARP table, the mobile phone can accurately send messages that need to be forwarded to the Internet to the gateway in the Wi-Fi LAN, and then the gateway forwards the messages to the Internet, ensuring that the mobile phone can access the Internet smoothly.

基于上述ARP数据传输流程,手机可以将ARP对应的所有信令报文放在传输优先级高的第一优先级传输队列如VO队列中进行传输。而Wi-Fi场景下,传输优先级高的队列中的报文抢占信道能力更强,传输成功率更高。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),ARP数据传输流程中放在第一优先级传输队列中的预设协议的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功的接收到该信令报文的概率更高),进而可以使得手机与路由器顺利完成ARP数据传输流程,后续手机则可以基于通过该流程获取到的作为网关的路由器的MAC地址,进行后续的上网流程,进而顺利上网。避免了预设协议的信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户的上网体验。Based on the aforementioned ARP data transmission process, the mobile phone can place all signaling messages corresponding to ARP in a first-priority transmission queue with a high transmission priority, such as the VO queue, for transmission. In Wi-Fi scenarios, messages in queues with a high transmission priority have a stronger ability to seize channels and a higher transmission success rate. This allows the signaling messages of the preset protocol placed in the first-priority transmission queue during the ARP data transmission process to be transmitted more reliably (this can be understood as a higher probability of the receiver successfully receiving the signaling message), even if the air interface environment is not optimal (i.e., the air interface signal is interfered with or the air interface signal is poor). This allows the mobile phone and the router to successfully complete the ARP data transmission process. The mobile phone can then proceed to the subsequent Internet access process based on the MAC address of the router acting as a gateway obtained through this process, thereby smoothly accessing the Internet. This prevents signaling messages of the preset protocol from being successfully transmitted due to an inadequate air interface environment (this can be understood as the receiver failing to successfully receive the signaling message), resulting in connection lag, delays, or failures when the user uses the electronic device to access the Internet via a Wi-Fi network, thereby ensuring the user's Internet experience.

在手机完成ARP数据传输流程后,手机便可以开始响应于用户在浏览器中输入域名的操作或打开某个应用程序的操作,获取相应域名的IP地址,从而方便后续建立与应用服务器的TCP连接,从而顺利上网。After the mobile phone completes the ARP data transmission process, it can start responding to the user's operation of entering a domain name in the browser or opening an application, and obtain the IP address of the corresponding domain name, thereby facilitating the subsequent establishment of a TCP connection with the application server, so as to smoothly access the Internet.

基于上述图4所示的软件架构,以下结合图8所示,对本申请实施例提供的数据传输方法中的ARP数据传输流程进行介绍。图8为本申请实施例提供的ARP数据传输流程的示意图。参照图8所示,以电子设备为手机,网关为路由器为例,ARP数据传输流程可以包括S801-S809:Based on the software architecture shown in FIG4 above, the ARP data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG8. FIG8 is a schematic diagram of the ARP data transmission process provided by the embodiment of the present application. Referring to FIG8, taking the electronic device as a mobile phone and the gateway as a router as an example, the ARP data transmission process may include S801-S809:

S801、手机的TCP/IP协议栈生成第七报文,并向Wi-Fi驱动发送第七报文。S801. The TCP/IP protocol stack of the mobile phone generates a seventh message and sends the seventh message to the Wi-Fi driver.

其中,第七报文可以为DNS请求报文。该ARP请求报文中可以携带有目标域名,例如www.example.com;该DNS请求报文用于请求域名对应的IP地址。The seventh message may be a DNS request message. The ARP request message may carry a target domain name, such as www.example.com. The DNS request message is used to request the IP address corresponding to the domain name.

该目标域名可以是用户在浏览器中输入的域名,也可以是用户触发某个应用程序打开时,该应用程序向TCP/IP协议栈传输的域名。本申请对此不做具体限制。The target domain name can be a domain name entered by the user in the browser, or it can be a domain name transmitted by the application to the TCP/IP protocol stack when the user triggers an application to open. This application does not make specific restrictions on this.

S802、手机的Wi-Fi驱动对第七报文进行解析,并基于解析结果判断第七报文是否为预设协议的信令报文。S802: The Wi-Fi driver of the mobile phone parses the seventh message and determines whether the seventh message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第七报文进行解析的解析结果,确定第七报文为预设协议的信令报文的情况下,可以将第七报文放入VO队列中进行发送,即执行S803。When the Wi-Fi driver determines that the seventh message is a signaling message of a preset protocol based on the parsing result of the seventh message, the seventh message may be put into the VO queue for sending, ie, S803 is executed.

在Wi-Fi驱动基于对第七报文进行解析的解析结果,确定第七报文不为预设协议的信令报文的情况下,可以将第七报文放入VO队列以外的传输队列中进行发送,即执行S804。When the Wi-Fi driver determines that the seventh message is not a signaling message of the preset protocol based on the parsing result of the seventh message, the seventh message may be placed in a transmission queue other than the VO queue for sending, that is, S804 is executed.

S802的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S802 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S803、手机的Wi-Fi驱动将第七报文放入VO队列中。S803: The Wi-Fi driver of the mobile phone puts the seventh message into the VO queue.

S804、手机的Wi-Fi驱动将第七报文放入VO队列以外的传输队列中。S804. The Wi-Fi driver of the mobile phone puts the seventh message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第七报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the seventh message, which is not a signaling message of the preset protocol, in the BE queue.

当然,需要说明的是,由于在手机通过作为网关的路由器获取路由器的MAC地址的过程中,DNS请求报文为预设协议的信令报文。所以这里Wi-Fi驱动基于对第七报文解析的解析结果,可以确定第七报文为预设协议的信令报文。所以实际中不会执行S804。本申请实施例对S804的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that, since the DNS request message is a signaling message of the preset protocol when the mobile phone obtains the MAC address of the router through the router acting as a gateway, the Wi-Fi driver can determine that the seventh message is a signaling message of the preset protocol based on the parsing result of the seventh message. Therefore, S804 will not be executed in practice. The description of S804 in the embodiment of this application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S805、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向DNS服务器发送该第七报文。S805 : The Wi-Fi driver of the mobile phone sends the seventh message to the DNS server through the Wi-Fi chip according to the preset queue message sending rule.

在一些实施例中,Wi-Fi驱动可以是通过之前DHCP服务器提供的DHCP OFFER报文中携带的DNS服务器的IP地址,向DNS服务器发送该第七报文。In some embodiments, the Wi-Fi driver may send the seventh message to the DNS server using the IP address of the DNS server carried in the DHCP OFFER message previously provided by the DHCP server.

在一些实施例中,DNS服务器可以预置在提供Wi-Fi网络的路由器中,也可以是Wi-Fi局域网中与路由器连接的设备。在DNS服务器和路由器不为同一设备的情况下,Wi-Fi芯片可以是将第七报文发送给了路由器,由路由器发送给DNS服务器的。In some embodiments, the DNS server may be pre-installed in a router that provides a Wi-Fi network, or may be a device connected to the router in a Wi-Fi local area network. If the DNS server and the router are different devices, the Wi-Fi chip may send the seventh message to the router, which then sends it to the DNS server.

S806、DNS服务器接收来自手机的第七报文,响应于第七报文,确定第七报文中目标域名对应的第二IP地址,并生成携带有第二IP地址的DNS响应报文。S806. The DNS server receives the seventh message from the mobile phone, determines the second IP address corresponding to the target domain name in the seventh message in response to the seventh message, and generates a DNS response message carrying the second IP address.

具体的,DNS服务器在接收到第七报文后,会按照任意可行的方式确定出目标域名对应的第二IP地址,例如从DNS服务器的本地缓存中获取第二IP地址。Specifically, after receiving the seventh message, the DNS server will determine the second IP address corresponding to the target domain name in any feasible manner, such as obtaining the second IP address from the local cache of the DNS server.

S807、DNS服务器向手机发送DNS响应报文。S807. The DNS server sends a DNS response message to the mobile phone.

在一些实施例中,DNS服务器向手机单播发送该DNS响应报文。具体的,DNS请求报文中的源IP地址即为手机的IP地址,DNS服务器在得到域名解析结果(即第二IP地址)后,会依据该源IP地址将携带有域名解析结果的DNS响应报文发送给手机。In some embodiments, the DNS server unicasts the DNS response message to the mobile phone. Specifically, the source IP address in the DNS request message is the IP address of the mobile phone. After obtaining the domain name resolution result (i.e., the second IP address), the DNS server sends a DNS response message carrying the domain name resolution result to the mobile phone based on the source IP address.

S808、手机的Wi-Fi芯片接收来自路由器的DNS响应报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该DNS响应报文。S808. The Wi-Fi chip of the mobile phone receives the DNS response message from the router, and sends the DNS response message to the TCP/IP protocol stack through the Wi-Fi driver.

S809、手机的TCP/IP协议栈将DNS响应报文中携带的第二IP地址存储。S809. The TCP/IP protocol stack of the mobile phone stores the second IP address carried in the DNS response message.

在获得了与目标域名对应的第二IP地址后,手机便可以将该第二IP地址作为目的地址,进行上网。After obtaining the second IP address corresponding to the target domain name, the mobile phone can use the second IP address as the destination address to access the Internet.

基于上述DNS数据传输流程,手机可以将DNS对应的所有信令报文放在VO队列中进行传输。而由于VO队列是Wi-Fi场景下电子设备抢占信道能力最强的队列。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),DNS数据传输流程中的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功的接收到该信令报文的概率更高),进而可以使得手机与DNS服务器顺利完成DNS数据传输流程,后续手机则可以基于通过该流程获取到的作为用户需要登录的网页或者需要打开的应用程序对应的目的IP地址,从而可以进行后续的上网流程,进而顺利上网。避免了信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户的上网体验。Based on the above DNS data transmission process, the mobile phone can place all signaling messages corresponding to the DNS in the VO queue for transmission. Since the VO queue is the queue with the strongest channel preemption capability for electronic devices in Wi-Fi scenarios, even in poor air interface conditions (i.e., interference or poor air interface signals), the signaling messages in the DNS data transmission process can be sent more reliably (this can be understood as a higher probability that the receiver will successfully receive the signaling message). This allows the mobile phone and the DNS server to successfully complete the DNS data transmission process. The mobile phone can then use the destination IP address corresponding to the web page or application that the user needs to log in to, obtained through this process, to proceed with the subsequent Internet access process and successfully access the Internet. This prevents signaling messages from being unsuccessfully sent due to poor air interface conditions (this can be understood as the receiver failing to successfully receive the signaling message), resulting in connection freezes, delays, or failures when the user uses the electronic device to access the Internet via a Wi-Fi network, thereby ensuring the user's Internet experience.

在手机完成DNS数据传输流程后,手机便可以开始使用第二IP地址与第二IP地址对应的TCP服务器建立TCP连接,进而与TCP服务器进行数据交互,完成上网的目的。After the mobile phone completes the DNS data transmission process, the mobile phone can start to use the second IP address to establish a TCP connection with the TCP server corresponding to the second IP address, and then interact with the TCP server to complete the purpose of surfing the Internet.

基于上述图4所示的软件架构,以下结合图9所示,对本申请实施例提供的数据传输方法中的TCP数据传输流程进行介绍。图9为本申请实施例提供的ARP数据传输流程的示意图。参照图9所示,以电子设备为手机为例,TCP数据传输流程可以包括S901-S915:Based on the software architecture shown in FIG4 above, the TCP data transmission process in the data transmission method provided by the embodiment of the present application is introduced below in conjunction with FIG9. FIG9 is a schematic diagram of the ARP data transmission process provided by the embodiment of the present application. Referring to FIG9, taking the electronic device as a mobile phone as an example, the TCP data transmission process may include S901-S915:

S901、手机的TCP/IP协议栈生成第八报文,并向Wi-Fi驱动发送第八报文。S901. The TCP/IP protocol stack of the mobile phone generates an eighth message and sends the eighth message to the Wi-Fi driver.

其中,第八报文可以为TCP三次握手流程中,作为TCP客户端的手机发送给TCP服务器的传输控制协议同步序列编号(TCP SYN(synchronize sequence numbe))报文(也可称为第一次TCP握手报文)。Among them, the eighth message can be the Transmission Control Protocol Synchronization Sequence Number (TCP SYN (synchronize sequence number)) message (also known as the first TCP handshake message) sent by the mobile phone acting as a TCP client to the TCP server in the TCP three-way handshake process.

该TCP SYN中的包括有SYN和序列号seq,SYN=1,seq=x。SYN=1用于标识请求与TCP服务器建立TCP连接,seq=x则用于指示手机当前对应的序列号为x。在一些实施例中,x可以为0。The TCP SYN packet includes SYN and a sequence number, seq, where SYN=1 and seq=x. SYN=1 indicates a request to establish a TCP connection with the TCP server, and seq=x indicates that the current sequence number corresponding to the mobile phone is x. In some embodiments, x can be 0.

S902、手机的Wi-Fi驱动对第八报文进行解析,并基于解析结果判断第八报文是否为预设协议的信令报文。S902: The Wi-Fi driver of the mobile phone parses the eighth message, and determines whether the eighth message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第八报文进行解析的解析结果,确定第八报文为预设协议的信令报文的情况下,可以将第八报文放入VO队列中进行发送,即执行S903。When the Wi-Fi driver determines that the eighth message is a signaling message of a preset protocol based on the parsing result of the eighth message, the eighth message may be put into the VO queue for sending, that is, S903 is executed.

在Wi-Fi驱动基于对第八报文进行解析的解析结果,确定第八报文不为预设协议的信令报文的情况下,可以将第八报文放入VO队列以外的传输队列中进行发送,即执行S904。When the Wi-Fi driver determines that the eighth message is not a signaling message of the preset protocol based on the parsing result of the eighth message, the eighth message may be placed in a transmission queue other than the VO queue for sending, that is, S904 is executed.

S902的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S902 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S903、手机的Wi-Fi驱动将第八报文放入VO队列中。S903: The Wi-Fi driver of the mobile phone puts the eighth message into the VO queue.

S904、手机的Wi-Fi驱动将第八报文放入VO队列以外的传输队列中。S904: The Wi-Fi driver of the mobile phone puts the eighth message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第八报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the eighth message, which is not a signaling message of the preset protocol, in the BE queue.

当然,需要说明的是,由于在手机与TCP服务器建立TCP连接的三次握手过程中,第一次握手时,手机向TCP服务器发送的TCP SYN报文为预设协议的信令报文。所以这里Wi-Fi驱动基于对第八报文解析的解析结果,可以确定第八报文为信令报文。所以实际中不会执行S904。本申请实施例对S904的表述,仅是为了说明本申请提供的技术方案中Wi-Fi驱动具体可能的动作。Of course, it should be noted that during the three-way handshake process to establish a TCP connection between the mobile phone and the TCP server, the TCP SYN message sent by the mobile phone to the TCP server during the first handshake is a signaling message of the preset protocol. Therefore, based on the parsing result of the eighth message, the Wi-Fi driver can determine that the eighth message is a signaling message. Therefore, S904 is not actually executed. The description of S904 in this embodiment of the application is only to illustrate the specific possible actions of the Wi-Fi driver in the technical solution provided by this application.

S905、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向TCP服务器发送该第八报文。S905 : The Wi-Fi driver of the mobile phone sends the eighth message to the TCP server through the Wi-Fi chip according to the preset queue message sending rule.

其中,TCP服务器可以为用户在浏览器输入的域名对应的服务器,或者TCP服务器可以为用户打开的应用程序所属的应用服务器。The TCP server may be a server corresponding to a domain name input by the user in the browser, or the TCP server may be an application server to which an application opened by the user belongs.

在一些实施例中,Wi-Fi驱动可以基于DNS服务器返回的第二IP地址,是通过Wi-Fi芯片向TCP服务器发送该第八报文的。In some embodiments, the Wi-Fi driver may send the eighth message to the TCP server through the Wi-Fi chip based on the second IP address returned by the DNS server.

由于TCP服务器不在Wi-Fi局域网中,而是在远端的互联网中,所以Wi-Fi芯片具体可以通过路由器(或者网关)将第八报文转发给TCP服务器的。Since the TCP server is not in the Wi-Fi local area network but in the remote Internet, the Wi-Fi chip can forward the eighth message to the TCP server through a router (or gateway).

在手机将第八报文发送给TCP服务器后,手机则处于SYN_SENT(同步已发送)状态,该状态用于标识手机已经发送了TCP SYN报文给TCP服务器,以请求建立TCP连接。After the mobile phone sends the eighth message to the TCP server, the mobile phone is in the SYN_SENT (synchronization sent) state, which is used to indicate that the mobile phone has sent a TCP SYN message to the TCP server to request to establish a TCP connection.

S906、TCP服务器接收来自手机的第八报文,响应于第八报文,生成TCP响应报文。S906. The TCP server receives the eighth message from the mobile phone, and generates a TCP response message in response to the eighth message.

该TCP响应报文(也可称为第二次TCP握手报文)包括中可以包括seq、SYN、ACK字段和ack字段。seq=y,SYN=1,ACK字段=1,ack字段=x+1。y为TCP服务器随机生成的数值。seq=y表示TCP服务器当前对应的序列号为y;SYN=1和ACK字段=1表示TCP服务器接收到了TCP SYN报文,且同意建立TCP连接;ack字段=x+1则用于表示确认号,其是在客户端发送的第八报文中seq的值上加1得到。This TCP response message (also known as the second TCP handshake message) includes the seq, SYN, ACK, and ack fields. seq = y, SYN = 1, ACK = 1, and ack = x + 1. y is a randomly generated value by the TCP server. seq = y indicates that the TCP server's current sequence number is y; SYN = 1 and ACK = 1 indicate that the TCP server has received the TCP SYN message and agreed to establish a TCP connection; ack = x + 1 indicates the confirmation number, which is the value of seq in the eighth message sent by the client plus 1.

S907、TCP服务器向手机发送TCP响应报文。S907. The TCP server sends a TCP response message to the mobile phone.

一些实施例中,TCP服务器可以是通过路由器向手机发送该TCP响应报文的。In some embodiments, the TCP server may send the TCP response message to the mobile phone through a router.

具体的,TCP服务器具体可以是向TCP SYN报文中的源IP地址发送TCP响应报文。Specifically, the TCP server may send a TCP response message to the source IP address in the TCP SYN message.

在TCP服务器向手机发送了TCP响应报文后,TCP服务器可以处于SYN_RCVD(同步已接收)状态,该状态用于表示服务器已经接收到了客户端发送的TCP SYN报文,并发送了一个SYN+ACK报文(即TCP响应报文)作为响应。服务器进入SYN_RCVD状态,表示它已经准备好与客户端建立连接。After the TCP server sends a TCP response packet to the mobile phone, the TCP server may enter the SYN_RCVD (Synchronize Received) state, which indicates that the server has received the TCP SYN packet sent by the client and sent a SYN+ACK packet (i.e., a TCP response packet) in response. The server enters the SYN_RCVD state to indicate that it is ready to establish a connection with the client.

S908、手机的Wi-Fi芯片接收来自TCP服务器的TCP响应报文,并通过Wi-Fi驱动向TCP/IP协议栈发送该TCP响应报文。S908. The Wi-Fi chip of the mobile phone receives the TCP response message from the TCP server, and sends the TCP response message to the TCP/IP protocol stack through the Wi-Fi driver.

S909、手机的TCP/IP协议栈响应于TCP响应报文,生成第九报文。S909. The TCP/IP protocol stack of the mobile phone generates a ninth message in response to the TCP response message.

其中,第九报文可以为手机与TCP服务器进行三次交互过程中,手机最后一次向TCP服务器发送的第三次TCP握手报文。The ninth message may be the third TCP handshake message sent by the mobile phone to the TCP server during the three interactions between the mobile phone and the TCP server.

该第三次TCP握手报文中包括有ACK字段、seq和ack字段。ACK字段=1,seq=x+1,ack字段=y+1。ACK字段=1表示手机接收到了TCP响应报文,且同意建立TCP连接;seq=x+1表示手机当前对应的序列号为x+1;ack字段=y+1则用于表示确认号,其是在TCP服务器发送的TCP响应报文中seq的值上加1得到。This third TCP handshake message includes the ACK field, seq field, and ack field. ACK field = 1, seq = x+1, and ack field = y+1. ACK field = 1 indicates that the phone has received the TCP response message and agrees to establish the TCP connection; seq = x+1 indicates that the phone's current sequence number is x+1; and ack field = y+1 indicates the confirmation number, which is calculated by adding 1 to the seq value in the TCP response message sent by the TCP server.

由于此时手机和TCP服务器都已经同意建立TCP连接,所以此时该第三次TCP握手报文中是可以携带手机具体要发送给TCP服务器的业务数据的,也就是说第三次TCP握手报文中可以包括有多个协议报文。在第三次TCP握手报文中包括有多个协议报文的情况下,TCP服务器是可以及时知晓是否接收到该第三次TCP握手报文的进而执行相应动作的,所以此时的第三次TCP握手报文不应当属于预设协议的信令报文。Since both the mobile phone and the TCP server have agreed to establish a TCP connection, the third TCP handshake message can carry the specific service data that the mobile phone wants to send to the TCP server. In other words, the third TCP handshake message can include multiple protocol messages. When the third TCP handshake message includes multiple protocol messages, the TCP server can promptly know whether it has received the third TCP handshake message and perform the corresponding action. Therefore, the third TCP handshake message at this time should not be a signaling message of the preset protocol.

也就是说,若第三次TCP握手报文未携带业务数据,则可以认为第三次TCP握手报文是预设协议的信令报文;若第三次TCP握手报文携带业务数据,则可以认为第三次TCP握手报文不是预设协议的信令报文。That is to say, if the third TCP handshake message does not carry business data, it can be considered that the third TCP handshake message is a signaling message of the preset protocol; if the third TCP handshake message carries business data, it can be considered that the third TCP handshake message is not a signaling message of the preset protocol.

S910、手机的TCP/IP协议栈向Wi-Fi驱动发送第九报文。S910. The TCP/IP protocol stack of the mobile phone sends a ninth message to the Wi-Fi driver.

第九报文虽然是信令报文,但是该信令报文中可以携带有业务数据的报文,此时该信令报文可以作为数据报文看待,所以第九报文不是本申请中提到的严格意义上的信令报文,不一定需要放在VO队列中发送。Although the ninth message is a signaling message, the signaling message may carry a message containing business data. In this case, the signaling message may be regarded as a data message. Therefore, the ninth message is not a signaling message in the strict sense mentioned in this application and does not necessarily need to be placed in the VO queue to be sent.

S911、手机的Wi-Fi驱动对第九报文进行解析,并基于解析结果判断第九报文是否为预设协议的信令报文。S911. The Wi-Fi driver of the mobile phone parses the ninth message and determines whether the ninth message is a signaling message of a preset protocol based on the parsing result.

在Wi-Fi驱动基于对第九报文进行解析的解析结果,确定第九报文为预设协议的信令报文的情况下,可以将第九报文放入VO队列中进行发送,即执行S912。When the Wi-Fi driver determines that the ninth message is a signaling message of a preset protocol based on the parsing result of the ninth message, the ninth message may be placed in a VO queue for sending, ie, S912 is executed.

在Wi-Fi驱动基于对第九报文进行解析的解析结果,确定第九报文不为预设协议的信令报文的情况下,可以将第九报文放入VO队列以外的传输队列中进行发送,即执行S913。When the Wi-Fi driver determines that the ninth message is not a signaling message of the preset protocol based on the parsing result of the ninth message, the ninth message may be placed in a transmission queue other than the VO queue for sending, that is, S913 is executed.

S911的具体实现可以参照前述实施例中S504的相关表述,此处不再赘述。The specific implementation of S911 can refer to the relevant description of S504 in the above embodiment, and will not be repeated here.

S912、手机的Wi-Fi驱动将第九报文放入VO队列中。S912. The Wi-Fi driver of the mobile phone puts the ninth message into the VO queue.

S913、手机的Wi-Fi驱动将第九报文放入VO队列以外的传输队列中。S913. The Wi-Fi driver of the mobile phone puts the ninth message into a transmission queue other than the VO queue.

示例性的,手机的Wi-Fi驱动可以将不为预设协议的信令报文的第四报文放在BE队列中。Exemplarily, the Wi-Fi driver of the mobile phone may place the fourth message, which is not a signaling message of the preset protocol, in the BE queue.

当然,需要说明的是,由于在手机与TCP服务器进行三次握手建立TCP连接的过程中,最后一次握手的第三次TCP握手报文中是可以携带有多个数据报文的。也就是说,TCP服务器接收该第三次TCP握手报文后,即便其中缺少了内容,TCP服务器也可以根据不同报文的序列号及时确定缺少了什么数据,并及时告知手机重新发送的。所以第九报文可以不属于预设协议的信令报文,所以这里Wi-Fi驱动基于对第九报文解析的解析结果,可以基于此确定第九报文是否为预设协议的信令报文。之后,则根据判断结果决定执行S911还是S912。Of course, it should be noted that, during the three-way handshake between the mobile phone and the TCP server to establish a TCP connection, the third TCP handshake message of the last handshake can carry multiple data messages. That is to say, after the TCP server receives the third TCP handshake message, even if there is missing content in it, the TCP server can promptly determine what data is missing based on the sequence numbers of different messages, and promptly inform the mobile phone to resend it. Therefore, the ninth message may not be a signaling message of the preset protocol, so here the Wi-Fi driver can determine whether the ninth message is a signaling message of the preset protocol based on the parsing result of the ninth message. Afterwards, it is decided to execute S911 or S912 based on the judgment result.

S914、手机的Wi-Fi驱动按照预设的队列报文发送规则,通过Wi-Fi芯片向TCP服务器发送该第九报文。S914. The Wi-Fi driver of the mobile phone sends the ninth message to the TCP server through the Wi-Fi chip according to the preset queue message sending rule.

具体的,此时手机与TCP服务器可以认为已经建立了TCP连接,手机的Wi-Fi芯片可以按照TCP协议向TCP服务器发送第九报文。Specifically, at this time, the mobile phone and the TCP server can be considered to have established a TCP connection, and the Wi-Fi chip of the mobile phone can send the ninth message to the TCP server according to the TCP protocol.

手机在向TCP服务器发送了第九报文后,可以处于ESTABLISHED(已建立连接)状态,该状态用于表示客户端已经接收到了服务器发送的SYN+ACK报文(即TCP响应报文),并发送了一个ACK报文(即第九报文)作为确认。此时,客户端和服务器之间的连接已经建立成功,双方可以开始进行数据传输。After the mobile phone sends the ninth message to the TCP server, it enters the ESTABLISHED state, which indicates that the client has received the SYN+ACK message (i.e., the TCP response message) sent by the server and sent an ACK message (i.e., the ninth message) as confirmation. At this point, the connection between the client and the server has been successfully established, and both parties can begin data transmission.

S915、TCP服务器接收来自手机的第九报文。S915. The TCP server receives the ninth message from the mobile phone.

TCP服务器在接收到来自手机的第九报文后,则也处于ESTABLISHED(已建立连接)状态。After receiving the ninth message from the mobile phone, the TCP server is also in the ESTABLISHED (connection established) state.

在S915后可以确定手机与TCP服务器已经建立了完整的TCP连接,之后手机则可以基于该TCP连接正常访问TCP服务器,完成上网的目的。After S915, it can be determined that a complete TCP connection has been established between the mobile phone and the TCP server. After that, the mobile phone can normally access the TCP server based on the TCP connection to complete the purpose of surfing the Internet.

基于上述TCP数据传输流程,手机可以将TCP对应的所有信令报文放在传输优先级高的第一优先级传输队列如VO队列中进行传输。而由于Wi-Fi场景下,传输优先级高的队列中的报文抢占信道能力更强,传输成功率更高。这样一来,即便空口环境不够好(即空口信号受到干扰或者空口信号较差),TCP数据传输流程中的信令报文也可以更为可靠的被发送出去(可以理解为接收方成功的接收到该信令报文的概率更高),进而可以使得手机与TCP服务器顺利完成TCP数据传输流程,后续手机则可以基于通过该流程创建的TCP连接,顺利进行上网。避免了预设协议的信令报文因空口环境不够好从而未成功发送(可以理解为接收方未能成功接收到该信令报文),导致用户在使用该电子设备通过Wi-Fi网络上网时出现连接卡顿、延迟或失败,保障了用户的上网体验。Based on the above TCP data transmission process, the mobile phone can place all signaling messages corresponding to TCP in the first-priority transmission queue with the highest transmission priority, such as the VO queue, for transmission. In Wi-Fi scenarios, messages in the queue with the highest transmission priority have a stronger ability to seize the channel, resulting in a higher transmission success rate. This allows the signaling messages in the TCP data transmission process to be sent more reliably (this can be understood as the probability of the receiver successfully receiving the signaling message) even in a less-than-optimal air interface environment (i.e., air interface signal interference or poor air interface signal). This allows the mobile phone and the TCP server to successfully complete the TCP data transmission process, and the mobile phone can subsequently access the Internet smoothly based on the TCP connection established through this process. This prevents signaling messages of the preset protocol from being successfully sent due to a less-than-optimal air interface environment (this can be understood as the receiver failing to successfully receive the signaling message), resulting in connection freezes, delays, or failures when the user uses the electronic device to access the Internet via a Wi-Fi network, thereby ensuring the user's Internet experience.

在本申请实施例中,手机生成的第一报文、第二报文、第三报文、第四报文、第五报文、第六报文、第七报文、第八报文和第九报文均可以称为待发送的第一协议报文。作为AP的路由器、DHCP服务器、作为网关的路由器、DNS服务器和TCP服务器可以称为目标设备。In the embodiments of the present application, the first message, the second message, the third message, the fourth message, the fifth message, the sixth message, the seventh message, the eighth message, and the ninth message generated by the mobile phone may all be referred to as first protocol messages to be sent. The router acting as an AP, the DHCP server, the router acting as a gateway, the DNS server, and the TCP server may be referred to as target devices.

可以理解的是,上述电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and/or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

本申请实施例可以根据上述方法示例对上述电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

在采用对应各个功能划分各个功能模块的情况下,本申请实施例还提供了一种数据传输装置,该装置可以应用于处于Wi-Fi网络的电子设备中。该装置可以包括处理模块和发送模块。In the case of dividing each functional module according to each function, the embodiment of the present application further provides a data transmission device, which can be applied to an electronic device in a Wi-Fi network. The device can include a processing module and a sending module.

其中,处理模块,用于在待发送的第一协议报文为信令报文的情况下,将第一协议报文加入第一优先级传输队列中;处理模块还用于在第一协议报文不为预设协议的信令报文的情况下,将第一协议报文加入第二优先级传输队列;第二优先级传输队列与第一优先级传输队列不同;预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP;发送模块,用于按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送第一协议报文;预设队列报文发送规则包括第一优先级传输队列的传输优先级高于第二优先级传输队列的传输优先级。Among them, the processing module is used to add the first protocol message to the first priority transmission queue when the first protocol message to be sent is a signaling message; the processing module is also used to add the first protocol message to the second priority transmission queue when the first protocol message is not a signaling message of the preset protocol; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP; the sending module is used to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue.

此外,处理模块和发送模块的配合,还可以使得数据传输装置完成前述实施例中提供的数据传输方法中的所有步骤。In addition, the cooperation between the processing module and the sending module can also enable the data transmission device to complete all the steps of the data transmission method provided in the aforementioned embodiment.

关于上述实施例中的数据传输装置,其中各个模块执行操作的具体方式已经在前述实施例中的数据传输方法的实施例中进行了详细描述,此处不再具体阐述。其相关的有益效果也可参照前述数据传输方法的相关有益效果,此处不再赘述。Regarding the data transmission device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the data transmission method in the above embodiment, and will not be further elaborated here. The relevant beneficial effects thereof can also be referred to the relevant beneficial effects of the above data transmission method, and will not be repeated here.

本申请实施例还提供一种电子设备,该电子设备包括:显示屏、存储器和一个或多个处理器;显示屏、存储器与处理器耦合;其中,存储器中存储有计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被处理器执行时,使得电子设备执行如前述实施例提供的丢帧故障确定方法。该电子设备的具体结构可参照图3中所示的电子设备的结构。An embodiment of the present application further provides an electronic device comprising: a display screen, a memory, and one or more processors; the display screen, the memory, and the processors being coupled; wherein the memory stores computer program code, the computer program code comprising computer instructions, which, when executed by the processor, causes the electronic device to execute the frame loss fault determination method provided in the aforementioned embodiment. The specific structure of the electronic device can be referenced with reference to the electronic device structure shown in FIG3 .

本申请实施例还提供一种电子设备,该电子设备包括:TCP/IP协议栈、Wi-Fi驱动和Wi-Fi芯片;Wi-Fi驱动执行计算机指令时,使得电子设备执行如前述实施例提供的数据传输方法。其中,TCP/IP协议栈、Wi-Fi驱动具体可以为电子设备中SOC中AP中的软件模块。The present application also provides an electronic device comprising a TCP/IP protocol stack, a Wi-Fi driver, and a Wi-Fi chip. When the Wi-Fi driver executes computer instructions, the electronic device executes the data transmission method provided in the aforementioned embodiment. Specifically, the TCP/IP protocol stack and the Wi-Fi driver may be software modules within an AP within a SOC within the electronic device.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如前述实施例提供的数据传输方法。An embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the data transmission method provided in the aforementioned embodiment.

本申请实施例还提供一种计算机程序产品,该计算机程序产品包含可执行指令,当该计算机程序产品在电子设备上运行时,使得电子设备执行如前述实施例提供的数据传输方法。An embodiment of the present application further provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the data transmission method provided in the aforementioned embodiment.

本申请实施例还提供一种芯片系统,如图10所示,该芯片系统1000包括至少一个处理器1001、存储器和至少一个接口电路1002。处理器1001和接口电路1002可通过线路互联。例如,接口电路1002可用于从其它装置(例如目标设备)接收信号。又例如,接口电路1002可用于向其它装置(例如目标设备)发送信号。The present application also provides a chip system, as shown in FIG10 . The chip system 1000 includes at least one processor 1001, a memory, and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via a line. For example, the interface circuit 1002 can be used to receive signals from another device (e.g., a target device). For another example, the interface circuit 1002 can be used to send signals to another device (e.g., a target device).

示例性的,接口电路1002可读取存储器中存储的指令或计算机程序,并将该指令或计算机程序发送给处理器1001。当指令或计算机程序被处理器1001执行时,可实现上述实施例中提供的数据传输方法的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。For example, the interface circuit 1002 can read instructions or computer programs stored in the memory and send the instructions or computer programs to the processor 1001. When the instructions or computer programs are executed by the processor 1001, the various steps of the data transmission method provided in the above embodiment can be implemented. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiments of the present application.

在一些实施例中,参照图11所示,芯片系统中的处理器可以包括SOC和Wi-Fi芯片,SOC中可以包括应用处理器AP,AP中则可以包括TCP/IP协议栈、Wi-Fi驱动。该TCP/IP协议栈、Wi-Fi驱动具体可以为软件模块。该Wi-Fi驱动执行计算机指令时,使得芯片系统所属的电子设备执行如前述实施例中提供的的数据传输方法。In some embodiments, as shown in FIG11 , the processor in the chip system may include a SOC and a Wi-Fi chip. The SOC may include an application processor AP, and the AP may include a TCP/IP protocol stack and a Wi-Fi driver. The TCP/IP protocol stack and the Wi-Fi driver may specifically be software modules. When the Wi-Fi driver executes computer instructions, the electronic device to which the chip system belongs executes the data transmission method provided in the aforementioned embodiments.

通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices/equipment and methods can be implemented in other ways. For example, the device/equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program code.

以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims (10)

一种数据传输方法,其特征在于,所述方法包括:A data transmission method, characterized in that the method comprises: 电子设备在待发送的第一协议报文为预设协议的信令报文的情况下,将所述第一协议报文加入第一优先级传输队列中;When the first protocol message to be sent is a signaling message of a preset protocol, the electronic device adds the first protocol message to a first priority transmission queue; 所述电子设备在所述第一协议报文不为所述预设协议的信令报文的情况下,将所述第一协议报文加入第二优先级传输队列;所述第二优先级传输队列与所述第一优先级传输队列不同;所述预设协议包括以下任一项或多项:EAPOL、DHCP、ARP、DNS或TCP;The electronic device adds the first protocol message to a second priority transmission queue when the first protocol message is not a signaling message of the preset protocol; the second priority transmission queue is different from the first priority transmission queue; the preset protocol includes any one or more of the following: EAPOL, DHCP, ARP, DNS or TCP; 所述电子设备按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送所述第一协议报文;所述预设队列报文发送规则包括所述第一优先级传输队列的传输优先级高于所述第二优先级传输队列的传输优先级。The electronic device sends the first protocol message to the target device through the Wi-Fi network according to a preset queue message sending rule; the preset queue message sending rule includes that the transmission priority of the first priority transmission queue is higher than the transmission priority of the second priority transmission queue. 根据权利要求1所述的方法,其特征在于,所述电子设备包括Wi-Fi驱动;所述电子设备在待发送的所述第一协议报文为所述预设协议的信令报文的情况下,将所述第一协议第一协议报文加入所述第一优先级传输队列中,包括:The method according to claim 1, wherein the electronic device includes a Wi-Fi driver; and when the first protocol message to be sent is a signaling message of the preset protocol, the electronic device adds the first protocol message to the first priority transmission queue, comprising: 所述Wi-Fi驱动对所述第一协议报文进行解析,并在基于解析结果确定所述第一协议报文为所述预设协议的信令报文的情况下,将所述第一协议报文加入第一优先级传输队列中。The Wi-Fi driver parses the first protocol message, and when determining based on the parsing result that the first protocol message is a signaling message of the preset protocol, adds the first protocol message to a first priority transmission queue. 根据权利要求1或2所述的方法,其特征在于,所述预设协议的信令报文包括以下至少一项:可扩展的局域网认证协议EAPOL四次握手过程中的第二次握手报文、EAPOL四次握手过程中的第四次握手报文、动态主机配置协议DHCP DISCOVER报文、DHCP REQUEST报文、地址解析协议ARP请求报文、域名系统DNS请求报文、传输控制协议TCP三次握手过程中的第一次TCP握手报文、TCP三次握手过程中的未携带业务数据的第三次TCP握手报文;The method according to claim 1 or 2, characterized in that the signaling message of the preset protocol includes at least one of the following: the second handshake message in the four-way handshake process of Extensible Authentication Protocol for Local Area Networks (EAPOL), the fourth handshake message in the four-way handshake process of EAPOL, a Dynamic Host Configuration Protocol (DHCP) DISCOVER message, a DHCP REQUEST message, an Address Resolution Protocol (ARP) request message, a Domain Name System (DNS) request message, the first TCP handshake message in the three-way handshake process of Transmission Control Protocol (TCP), and the third TCP handshake message in the three-way handshake process of TCP that does not carry business data; 其中,所述ARP请求报文用于请求网关的物理地址MAC;所述DNS请求报文用于请求目标域名对应的互联网协议地址IP;所述第一次TCP握手报文用于请求建立TCP连接。The ARP request message is used to request the physical address MAC of the gateway; the DNS request message is used to request the Internet Protocol address IP corresponding to the target domain name; and the first TCP handshake message is used to request the establishment of a TCP connection. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一优先级传输队列为语音优化VO队列。The method according to any one of claims 1 to 3, characterized in that the first priority transmission queue is a voice optimized VO queue. 根据权利要求1-4任一项所述的方法,其特征在于,所述第二优先级传输队列包括以下任一项:视频优化VI队列、尽力而为BE队列或背景优化BK队列。The method according to any one of claims 1 to 4, characterized in that the second priority transmission queue includes any one of the following: a video optimized VI queue, a best effort BE queue, or a background optimized BK queue. 根据权利要求1-5任一项所述的方法,其特征在于,在所述第一协议报文不为所述预设协议的信令报文的情况下,所述第一协议报文包括:TCP三次握手过程中的携带了业务数据的第三次TCP握手报文。The method according to any one of claims 1 to 5 is characterized in that, when the first protocol message is not a signaling message of the preset protocol, the first protocol message includes: a third TCP handshake message carrying business data in a TCP three-way handshake process. 根据权利要求1-6任一项所述的方法,其特征在于,所述电子设备包括TCP/IP协议栈和Wi-Fi芯片;所述第一协议报文为所述TCP/IP协议栈生成的报文;The method according to any one of claims 1 to 6, wherein the electronic device comprises a TCP/IP protocol stack and a Wi-Fi chip; the first protocol message is a message generated by the TCP/IP protocol stack; 所述电子设备按照预设队列报文发送规则,通过Wi-Fi网络向目标设备发送所述第一协议报文,包括:所述电子设备按照预设队列报文发送规则,控制所述Wi-Fi芯片通过Wi-Fi网络向目标设备发送所述第一协议报文。The electronic device sends the first protocol message to the target device through the Wi-Fi network according to a preset queue message sending rule, including: the electronic device controls the Wi-Fi chip to send the first protocol message to the target device through the Wi-Fi network according to the preset queue message sending rule. 一种电子设备,其特征在于,包括:显示屏、存储器和一个或多个处理器;所述显示屏、所述存储器与所述处理器耦合;其中,所述存储器中存储有计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1-7任一项所述的数据传输方法。An electronic device, characterized in that it includes: a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; wherein the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the data transmission method according to any one of claims 1 to 7. 一种电子设备,其特征在于,包括TCP/IP协议栈、Wi-Fi驱动和Wi-Fi芯片;所述Wi-Fi驱动执行计算机指令时,使得所述电子设备执行如权利要求1-7任一项所述的数据传输方法。An electronic device, characterized in that it includes a TCP/IP protocol stack, a Wi-Fi driver and a Wi-Fi chip; when the Wi-Fi driver executes computer instructions, the electronic device executes the data transmission method according to any one of claims 1 to 7. 一种芯片系统,其特征在于,所述芯片系统包括处理器,当所述处理器执行计算机指令时,使得所述芯片系统所在的电子设备执行如权利要求1-7中任一项所述的数据传输方法。A chip system, characterized in that the chip system includes a processor, and when the processor executes computer instructions, the electronic device where the chip system is located executes the data transmission method according to any one of claims 1 to 7.
PCT/CN2025/076449 2024-02-09 2025-02-08 Data transmission method and apparatus, electronic device, and storage medium Pending WO2025168105A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410179000.6 2024-02-09
CN202410179000.6A CN120512765A (en) 2024-02-09 2024-02-09 Data transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2025168105A1 true WO2025168105A1 (en) 2025-08-14

Family

ID=96699241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/076449 Pending WO2025168105A1 (en) 2024-02-09 2025-02-08 Data transmission method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN120512765A (en)
WO (1) WO2025168105A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080318630A1 (en) * 2007-06-25 2008-12-25 Qualcomm Incorporated Graceful coexistence for multiple communication protocols
CN108990115A (en) * 2018-07-16 2018-12-11 鼎桥通信技术有限公司 A method of in trunked communication system multi-core network group guaranteed qos off the net
CN111131061A (en) * 2019-12-30 2020-05-08 中国联合网络通信集团有限公司 A data transmission method and network device
CN111328148A (en) * 2020-03-11 2020-06-23 展讯通信(上海)有限公司 Data transmission method and device
CN114430591A (en) * 2020-10-14 2022-05-03 华为技术有限公司 Wi-Fi chip, Wi-Fi equipment and queue scheduling method
CN114501532A (en) * 2020-10-28 2022-05-13 华为技术有限公司 Service message sending method and device
CN114979023A (en) * 2022-07-26 2022-08-30 浙江大华技术股份有限公司 Data transmission method, system, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080318630A1 (en) * 2007-06-25 2008-12-25 Qualcomm Incorporated Graceful coexistence for multiple communication protocols
CN108990115A (en) * 2018-07-16 2018-12-11 鼎桥通信技术有限公司 A method of in trunked communication system multi-core network group guaranteed qos off the net
CN111131061A (en) * 2019-12-30 2020-05-08 中国联合网络通信集团有限公司 A data transmission method and network device
CN111328148A (en) * 2020-03-11 2020-06-23 展讯通信(上海)有限公司 Data transmission method and device
CN114430591A (en) * 2020-10-14 2022-05-03 华为技术有限公司 Wi-Fi chip, Wi-Fi equipment and queue scheduling method
CN114501532A (en) * 2020-10-28 2022-05-13 华为技术有限公司 Service message sending method and device
CN114979023A (en) * 2022-07-26 2022-08-30 浙江大华技术股份有限公司 Data transmission method, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN120512765A (en) 2025-08-19

Similar Documents

Publication Publication Date Title
EP4007374B1 (en) Information processing method and apparatus, communication device and storage medium
AU2014269271B2 (en) Electronic device using logical channels for communication
CN114697929B (en) Connection establishment method and electronic device
CN113014483B (en) Multi-path transmission method and equipment
CN111447678B (en) Communication method and communication device
TWI836053B (en) System and method for construction of a protocol data unit using selective relay
WO2021104448A1 (en) Method for synchronizing key information, system and device
AU2020470364B2 (en) Method and apparatus for establishing secure communication
CN113938880B (en) Application verification method and device
JP6149591B2 (en) Wireless relay device, communication system, and communication method
CN106714170A (en) Projection device, user terminal, and method for accessing projection device into local area network
US20220286731A1 (en) Multimedia apparatus and cast method
WO2023273464A1 (en) Data transmission method and electronic device
CN115529255A (en) A connection detection method, client and server
WO2025168105A1 (en) Data transmission method and apparatus, electronic device, and storage medium
CN115696463B (en) Multi-terminal joint session management method, network equipment and terminal
CN114095524B (en) Method and device for transmitting message, central hub device and readable storage medium
CN113891310B (en) Cooperative communication method, user equipment and system
WO2023124258A1 (en) Method and apparatus for remotely accessing subscriber identity module (sim) card
CN117939406A (en) Multicast communication method and related device
CN119922042B (en) Data transmission method, device, medium, equipment and product
JP2014112370A (en) Method for routing message
CN120434449A (en) Screen projection method and terminal device
WO2025025875A1 (en) Wi-fi peer-to-peer connection establishment method and apparatus
CN119835003A (en) IPSec flow triggering method and device, electronic equipment and storage medium

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

Country of ref document: EP

Kind code of ref document: A1