Method, device, storage medium and WiFi device for sending WiFi data
Patent Information
- Application Number
- CN202510717158.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2045-05-30
AI Technical Summary
[0005]本申请实施例提供了WiFi数据的发送方法、装置、存储介质及WiFi设备,可以解决现有技术中WiFi设备发送数据帧可靠性和效率不高的问题
[0019]通过发送测试帧并监测ACK帧的接收情况,设备能够实时感知信道质量变化。若初始MCS序号过高导致测试帧传输失败,设备会逐步降低MCS序号,直至找到适合当前信道条件的调制编码方案。WiFi设备仅在确认信道能够支持当前MCS序号对应的传输速率时才进行数据帧发送,显著降低了因信道质量不匹配导致的传输失败率。
Smart Images

Figure CN120583541B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication, and in particular to a method, apparatus, storage medium and WiFi device for transmitting WiFi data. Background Technology
[0002] Before sending data frames, WiFi devices typically use a Carrier Sense Multiple Access / Collision Avoidance (CSMA / CA) mechanism to access the wireless channel. See also Figure 1 The process of sending data frames is as follows: When a WiFi device has data frames to send, it first performs a Channel Clearance Assessment (CCA) to determine if the current channel is idle. If the channel is idle, the device enters a channel reservation process by sending a Request to Send (RTS) frame to reserve the channel. If the receiving device correctly receives the RTS frame and confirms that the channel is available, it will reply with a Clear to Send (CTS) frame as a response. After receiving the CTS frame, the sending device considers the channel reservation successful and sends data frames within the reserved time, while waiting for a response frame from the receiving device. After all data frames to be sent have been sent, the sending device sends a Channel Release (CF-END) frame to release the channel, thus completing the entire data frame transmission process.
[0003] However, existing WiFi technologies have significant limitations when handling scenarios with frequent changes in channel quality. In a wireless environment, channel quality can be affected by various factors, such as multipath effects, interference sources, and device movement, causing significant changes in channel quality within a short period. When a WiFi device sends a reservation frame (such as an RTS frame), the channel quality may be good, thus successfully reserving a channel. However, during subsequent data frame transmission, due to the rapid deterioration of channel quality, the data frame may fail to reach the receiving device, resulting in data transmission failure.
[0004] Therefore, in order to address the shortcomings of existing WiFi technology in scenarios with frequent changes in channel quality, a new technical solution is urgently needed to optimize the data frame transmission process of WiFi devices and improve the reliability and efficiency of data transmission. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and WiFi device for transmitting WiFi data, which can solve the problems of low reliability and efficiency in transmitting data frames by WiFi devices in the prior art. The technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for transmitting WiFi data, the method comprising:
[0007] When a data frame to be sent is detected, CCA is performed on the current channel. If the current channel is assessed to be in an idle state based on the CCA result, the initial MCS sequence number of the data frame is obtained.
[0008] A test frame is sent based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful.
[0009] If the ACK frame corresponding to the test frame is not received within a preset time, the initial MCS sequence number is reduced according to a preset rule, and the current channel is re-reserved based on the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal;
[0010] The total duration of the data frame is calculated based on the MCS sequence number at the time of successful reservation, and the data frame is transmitted within the total duration according to the modulation and coding scheme indicated by the MCS.
[0011] Secondly, embodiments of this application provide a WiFi data transmission device, the device comprising:
[0012] The detection unit is used to perform CCA on the current channel when a data frame to be sent is detected. If the current channel is assessed to be in an idle state based on the CCA result, the initial MCS sequence number of the data frame is obtained.
[0013] The reservation unit is used to send a test frame based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful.
[0014] The reservation unit is further configured to, if no ACK frame corresponding to the test frame is received within a preset time, reduce the initial MCS sequence number according to a preset rule, and re-reserve the current channel according to the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal.
[0015] The transmitting unit is configured to calculate the total duration of the data frame based on the MCS sequence number when the reservation is successful, and to transmit the data frame within the total duration according to the modulation and coding scheme indicated by the MCS.
[0016] Thirdly, embodiments of this application provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.
[0017] Fourthly, embodiments of this application provide a WiFi device, which may include: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and to execute the above-described method steps.
[0018] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following:
[0019] By sending test frames and monitoring the reception of ACK frames, the device can detect changes in channel quality in real time. If the initial MCS sequence number is too high, causing test frame transmission failure, the device will gradually lower the MCS sequence number until a modulation and coding scheme suitable for the current channel conditions is found. The WiFi device only sends data frames when it confirms that the channel can support the transmission rate corresponding to the current MCS sequence number, significantly reducing the transmission failure rate caused by channel quality mismatch. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 It is a timing diagram of the transmitted data frames provided by existing technology;
[0022] Figure 2 This is a flowchart illustrating the WiFi data transmission method provided in an embodiment of this application;
[0023] Figure 3A This is a timing diagram of the reservation channel provided in the embodiments of this application;
[0024] Figure 3B This is another timing diagram of the reservation channel provided in the embodiments of this application.
[0025] Figure 4 This is a schematic diagram of the structure of a WiFi data transmission device provided in this application;
[0026] Figure 5 This is a schematic diagram of the structure of a WiFi device provided in this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0028] Please see Figure 2This is a flowchart illustrating a method for sending WiFi data according to an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps:
[0029] S201. When a data frame to be sent is detected, perform CCA on the current channel. If the current channel is assessed to be in an idle state based on the CCA result, obtain the initial MCS sequence number of the data frame.
[0030] When a WiFi device detects a data frame to send, it first performs a Channel Clearance Assessment (CCA) on the current channel. Channel Clearance Assessment is performed through the RF front-end circuitry of the physical layer (PHY). The device monitors the energy level and signal characteristics of the channel to determine if other devices are transmitting. CCA typically combines Energy Detection (ED) and Carrier Sense (CS) mechanisms: Energy Detection quickly identifies the total energy in the channel, while Carrier Sense analyzes the signal type (e.g., whether it is a legitimate Wi-Fi signal). If, within the preset CCA detection time, the energy on the channel is below the set ED threshold and no valid Wi-Fi signal is detected, the device determines that the current channel is idle. At this point, the device selects an initial MCS number based on its transmission capabilities (e.g., supported MCS range) and channel conditions (e.g., signal-to-noise ratio, SNR). The selection of the initial MCS number is usually based on the device's historical transmission experience or a preset default value, aiming to balance transmission rate and reliability.
[0031] For example, suppose a WiFi device needs to send a video stream data frame. The device first performs CCA (Clear Channel Assessment), detects that the current channel energy is below -82dBm for 10 consecutive microseconds, and no preamble of other Wi-Fi signals is parsed, therefore determining that the channel is idle. Based on its supported MCS range (e.g., MCS 0 to MCS 11) and the current signal-to-noise ratio (e.g., 20dB), the device selects an initial MCS sequence number of MCS 7 (corresponding to 64-QAM modulation and 3 / 4 coding rate) to achieve a higher transmission rate.
[0032] In some embodiments of this application, in a WiFi device, a buffer is a key component for temporarily storing data frames to be sent. The device uses flags in hardware registers (such as Buffer_Not_Empty) or software-maintained variables (such as a counter) to track the number of data frames in the buffer in real time. The device may periodically poll the buffer status (e.g., check every 10ms) or sense changes in the buffer status in real time through hardware interrupt mechanisms (e.g., triggering an interrupt when a data frame arrives at the buffer).
[0033] When the device detects that the buffer is not empty, it executes the following logic to determine whether there is a data frame to be sent in the buffer:
[0034] The device maintains a pointer (e.g., a Head pointer) to the first data frame to be sent in the buffer, or a counter (e.g., Frame_Count) to record the number of data frames in the buffer. If the Head pointer does not point to an empty position in the buffer (or Frame_Count > 0), it indicates that there is a data frame to be sent in the buffer. The device may further verify the validity of the data frames (e.g., checksum, frame length validity) to ensure that the data frames in the buffer can be sent correctly. In multi-task concurrent scenarios (e.g., processing data streams from multiple applications simultaneously), the device can achieve fair scheduling and efficient transmission of data frames through buffer status monitoring.
[0035] S202. Send a test frame based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful.
[0036] After determining the initial MCS sequence number, the WiFi device constructs a test frame based on the modulation and coding scheme (such as modulation method and coding rate) corresponding to that sequence number. The test frame is typically a short data packet containing necessary header information and pseudo-data, used to quickly verify the transmission reliability of the channel under the current MCS. The device sends the test frame to the channel through the physical layer and starts a preset ACK timeout timer. If the receiving device (such as an access point (AP) correctly receives the test frame, it will reply with an ACK frame after a short inter-frame interval (SIFS) as confirmation. If the sending device receives the ACK frame before the ACK timeout timer expires, it indicates that the channel transmission is reliable under the current MCS, and the channel reservation is successful. At this point, the device will use the MCS sequence number to transmit subsequent data frames.
[0037] For example, see Figure 3A The schematic diagram shows that when the WiFi device performs CCA and detects that the current channel is idle, it sends a test frame TX NULL-DATA based on the initial MCS sequence number = MCS_i. The receiving AP replies with an ACK frame after SIFS (16 microseconds). The device receives the ACK frame within the ACK timeout timer (e.g., 50 microseconds), confirming that the channel reservation was successful, and records the current MCS sequence number as MCS_i.
[0038] In some embodiments of this application, in WiFi devices, the test frame is designed as a lightweight empty data frame for quickly verifying the transmission reliability of the channel under the current modulation and coding scheme (MCS). Its core feature lies in the simplification of the frame structure.
[0039] 1. Setting the field values for frame type and subtype identifiers.
[0040] A PV_TYPE field value of 10 indicates that the frame is a control frame, not a data or management frame. Control frames are typically used for channel management, power saving, and other mechanisms, and have a higher transmission priority.
[0041] A PV_SUBTYPE field value of 0100 further identifies this control frame as a variant of a Null DataFrame (NDF), i.e., a test frame. Null DataFrames are used in the standard 802.11 protocol to maintain association status or trigger power-saving modes, but here they are redefined as test frames by a specific value (0100) in the subtype field to support channel reservation verification functionality.
[0042] 2. Simplified frame structure:
[0043] The Address4 field is omitted: In traditional 802.11 frames, the Address4 field is used to support multi-hop transmission in distributed systems (DS). Since test frames are only used for single-hop channel verification and do not require support for multi-hop routing, this field is omitted to reduce frame length.
[0044] Omit the QoS Control field: The QoS Control field is used to identify service priority (such as AC_VO, AC_VI, etc.), but test frames do not carry actual data and do not need QoS marking, so it is omitted to reduce overhead.
[0045] The HT Control field is omitted: The HT Control field is used for extended control in high-throughput (HT) mode (such as block acknowledgments, MIMO feedback, etc.). The test frame does not involve complex control functions, so this field is omitted.
[0046] Omit Frame Body: Test frames do not need to carry data content, so the frame body is completely omitted, and only the necessary frame header and frame check sequence (FCS) are retained.
[0047] The process of generating and sending test frames is explained below:
[0048] Fill in the Frame Control field, setting PV_TYPE = 10 (control frame) and PV_SUBTYPE = 0100 (test frame). Fill in the Duration field, specifying the Network Allocation Vector (NAV) value to reserve channel time. Fill in the Receiver Address (RA) and Sender Address (TA) to identify the communicating parties. Skip the Frame Body padding and directly append the FCS field for integrity verification. Map the test frame to physical layer symbols according to the modulation and coding scheme corresponding to the current MCS sequence number and send it.
[0049] S203. If the ACK frame corresponding to the test frame is not received within a preset time, the initial MCS sequence number is reduced according to a preset rule, and the current channel is re-reserved according to the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal.
[0050] If no ACK frame is received after the ACK timeout expires, the WiFi device will determine that the transmission under the current MCS sequence number is unreliable. At this point, the device will lower the MCS sequence number according to preset rules to select a more robust modulation and coding scheme. The lowering rule can be a step-by-step decrease (e.g., decreasing by one sequence number each time) or a dynamic adjustment based on channel quality feedback. The device will reconstruct a test frame using the lowered MCS sequence number and repeat the channel reservation process. This process will continue until the device receives an ACK frame (reservation successful) or the MCS sequence number drops to a preset minimum value (e.g., MCS 0, corresponding to BPSK modulation and 1 / 2 coding rate). If the MCS sequence number has dropped to the minimum value and no ACK frame is received, the device will abandon the current channel and execute a backoff algorithm to re-compete for the channel.
[0051] For example, see Figure 3B As shown in the schematic diagram, after the WiFi device initially sent a test frame using MCS_i, it did not receive an ACK frame. Therefore, it lowered the MCS_i to MCS_i-1. After sending the test frame again and still not receiving an ACK frame, it further lowered the MCS_i to MCS_i-2. Finally, the device successfully received an ACK frame under MCS_i-2, confirming the successful channel reservation.
[0052] In some embodiments of this application, if the current channel reservation fails (i.e., the ACK frame corresponding to the test frame is not received within a preset time period) during the process of the WiFi device performing channel reservation, the device will dynamically adjust the MCS sequence number according to the supplementary rules.
[0053] The specific rules are as follows:
[0054] The WiFi device maintains a failure counter to record the number of consecutive channel reservation failures. Every n reservation failures (n is an integer greater than or equal to 1), the device decrements the current MCS number by 1. For example, if n = 2, the MCS number decreases by one level after every two reservation failures. When the MCS number drops to a preset minimum value (e.g., MCS 0), the device will stop decreasing the MCS number and may implement other strategies (such as a backoff algorithm or abandoning the current channel).
[0055] When a WiFi device dynamically adjusts its MCS serial number, it will follow these steps:
[0056] Upon initial reservation failure, the device initializes the failure counter to 1 and records the current MCS sequence number. After each reservation failure, the device checks if the failure counter has reached n times. If not, the counter value is incremented; if it has, the MCS sequence number is decremented. When the failure counter reaches n times, the device decrements the current MCS sequence number by 1 and resets the failure counter to 0 (or retains the counter state as needed to support more complex strategies). The device reconstructs the test frame using the decremented MCS sequence number and repeats the channel reservation process.
[0057] It should be noted that dynamic adjustment is only triggered when channel reservation fails, and the number of failures must meet the threshold condition of n.
[0058] When the MCS number decreases to the minimum value (e.g., MCS 0), the device stops the decrementing operation and may implement other strategies (such as switching to a backup channel or extending the backoff time). To avoid counter overflow, the device can set a maximum failure limit (e.g., 10 times). After exceeding the limit, the device will force the lowest MCS number to be used or abandon the channel.
[0059] This embodiment reduces the MCS number after every n failures, enabling the device to dynamically adjust its transmission strategy when channel quality fluctuates. For example, when channel quality is poor, the device may experience frequent reservation failures, but by reducing the MCS number (e.g., from MCS 7 to MCS 6) and adopting a more robust modulation and coding scheme (e.g., from 64-QAM to 16-QAM), transmission reliability can be improved.
[0060] Introducing a failure count threshold n prevents the device from prematurely lowering the MCS number during minor channel fluctuations, thus avoiding unnecessary drops in transmission rate. For example, if n=3, the device will only lower the MCS number after three consecutive reservation failures, reducing frequent fluctuations in the MCS number caused by brief interference.
[0061] The dynamic adjustment strategy can flexibly adjust the value of n according to the actual channel environment (such as interference intensity, multipath effect, etc.). In environments with strong interference, a smaller value of n (such as n=1) can be set to reduce the MCS number more quickly; in environments with weak interference, a larger value of n (such as n=5) can be set to maintain a higher transmission rate.
[0062] By dynamically adjusting the MCS number, the device can more quickly find transmission parameters suitable for the current channel conditions, thereby reducing the number of reservation failures and improving channel reservation efficiency. For example, in scenarios where channel quality gradually deteriorates, the device can gradually reduce the MCS number to eventually find an MCS number that can both ensure transmission reliability and maintain a certain data rate.
[0063] For example: Suppose a WiFi device sets n=2 during the channel reservation phase, with an initial MCS number of MCS 7. If the first reservation fails, the failure counter equals 1. If the second reservation fails, the failure counter equals 2, triggering an MCS number decrement (MCS 7 → MCS 6). A re-reservation is then made using MCS 6. If successful, the current MCS number is maintained; if it fails and the failure counter reaches 2 again (i.e., total failures = 4), the MCS number is further decreased (MCS 6 → MCS 5).
[0064] Through the above dynamic adjustment strategy, WiFi devices can quickly adapt to changes in channel quality, balance transmission rate and reliability, and improve overall transmission efficiency.
[0065] S204. Calculate the total duration of the data frame based on the MCS sequence number when the reservation is successful, and send the data frame within the total duration according to the modulation and coding scheme indicated by the MCS.
[0066] After successful channel reservation, the WiFi device calculates the total transmission duration of the data frame based on the final determined MCS sequence number. The calculation is based on the data frame size (in bytes), the physical layer rate corresponding to the MCS sequence number (e.g., Mbps), and necessary protocol overhead (e.g., MAC header, inter-frame interval). The device allocates a continuous transmission period (total duration) to ensure the data frame can be sent completely. During transmission, the device performs physical layer processing according to the modulation and coding scheme indicated by the MCS sequence number, including modulation constellation mapping, channel coding, and interleaving. If the data frame is large, the device may divide it into multiple segments (MPDUs) and send them sequentially within the total duration. After transmission, the device waits for an ACK frame from the receiving device to confirm successful transmission.
[0067] For example: A WiFi device successfully reserves a connection under MCS 4, which corresponds to a physical layer rate of 13.5 Mbps. The device needs to send a 1500-byte data frame, and the total time is calculated to be (1500 × 8) / 13.5 ≈ 889 microseconds (including protocol overhead). The device completes the data frame transmission within 889 microseconds and receives an ACK frame confirming successful transmission.
[0068] In some embodiments of this application, the WiFi device determines the initial MCS sequence number and the maximum MCS sequence number of the data frame, and the specific process includes:
[0069] Before sending data frames, WiFi devices assess the bandwidth requirements of the current transmission task. For example, real-time video streams require high bandwidth (e.g., tens of Mbps) to maintain smooth playback, while text messages or sensor data only require low bandwidth (e.g., hundreds of Kbps). The device determines the initial MCS (Modular Cross Section) number based on the bandwidth requirement: high bandwidth requirements tend to choose higher MCS numbers (e.g., MCS 9-11, corresponding to 256-QAM or higher modulation), while low bandwidth requirements choose lower MCS numbers (e.g., MCS 0-3, corresponding to BPSK or QPSK).
[0070] To avoid transmission failures caused by blindly pursuing high bandwidth, devices set a maximum MCS sequence number threshold based on task requirements. For example, for critical control commands (such as drone flight commands), even if bandwidth requirements are high, the device may limit the maximum MCS sequence number to MCS 7 (64-QAM) to balance speed and reliability.
[0071] WiFi devices continuously monitor channel quality metrics through the physical layer (PHY), including signal-to-noise ratio (SNR), bit error rate (BER), and received signal strength indication (RSSI). For example, if the current SNR is 25 dB and the BER is below 10 dB... -5 The device may select the initial MCS number as MCS 8 (64-QAM, 5 / 6 coding rate); if the SNR drops to 15dB, the initial MCS number may be reduced to MCS4 (16-QAM, 1 / 2 coding rate).
[0072] The device dynamically adjusts the maximum MCS number based on real-time signal quality. For example, when the channel quality is good (e.g., SNR>30dB), the maximum MCS number is allowed to be MCS11 (1024-QAM); when the channel quality deteriorates (e.g., SNR<10dB), the maximum MCS number is limited to MCS3 (QPSK, 1 / 2 coding rate) to avoid a surge in bit error rate caused by higher-order modulation.
[0073] The WiFi device maintains a retransmission counter to record the number of retransmissions or the retransmission rate of recent data frames (e.g., the percentage of retransmitted frames in the past 100 frames). If the retransmission rate exceeds a preset threshold (e.g., 10%), the device may consider the current MCS sequence number too high and need to lower the initial or maximum MCS sequence number. If three consecutive transmissions are retransmitted due to an excessively high MCS sequence number, the device may lower the initial MCS sequence number by 1-2 levels. For example, from MCS 7 to MCS 5. If the retransmission rate remains above the threshold, the device may gradually tighten the maximum MCS sequence number. For example, gradually lowering the maximum MCS sequence number from MCS 9 to MCS 7 until the retransmission rate returns to normal.
[0074] The initial and maximum MCS (Multi-Segment Code) numbers of a WiFi device are determined using a weighted algorithm based on its overall bandwidth requirements, signal quality, and retransmission rate. For example, the weight allocation might be: bandwidth requirement 40%, signal quality 40%, and retransmission rate 20%. If the bandwidth requirement is high (weight score 0.8), signal quality is medium (score 0.6), and retransmission rate is low (score 0.9), then the overall score would be 0.8 × 0.4 + 0.6 × 0.4 + 0.9 × 0.2 = 0.74, corresponding to an initial MCS number of MCS 6 (16-QAM, 3 / 4 coding rate) and a maximum MCS number of MCS 8.
[0075] To prevent frequent changes in the MCS serial number due to parameter fluctuations, the device may set safety boundaries. For example, the initial MCS serial number is always at least two levels lower than the maximum MCS serial number, and the maximum MCS serial number does not exceed the maximum value supported by the device (such as MCS11).
[0076] By dynamically setting the initial and maximum MCS sequence number based on comprehensive bandwidth requirements, signal quality, and retransmission status, WiFi devices can achieve precise adaptive adjustment of transmission parameters.
[0077] In some embodiments of this application, during data frame transmission in a WiFi device, the device pre-configures a Total Duration parameter, which represents the maximum allowed duration of the current transmission cycle (such as the channel occupancy time reserved by NAV). The total duration is typically set based on the following factors:
[0078] Upper-layer protocol requirements: For example, the application layer may require data transmission to be completed within a certain time window (such as the frame interval of a real-time video stream).
[0079] Channel contention strategy: In Distributed Coordination Function (DCF) or Point Coordination Function (PCF) modes, the total duration may be determined by the Network Allocation Vector (NAV) or Contention Window (CW).
[0080] QoS guarantee: For high-priority traffic (such as AC_VO), the total duration may be shorter to reduce congestion of other traffic.
[0081] During the data frame transmission process, the device monitors the cumulative transmission time in real time through an internal timer, which is the time consumed from the transmission of the first data frame to the completion of the current frame transmission.
[0082] When the data frame has finished being sent, the WiFi device will perform the following judgment process:
[0083] The system reads the elapsed time within the current transmission cycle from the internal timer. If the accumulated transmission time equals the total duration, the transmission cycle is considered complete, and no further action is required. If the accumulated transmission time is less than the total duration, the transmission cycle is considered incomplete, and a CF-END frame must be sent to release the channel prematurely.
[0084] The Clear-to-Send End Frame (CF-END) is used to notify other WiFi devices that the current transmission cycle has ended prematurely, allowing them to immediately compete for the channel without waiting for the original NAV timeout. A device only sends a CF-END frame if the accumulated transmission duration is less than the total duration. The CF-END frame is a control frame; its PV_TYPE field in the header is 10, and the PV_SUBTYPE field may have a specific value (such as 0x0C, depending on the protocol implementation). When sending, the device fills the Duration field with 0, indicating immediate channel release, and broadcasts this to all associated devices. If the CF-END frame fails to transmit due to collisions or interference, the device may rely on the NAV timeout mechanism to release the channel, or use a retransmission mechanism to ensure other devices receive the CF-END frame. In this embodiment, by sending a CF-END frame to immediately release the channel when the transmission cycle ends prematurely, other devices are allowed to compete for channel resources, reducing channel idle time and thus improving overall network throughput.
[0085] This application specifically includes the following beneficial effects:
[0086] By sending test frames and monitoring the reception of ACK frames, the device can detect changes in channel quality in real time. If the initial MCS sequence number is too high, causing test frame transmission failure, the device will gradually lower the MCS sequence number until a modulation and coding scheme suitable for the current channel conditions is found. The WiFi device only sends data frames when it confirms that the channel can support the transmission rate corresponding to the current MCS sequence number, significantly reducing the transmission failure rate caused by channel quality mismatch.
[0087] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0088] Please see Figure 4 This illustration shows a schematic diagram of a WiFi data transmission apparatus provided in an exemplary embodiment of this application, hereinafter referred to as apparatus 4. Apparatus 4 can be implemented as all or part of a WiFi device through software, hardware, or a combination of both. Apparatus 4 includes: a detection unit 401, a reservation unit 402, and a transmission unit 403.
[0089] The detection unit 401 is used to perform CCA on the current channel when a data frame to be sent is detected, and to obtain the initial MCS sequence number of the data frame if the current channel is assessed to be in an idle state based on the CCA result.
[0090] The reservation unit 402 is used to send a test frame based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful.
[0091] The reservation unit 402 is further configured to, if no ACK frame corresponding to the test frame is received within a preset time, reduce the initial MCS sequence number according to a preset rule, and re-reserve the current channel according to the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal.
[0092] The transmitting unit 403 is used to calculate the total duration of the data frame based on the MCS sequence number when the reservation is successful, and to transmit the data frame within the total duration according to the modulation and coding scheme indicated by the MCS.
[0093] In one or more possible embodiments, the test frame is an empty data frame, the reservation frame has a PV_TYPE field value of 10 and a PV_SUBTYPE field value of 0100, and the test frame does not include Address4, QoS Control, HTControl, and FrameBody.
[0094] In one or more possible embodiments, the reduction of the initial MCS number according to a preset rule includes:
[0095] If the current channel fails to be reserved n times, the current MCS sequence number will be decremented by 1, where n is an integer greater than or equal to 1.
[0096] In one or more possible embodiments, it also includes:
[0097] The setting unit is used to set the initial MCS sequence number and the maximum MCS sequence number of the data frame according to bandwidth requirements, signal quality and retransmission conditions.
[0098] In one or more possible embodiments, transmitting the data frame within the total duration according to the modulation and coding scheme indicated by the MCS includes:
[0099] When the data frame is sent, it is detected whether the total duration has ended. If yes, that is, the transmission duration of the data frame is equal to the total duration, and no CF-END frame is sent.
[0100] If not, send a CF-END frame.
[0101] In one or more possible embodiments, if the buffer is not empty, it is determined that there is a data frame to be sent in the buffer.
[0102] In one or more possible embodiments, it also includes:
[0103] The contention unit is used to abandon the current channel and execute a backoff algorithm to compete for the channel again if the current MCS sequence number has dropped to the minimum value and no ACK frame has been received.
[0104] It should be noted that the device 4 provided in the above embodiments is only illustrated by the division of the above functional modules when performing the WiFi data transmission method. In actual applications, the above 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 above functions. In addition, the WiFi data transmission device and the WiFi data transmission method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0105] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0106] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figure 2 The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figure 2 The specific details of the illustrated embodiments will not be elaborated here.
[0107] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the WiFi data transmission method described in the above embodiments.
[0108] Please see Figure 5 This is a schematic diagram of the structure of a WiFi device provided in an embodiment of this application. Figure 5 As shown, the WiFi device 500 may include: at least one processor 501, at least one network interface 504, user interface 503, memory 505, and at least one communication bus 502.
[0109] The communication bus 502 is used to enable communication between these components.
[0110] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0111] The network interface 504 may optionally include a Wi-Fi interface.
[0112] The processor 501 may include one or more processing cores. The processor 501 connects to various parts of the WiFi device 500 via various interfaces and lines, and performs various functions and processes data of the WiFi device 500 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 505, and by calling data stored in the memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.
[0113] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. Figure 5 As shown, the memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.
[0114] exist Figure 5 In the WiFi device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and to obtain the user's input data; while the processor 501 can be used to call the application stored in the memory 505 and specifically execute, such as Figure 2 The method shown can be referred to for details. Figure 2 As shown, it will not be elaborated further here.
[0115] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0116] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A method for transmitting WiFi data, characterized in that, include: When a data frame to be sent is detected, CCA is performed on the current channel. If the current channel is assessed to be in an idle state based on the CCA result, the initial MCS sequence number of the data frame is obtained. A test frame is sent based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful. If the ACK frame corresponding to the test frame is not received within a preset time, the initial MCS sequence number is reduced according to a preset rule, and the current channel is re-reserved based on the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal; The total duration of the data frame is calculated based on the MCS sequence number at the time of successful reservation, and the data frame is transmitted within the total duration according to the modulation and coding scheme indicated by the MCS.
2. The method according to claim 1, characterized in that, The test frame is an empty data frame.
3. The method according to claim 1 or 2, characterized in that, The step of reducing the initial MCS number according to a preset rule includes: If the current channel fails to be reserved n times, the current MCS sequence number will be decremented by 1, where n is an integer greater than or equal to 1.
4. The method according to claim 3, characterized in that, When a data frame to be transmitted is detected, a CCA is performed on the current channel. If the current channel is assessed to be idle based on the CCA result, before obtaining the initial MCS sequence number of the data frame, the process further includes: The initial MCS number and maximum MCS number of the data frame are set according to bandwidth requirements, signal quality, and retransmission conditions.
5. The method according to claim 1, 2, or 4, characterized in that, The transmission of the data frame within the total duration according to the modulation and coding scheme indicated by the MCS includes: When the data frame is sent, it is detected whether the total duration has ended. If yes, that is, the transmission duration of the data frame is equal to the total duration, and no CF-END frame is sent. If not, send a CF-END frame.
6. The method according to claim 5, characterized in that, If the buffer is not empty, it is determined that there is a data frame to be sent in the buffer.
7. The method according to claim 6, characterized in that, Also includes: If the current MCS sequence number has dropped to the minimum value and no ACK frame has been received, the current channel is abandoned, and a backoff algorithm is executed to compete for the channel again.
8. A WiFi data transmitting device, characterized in that, include: The detection unit is used to perform CCA on the current channel when a data frame to be sent is detected. If the current channel is assessed to be in an idle state based on the CCA result, the initial MCS sequence number of the data frame is obtained. The reservation unit is used to send a test frame based on the modulation and coding scheme indicated by the initial MCS sequence number. If an ACK frame corresponding to the test frame is received within a preset time period, it is determined that the current channel reservation is successful. The reservation unit is further configured to, if no ACK frame corresponding to the test frame is received within a preset time, reduce the initial MCS sequence number according to a preset rule, and re-reserve the current channel according to the reduced MCS sequence number until the reservation is successful; wherein, the current MCS sequence number will not be reduced when it is equal to the preset minimum MCS signal. The transmitting unit is configured to calculate the total duration of the data frame based on the MCS sequence number when the reservation is successful, and to transmit the data frame within the total duration according to the modulation and coding scheme indicated by the MCS.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 7.
10. A WiFi device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Modulation coding mode and repetition number selection method and device
CN109687937A
MCS adjustment method and device, storage medium and wireless node
CN112994848A