A method for WiFi multi-device channel synchronous switching based on broadcast countdown
Patent Information
- Application Number
- CN202611219392.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-03
AI Technical Summary
Existing WiFi channel switching methods rely on beacon frames as carriers, which cannot be used on links that do not send beacons. They rely on shared time bases between devices, which leads to switching time deviations. They rely on protocol stack frameworks, which result in poor coverage on existing systems. They also have poor scalability and synchronization of per-site unicast notifications, and cannot achieve simultaneous switching of any number of devices with millisecond-level precision.
It uses broadcast countdown frames to carry channel handover notifications, and carries the real-time calculated remaining milliseconds in each frame through custom management frames, allowing STAs to independently calculate the handover time, avoiding clock drift. It is self-contained within the device's WiFi driver, does not rely on beacon frames and shared time base, and supports older kernel versions and proprietary drivers.
It enables devices to switch synchronously with millisecond-level precision without relying on beacon frames and shared time base. It has strong scalability, good compatibility, strong resistance to packet loss, saves wireless bandwidth resources, and is suitable for various WiFi network scenarios.
Smart Images

Figure CN123035514A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded multimedia product technology, and in particular to a WiFi multi-device channel synchronization switching method based on broadcast countdown. Background Technology
[0002] When the channel on which the link resides is subject to interference, congestion, or regulatory requirements, the Access Point (AP) needs to migrate all associated Stations (STAs) to the new operating channel. Furthermore, all devices must complete the switchover as simultaneously as possible; any device switching too early or too late will result in a fragmented state where "some devices are on the new channel, while others remain on the old channel," causing communication interruptions. The closest existing technology to this invention is the Channel Switch Announcement (CSA) mechanism defined in the IEEE 802.11 standard: the AP carries CSA information elements in the beacon frame, broadcasting to all STAs that "we will switch to a certain channel after a certain number of beacon cycles," and the STAs switch accordingly at the predetermined time.
[0003] The existing technology has the following main drawbacks: (1) It relies on beacon frames as the bearer and cannot be used on links that do not send beacons. CSA information is carried periodically by beacon frames. However, WiFi static connection type point-to-point links do not send beacons in order to reduce air interface overhead and power consumption, so the CSA mechanism loses its carrier and cannot be carried at all. (2) It relies on the shared time base between devices. The countdown value of CSA is in the beacon period (TBTT). The STA has to convert it into an accurate handover time, provided that it keeps the TSF clock synchronized with the AP. On links without beacons, there is no shared time base, and the STA can only use its local clock to calculate it. The clock drift is not corrected by anyone, and the handover time becomes more and more off. (3) The handover time can only be roughly specified, and the deviation cannot be corrected during the countdown. The countdown of CSA is in the beacon period as the counting unit, and the handover time cannot be accurate to the millisecond. In addition, from the announcement to the actual handover, the protocol does not provide any means for both parties to recheck the time. The deviation of the clocks of both parties accumulates over time and cannot be corrected. (4) It relies on the support of the protocol stack framework, and the coverage of existing systems is poor. The complete transmission and processing of CSA must be implemented by the wireless framework and driver of the operating system kernel. A large number of existing embedded devices run older versions of the kernel or vendor-specific drivers, and this mechanism is not actually available on these systems. (5) Private schemes of per-station unicast notification have poor scalability and synchronization. The practice of AP sending unicast handover notifications to each STA one by one and waiting for confirmation results in a notification overhead that increases linearly with the number of STAs; the time when each station receives the notification and completes the confirmation is different, and the actual handover time is scattered; if the notification frame or confirmation frame is lost, it needs to be retransmitted, which further slows down the handover. At present, there is no channel handover scheme that does not rely on beacons, shared time base, or kernel protocol stack support, and can enable any number of devices to complete the handover simultaneously with millisecond-level precision and is highly resistant to packet loss. Summary of the Invention
[0004] Purpose of the invention: The purpose of this invention is to provide a WiFi multi-device channel synchronization switching method based on broadcast countdown; it can solve the problems of existing technologies that rely on beacon frames as carriers and cannot be used on links that do not send beacons, rely on shared time bases between devices, the switching time can only be roughly specified and the deviation cannot be corrected during the countdown, rely on protocol stack framework to support poor coverage of existing systems, and have poor scalability and synchronization of private solutions such as per-station unicast notification.
[0005] Technical Solution: To solve the above-mentioned technical problems, according to one aspect of the present invention, more specifically, a WiFi multi-device channel synchronization switching method based on broadcast countdown, specifically including the following steps: S1. After receiving the channel switching command, the access point (AP) performs parameter checks and records the planned switching time once; the planned switching time remains fixed throughout the countdown process. S2. The AP periodically broadcasts the channel to switch countdown frames at a preset transmission interval T. The countdown frames are carried on a custom management frame. Before each countdown frame is sent, the AP calculates the remaining milliseconds in real time by subtracting the current time from the planned switching time and puts it into the frame. S3. After receiving any countdown frame, the station STA performs source verification and handles the situation according to the current countdown value in the frame: if the current countdown value is zero, the channel switch is performed immediately; if it is the first frame of the target channel, the remaining milliseconds in the frame are read, the absolute cutoff time is set and the cutoff timer is started; if it is a subsequent frame, the absolute cutoff time is recalculated and reset using the latest remaining milliseconds carried in the frame. S4. When the countdown reaches zero, the AP sends out the final frame with a current countdown value of zero and a remaining number of milliseconds of zero, and then immediately performs channel switching; when the cutoff timer arrives, the STA unconditionally performs channel switching.
[0006] Furthermore, the parameter check in step S1 includes: checking whether the target channel number is within the allowed range, checking whether the initial countdown value N is within the preset range, and automatically limiting the bandwidth according to the channel; if a handover is already in progress, then the new request is rejected. The formula for calculating the planned switching time is: Planned switching time = Current time + Countdown initial value N × Transmission interval T; The specific rules for automatic bandwidth limitation by channel are as follows: a maximum of 40MHz for the 2.4GHz band and only 20MHz for edge channel 165; the automatic bandwidth limitation rules are executed at both the AP initiating end and the STA receiving end to ensure consistent bandwidth at both ends.
[0007] Furthermore, in step S2, the AP first calculates the remaining milliseconds within each period T, and then fills the countdown frame with the current countdown value, target channel, and target bandwidth and broadcasts it. Then, it decrements the current countdown value by one. The scheduled switching time is fixed, and the jitter of the AP's own timer will not accumulate in the remaining milliseconds segment.
[0008] Furthermore, the countdown frame is a custom management frame, and the frame body sequentially includes: category value, organization unique identifier, frame type, frame subtype, target channel number, current countdown value, target bandwidth, and remaining milliseconds; the destination address of the frame is the broadcast address, and the source address is the MAC address of the AP; The remaining milliseconds are 2 bytes in little-endian order. When the difference is greater than the upper limit of the field, saturation processing is performed, and when the difference is less than zero, it is taken as zero.
[0009] Furthermore, the source verification in step S3 means that the STA only accepts countdown frames whose source address is consistent with the current peer AP, in order to prevent unauthorized nodes from forging handover instructions.
[0010] Furthermore, in step S3, when the cutoff timer arrives, the STA unconditionally performs channel switching without checking whether a frame with a current countdown value of zero has been received; during the entire countdown period, the AP sends out N+1 countdown frames, and the STA can complete the switching at the correct time as long as it successfully receives any one of these frames.
[0011] Furthermore, the channel switching action performed by the AP and STA in step S4 includes: for a single-radio multi-virtual-interface chip, only the main interface is configured with hardware settings for channel and bandwidth once, and then all virtual interfaces are updated synchronously with software using channel parameters and device-level joint channel information; after the switching is completed, radio frequency calibration is performed immediately.
[0012] Furthermore, after the AP performs channel switching in step S4, the AP also refreshes the bandwidth and rate adaptive parameter records of each connected STA internally, without any additional air interface interaction and without needing to send any additional frames to any STA. The specific operation of the internal refresh is as follows: the status field is updated under lock protection, and the part involving firmware commands is executed in a sleepable context.
[0013] Furthermore, the custom management frame is constructed based on the vendor-defined type reserved in the IEEE 802.11 management frame; the method does not rely on beacon frame bearers, does not rely on TSF shared time base, and is self-contained within the device's WiFi driver.
[0014] Furthermore, the default value of the sending interval T is 100 milliseconds; the preset range of the initial countdown value N is 1 to 20.
[0015] It should be noted that the method of selecting the target channel is not within the scope of this invention; this invention only addresses the problem of how to enable all devices to complete the channel switching at the same time after the decision to switch is made. The target channel can be specified manually or given by a channel quality assessment algorithm. Beneficial effects
[0016] Channel switching notifications are carried out using custom management frames, eliminating the need for beacon frames. This makes the method applicable not only to traditional WiFi BSS networks but also seamlessly applicable to scenarios such as static WiFi connections that do not send beacons, greatly expanding its application scope.
[0017] Unlike the CSA mechanism of the IEEE 802.11 standard, this invention does not rely on TSF clock synchronization between the AP and STA. By carrying the remaining milliseconds calculated in real time frame by frame in each frame, the scheme enables each STA to independently and accurately calculate the handover time based on its own local clock, fundamentally avoiding handover time deviations caused by clock drift.
[0018] This invention refines the countdown unit to milliseconds and, by calculating and sending the remaining milliseconds in real time during each broadcast cycle, enables the STA to continuously reset and calibrate its internal cutoff timer based on the latest received frame. This mechanism effectively compensates for over-the-air transmission delays and local timer jitter, ensuring that all devices can complete the switching at the same millisecond-level precision.
[0019] The method of this invention is self-contained within the device's WiFi driver, and its custom management frames are constructed based on the reserved vendor-customized types of IEEE 802.11 management frames. This design makes it independent of the wireless framework support of the upper-level operating system kernel, and can easily adapt to and cover a large number of existing embedded devices running older kernel versions or proprietary drivers, exhibiting strong compatibility and portability.
[0020] This invention can notify all associated STAs with a single broadcast, with a time and air interface overhead of O(1), independent of the number of STAs, and excellent scalability. At the same time, the AP will periodically send N+1 countdown frames during the entire countdown period. As long as any STA successfully receives any one of these frames, it can accurately perform the handover, which has a strong anti-packet loss capability and ensures the reliability of the handover process.
[0021] For single-radio multi-virtual-interface chips, this invention proposes an optimized method that requires only one hardware configuration of the main interface, followed by simultaneous software updates of all virtual interface parameters. This avoids the overhead of repeatedly configuring hardware and simplifies the management of device-level joint channel information.
[0022] After completing the channel switch, the AP only refreshes the bandwidth and rate adaptation parameter records of each connected STA locally. The entire process does not require additional air interface frame interaction with any STA, further saving valuable wireless bandwidth resources. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the method. Detailed Implementation
[0024] To make the technical solution of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] This embodiment describes in detail the specific implementation process of how an access point (AP) and multiple stations (STAs) in a typical WiFi BSS network synchronously switch from the current channel (channel 6) to the target channel (channel 149) through a broadcast countdown method.
[0026] S1. Switch Initiation and Parameter Check: When the AP's management layer triggers a channel handover command due to severe interference detected on the current channel 6, the AP first performs a rigorous parameter check. This check includes: verifying whether the target channel number 149 is within the allowed range supported by the device, checking whether the initial countdown value N (set to 5 in this embodiment) for this handover is within the preset range of 1 to 20, and performing automatic bandwidth limiting—since the target channel 149 belongs to the 5GHz band, the bandwidth is set to 80MHz (if the target is the 2.4GHz band, the maximum limit is 40MHz; if it is the edge channel 165, it is limited to 20MHz). This rule is executed on both the AP and STA ends to ensure that the bandwidth configurations at both ends are consistent. At the same time, the AP confirms that there is no ongoing handover process; if other handover tasks exist, the new request is rejected. After the parameter verification is successful, the AP records the planned handover time once based on the current time (assuming it is T0) and the formula `Planned handover time = Current time + Initial countdown value N × Transmission interval T`. The transmission interval T uses the system default value of 100 milliseconds. Therefore, the planned switching time in this embodiment is T0+500ms. This time remains fixed throughout the entire countdown process and is not affected by any timer jitter.
[0027] S2, Periodic broadcast countdown frames: The AP begins broadcasting a channel handover countdown frame in a custom management frame format on its currently operating channel 6, with a period of 100 milliseconds. The destination address of this countdown frame is the broadcast address, and the source address is the AP's MAC address. Before sending each countdown frame, the AP subtracts the current time from the fixed planned handover time to calculate the remaining milliseconds in real time, and fills this value into the "Remaining Milliseconds" field of the frame body (2 bytes, little-endian storage; if the difference exceeds 65535, it is saturated; if it is less than zero, it is zero). The frame body also includes information such as the target channel number 149, the current countdown value (decreasing from N to 0), and the target bandwidth 80MHz. Within each period T, the AP strictly follows this order: first, calculate the remaining milliseconds and construct the complete frame body; then, broadcast the countdown frame; and finally, decrement the locally maintained current countdown value by one. Since the planned handover time is fixed, minor jitter in the AP's own timer only affects "when to send the frame" but does not accumulate in the calculation of the critical "Remaining Milliseconds" field.
[0028] S3, Site Reception and Processing: STA devices (e.g., wireless display receivers) running drivers implementing this method listen for and receive broadcast frames. Upon receiving a countdown frame, any STA first performs source verification, checking if the source address in the frame header matches the MAC address of its currently associated AP, thus preventing unauthorized nodes from forging handover commands and launching attacks. After successful verification, the STA reads the current countdown value from the frame and performs the following processing: If the current countdown value is non-zero (e.g., 5, 4, 3, 2, 1), the STA determines whether this frame is the first frame of the current handover process. For example, when a frame with a current countdown value of 5 is received, it is confirmed as the first frame. The STA reads the "remaining milliseconds" (e.g., 498ms) from the frame, calculates and sets a local absolute cutoff time (local time + 498ms), and starts the local cutoff timer. When subsequent frames with countdown values of 4, 3, etc. are received, the STA recalculates and resets the absolute cutoff time using the latest remaining milliseconds carried in each frame (e.g., 398ms, 298ms), continuously calibrating the local timing and effectively compensating for over-the-air transmission delays and local clock drift.
[0029] If the current countdown value is zero, the STA will immediately switch the channel to channel 149 without waiting for the timer.
[0030] S4. Final Switching and Execution: When the countdown value maintained locally by the AP decreases to 0, it sends out the last countdown frame, in which both the "current countdown value" and "remaining milliseconds" fields are 0. After sending, the AP immediately performs a channel switch. Simultaneously, the internal cutoff timer of all STAs that successfully receive any countdown frame will expire at that time (T0+500ms). Upon expiration, the STA unconditionally performs a channel switch, without checking whether it received the final frame with a countdown value of zero. During the entire countdown period, the AP sends a total of 6 frames (N+1=6). Any STA that successfully receives any one of these frames can complete the switch at the correct time, exhibiting strong packet loss resistance—even if the first 5 frames are lost, the switch can still be completed on time as long as the last frame is received. After the switch is completed, both the AP and STA perform RF calibration. For single-RF multi-virtual-interface chips, the AP only performs hardware settings for the channel and bandwidth on the main interface once, and then synchronously updates the channel parameters and device-level joint channel information of all virtual interfaces in software. After the switchover is complete, the AP refreshes the bandwidth and rate adaptive parameter records of each connected STA internally. The status field is updated under lock protection, and the firmware commands are executed in a sleep context. No additional air interface interaction with any STA is required throughout the process, ensuring that all devices complete the synchronous switchover in a very short time.
[0031] This embodiment details the implementation process of channel synchronization switching between two WiFi devices using the method of this invention in a static WiFi connection scenario where no beacon is sent. The static WiFi connection refers to a point-to-point encrypted connection established by both communicating parties directly writing peer information, channel, encryption key, etc., into their local driver and chip hardware, without going through the 802.11 association process. No beacon frames are sent on this connection, and the standard CSA mechanism has neither bearer frames nor a TSF shared time base maintained by beacons, making it unusable. Of the two devices, one operates as an Access Point (AP) (hereinafter referred to as the AP end), and the other operates as a Single Target (STA end).
[0032] S1. Switch Initiation and Parameter Check: The AP and STA are currently transmitting screen-projected data on channel 36. The AP detects increased interference and degraded link quality on this channel and needs to migrate both sides to the less busy channel 157. After receiving the channel switching command, the AP checks the parameters: the target channel 157 is within the allowable range; the initial countdown value N is set to 3 (preset range 1~20, this embodiment uses a smaller value to achieve fast switching); bandwidth is automatically limited according to the channel, and 80MHz is available for channel 157. After confirming that no other switching process is currently in progress, the AP records the planned switching time as current time + 3 × 100ms, and the transmission interval T uses the default value of 100 milliseconds. This planned switching time remains fixed throughout the countdown.
[0033] S2, Periodic broadcast countdown frames: On the current channel 36, the AP broadcasts a channel switching countdown frame (hereinafter referred to as the countdown frame) in a custom management frame format every 100 milliseconds. The destination address is the broadcast address, and the source address is the AP's MAC address. Before each frame is sent, the AP subtracts the current time from the fixed planned switching time to calculate the remaining milliseconds in real time (2-byte little-endian, saturation processing is performed when the difference overflows, and zero is taken when it is negative). The remaining milliseconds are then filled into the frame along with the current countdown value (3, 2, 1, 0), the target channel 157, and the target bandwidth 80MHz.
[0034] S3, Site Reception and Processing: Upon receiving the countdown frame, the STA first performs source verification: the source address must match the peer AP of this static connection to prevent unauthorized nodes from forging handover commands. After successful verification, it processes the frame according to the countdown value: when the first frame with a countdown value of 3 is received, the remaining milliseconds (e.g., 297ms) are read from the frame, and the local absolute cutoff time is set accordingly, and the local cutoff timer is started; when subsequent frames with countdown values of 2 or 1 are received, the latest remaining milliseconds carried in each frame (e.g., 196ms, 98ms) are used to recalculate and reset the cutoff time, continuously eliminating the accumulated error caused by the frequency offset of the local clocks at both ends.
[0035] S4. Final Switching and Execution: When the AP's countdown reaches zero, it sends the last frame (countdown value 0, remaining milliseconds 0) and immediately switches to channel 157. The STA's cutoff timer expires simultaneously, unconditionally performing channel switching, regardless of whether the last frame was received—even if the last frame is lost due to sudden interference, the STA can still complete the switch on time. After the switch is complete, both sides immediately perform RF calibration to adapt to the new channel. For single-RF multi-virtual-interface chips, only the main interface undergoes hardware settings for channel and bandwidth once, and then all virtual interfaces' channel parameters and device-level joint channel information are updated synchronously in software. Afterward, the AP internally refreshes the STA's bandwidth and rate adaptive parameter records, the status fields are updated under lock protection, and firmware commands are executed in a sleep context, requiring no additional air interface interaction. The entire migration process is completed in approximately 300 milliseconds, without relying on beacon frames or TSF time bases, and runs entirely within the WiFi drivers of both devices, demonstrating the unique advantages of this method in beacon-free scenarios.
[0036] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A WiFi multi-device channel synchronization and switching method based on broadcast countdown, characterized in that, Specifically, the following steps are included: S1. After receiving the channel switching command, the access point (AP) performs parameter checks and records the planned switching time once; the planned switching time remains fixed throughout the countdown process. S2. The AP periodically broadcasts the channel to switch countdown frames at a preset transmission interval T. The countdown frames are carried on a custom management frame. Before each countdown frame is sent, the AP calculates the remaining milliseconds in real time by subtracting the current time from the planned switching time and puts it into the frame. S3. After receiving any countdown frame, the station STA performs source verification and handles the situation according to the current countdown value in the frame: if the current countdown value is zero, the channel switch is performed immediately; if it is the first frame of the target channel, the remaining milliseconds in the frame are read, the absolute cutoff time is set and the cutoff timer is started; if it is a subsequent frame, the absolute cutoff time is recalculated and reset using the latest remaining milliseconds carried in the frame. S4. When the countdown reaches zero, the AP sends out the final frame with a current countdown value of zero and a remaining number of milliseconds of zero, and then immediately performs channel switching; when the cutoff timer arrives, the STA unconditionally performs channel switching.
2. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The parameter check in step S1 includes: checking whether the target channel number is within the allowed range, checking whether the initial countdown value N is within the preset range, and automatically limiting the bandwidth according to the channel; if a handover is already in progress, the new request is rejected. The formula for calculating the planned switching time is: Planned switching time = Current time + Countdown initial value N × Transmission interval T; The specific rules for automatic bandwidth limitation by channel are as follows: a maximum of 40MHz for the 2.4GHz band and only 20MHz for edge channel 165; the automatic bandwidth limitation rules are executed at both the AP initiating end and the STA receiving end to ensure consistent bandwidth at both ends.
3. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: In step S2, within each period T, the AP first calculates the remaining milliseconds, and fills them into a countdown frame along with the current countdown value, target channel, and target bandwidth, and then broadcasts it. Finally, it decrements the current countdown value by one. The scheduled switching time is fixed, and the jitter of the AP's own timer will not accumulate in the remaining milliseconds segment.
4. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The countdown frame is a custom management frame, and the frame body contains, in sequence: category value, organization unique identifier, frame type, frame subtype, target channel number, current countdown value, target bandwidth, and remaining milliseconds; the destination address of the frame is the broadcast address, and the source address is the MAC address of the AP; The remaining milliseconds are 2 bytes in little-endian order. When the difference is greater than the upper limit of the field, saturation processing is performed, and when the difference is less than zero, it is taken as zero.
5. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The source verification in step S3 means that the STA only accepts countdown frames whose source address is consistent with the current peer AP, in order to prevent unauthorized nodes from forging handover instructions.
6. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: In step S3, when the cutoff timer arrives, the STA unconditionally performs channel switching without checking whether a frame with a current countdown value of zero has been received. During the entire countdown period, the AP sends N+1 countdown frames, and the STA can complete the switching at the correct time as long as it successfully receives any one of these frames.
7. The WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The channel switching action performed by the AP and STA in step S4 includes: for a single-radio multi-virtual-interface chip, the channel and bandwidth hardware settings are performed only once on the main interface, and then the channel parameters and device-level joint channel information of all virtual interfaces are updated synchronously in software; after the switching is completed, radio frequency calibration is performed immediately.
8. A WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: After the AP performs channel switching in step S4, the AP also refreshes the bandwidth and rate adaptive parameter records of each connected STA within its own machine. There is no additional air interface interaction throughout the process, and no additional frames need to be sent to any STA. The specific operation of the internal refresh is as follows: the status field is updated under lock protection, and the part involving firmware commands is executed in a sleepable context.
9. A WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The custom management frame is constructed based on the vendor-defined type reserved in the IEEE 802.11 management frame; the method does not rely on beacon frame bearers, does not rely on TSF shared time base, and is self-contained within the device's WiFi driver.
10. A WiFi multi-device channel synchronization switching method based on broadcast countdown according to claim 1, characterized in that: The default value of the sending interval T is 100 milliseconds; the preset range of the initial countdown value N is 1 to 20.
