Channel avoidance method and apparatus, device and storage medium
By modifying the checksum in the wireless network to generate collision frames, the problem of IPC disconnection and lag caused by the target device preempting the channel was solved, channel avoidance was achieved, and the device's channel preemption ability was reduced.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2025-06-26
- Publication Date
- 2026-06-18
AI Technical Summary
In wireless networks, the target device does not fully comply with IEEE standards, resulting in a large number of dropped connections or severe lag in intercoms.
By modifying the checksum in the response message from the target network to the target device, a collision frame is generated. When the camera device receives a matching data packet, the collision frame is sent to the target device to forge a channel conflict, causing the target device to automatically avoid the channel.
It effectively reduces the channel preemption capability of target devices, avoiding a large number of video equipment disconnections or severe intercom lag.
Smart Images

Figure CN2025103682_18062026_PF_FP_ABST
Abstract
Description
Channel avoidance methods, apparatus, devices and storage media
[0001] Cross-reference to related applications
[0002] This disclosure claims priority to Chinese Patent Application No. 202411802336.X, filed on December 09, 2024, entitled “Channel Avoidance Method, Apparatus, Device and Storage Medium”, which is incorporated herein by reference in its entirety. Technical Field
[0003] This disclosure relates to the field of wireless network communication technology, and for example to a channel avoidance method, apparatus, device, and storage medium. Background Technology
[0004] In existing wireless network communication, Internet Protocol Cameras (IPCs) can connect to Wi-Fi networks via Wireless Access Points (WAPs) and transmit data through the Wi-Fi network.
[0005] Typically, wireless access points connect not only to IPCs but also to other terminal devices, meaning these other devices can also transmit data via the Wi-Fi network. If one of these other terminal devices is a target device—that is, a device that does not fully comply with the Institute of Electrical and Electronics Engineers (IEEE) standards—it will excessively occupy public channels in the Wi-Fi network, causing numerous dropped connections for the IPCs or severe lag in intercom communication.
[0006] Therefore, how to enable target devices to avoid channel avoidance in Wi-Fi networks, so as to prevent a large number of IPC disconnections or severe intercom lag, is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] This disclosure provides a channel avoidance method, apparatus, device, and storage medium to address the shortcomings of existing technologies in how to enable target devices to avoid channel avoidance in wireless networks, thereby preventing issues such as frequent disconnections of camera equipment or severe lag in intercom.
[0008] This disclosure provides a channel avoidance method applied to a camera device, the method comprising:
[0009] If it is determined that a target device exists in the target network, the checksum in the response message of the target network to the target device is modified to obtain a collision frame;
[0010] When the camera device receives a first data packet and the source network address of the first data packet matches the network address of the target device, it sends the collision frame to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0011] According to a channel avoidance method provided in this disclosure, sending the collision frame to the target device includes:
[0012] During the time interval between the reception time of the first data packet and the sending time of the response message from the target network to the first data packet, the collision frame is continuously sent to the target device.
[0013] According to a channel avoidance method provided in this disclosure, determining that a target device exists in the currently accessed target network includes:
[0014] When the camera device is connected to the target network, network anomaly events are detected within a preset time period; wherein, the network anomaly events include at least one of network interruption events and events where the packet loss rate is greater than a preset packet loss rate threshold;
[0015] If the number or frequency of network anomalies exceeds a preset threshold, it is determined that the target device exists in the target network.
[0016] According to a channel avoidance method provided in this disclosure, determining the presence of the target device in the target network when the number or frequency of network anomaly events exceeds a preset threshold includes:
[0017] If the number or frequency of network anomalies exceeds the preset threshold, the camera device is controlled to acquire all second data packets in the target channel in monitoring mode; wherein, the target channel is the channel through which the camera device accesses the target network.
[0018] Each of the second data packets is parsed to obtain the source network address corresponding to each second data packet;
[0019] Based on the source network address corresponding to each of the second data packets, it is determined that the target device exists in the target network.
[0020] According to a channel avoidance method provided in this disclosure, determining the existence of the target device in the target network based on the source network address corresponding to each second data packet includes:
[0021] Based on the source network address corresponding to each of the second data packets, determine the target network address corresponding to the maximum number of occurrences;
[0022] Based on the key network parameters corresponding to the target network address, the probability of suspicion corresponding to the target network address is determined;
[0023] If the probability of suspicion corresponding to the target network address is greater than a preset probability threshold, the sending device of the second data packet corresponding to the target network address is identified as the target device.
[0024] According to a channel avoidance method provided in this disclosure, the key network parameters include average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value. The step of determining the suspicious probability corresponding to the target network address based on the key network parameters corresponding to the target network address includes:
[0025] The average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value are compared with their own abnormal threshold values to obtain the corresponding comparison results.
[0026] The suspicious probability corresponding to the target network address is obtained by weighted summation of each comparison result and the corresponding abnormal weight value.
[0027] According to the channel avoidance method provided in this disclosure, before modifying the checksum in the response message of the target network to the target device to obtain the collision frame, the method further includes:
[0028] After the camera device reconnects to the target network using the previously saved identifier and password, it obtains the preamble information.
[0029] The response message of the target network to the target device is determined based on the preamble information.
[0030] According to the channel avoidance method provided in this disclosure, it further includes:
[0031] Set the highest network speed as the anomaly threshold value of the average network speed.
[0032] This disclosure also provides a channel avoidance device for use in a camera device, the device comprising:
[0033] The modification unit is configured to modify the checksum in the response message of the target network to the target device when it is determined that a target device exists in the target network, thereby obtaining a collision frame;
[0034] The sending unit is configured to send the collision frame to the target device when the camera device receives the first data packet and the source network address of the first data packet matches the network address of the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0035] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the channel avoidance method as described above.
[0036] This disclosure also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the channel avoidance method as described above.
[0037] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the channel avoidance method as described above.
[0038] The channel avoidance method, apparatus, device, and storage medium disclosed herein, when determining that a target device exists in the target network, modify the checksum in the response message from the target network to the target device to obtain a collision frame; when the camera device receives a first data packet and the source network address of the first data packet matches the network address of the target device, the collision frame is sent to the target device; wherein, the collision frame is used to instruct the target device to perform channel avoidance in the target network. By modifying the checksum to obtain the collision frame and sending it to the target device, channel conflicts can be effectively forged, enabling the target device to automatically perform channel avoidance, thereby reducing the target device's channel preemption capability and effectively avoiding defects such as numerous dropped calls or severe intercom lag in the camera device. Attached Figure Description
[0039] Figure 1 is a schematic flowchart of a channel avoidance method provided in an embodiment of this disclosure.
[0040] Figure 2 is a schematic diagram of a preamble information provided in an embodiment of this disclosure.
[0041] Figure 3 is a schematic diagram of the structure of a collision frame provided in an embodiment of this disclosure.
[0042] Figure 4 is a schematic diagram of the location of a target device performing anomaly processing after receiving a collision frame, according to an embodiment of this disclosure.
[0043] Figure 5 is a schematic diagram of a process for determining the presence of a target device in a target network according to an embodiment of this disclosure.
[0044] Figure 6 is a schematic diagram of the structure of a MAC address for the 802.11 protocol provided in an embodiment of this disclosure.
[0045] Figure 7 is a schematic diagram of a channel avoidance device provided in an embodiment of this disclosure.
[0046] Figure 8 is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0047] The technical solutions of this disclosure will now be described with reference to the accompanying drawings. The described embodiments are only some, not all, of the embodiments of this disclosure.
[0048] In the embodiments of this disclosure, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this disclosure, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0049] The technical solutions provided in this disclosure are adaptable to monitoring scenarios using camera equipment. In existing monitoring scenarios, camera equipment, such as IPCs, typically connect to a Wi-Fi network via WAP and transmit the collected monitoring data to the monitoring platform via the Wi-Fi network after collection. If a target device is also connected to the Wi-Fi network, the target device may excessively occupy the public channels of the Wi-Fi network, leading to numerous dropped connections or severe intercom lag for the IPCs.
[0050] Therefore, in order to address the shortcomings of existing technologies in enabling target devices to perform channel avoidance in wireless networks to prevent issues such as numerous dropped calls or severe intercom lag, this disclosure provides a channel avoidance method. When it is determined that a target device exists in the target network, the checksum in the response message from the target network to the target device is modified to obtain a collision frame. If the source network address of the first data packet received by the camera device matches the network address of the target device, a collision frame is sent to the target device to instruct it to perform channel avoidance in the target network.
[0051] By modifying the checksum to obtain a collision frame and sending the collision frame to the target device, channel conflicts can be effectively forged, enabling the target device to automatically avoid channel conflicts. This reduces the target device's ability to preempt the channel and effectively avoids defects such as numerous dropped calls or severe intercom lag in camera equipment.
[0052] It is understood that the subject of this method can be a camera device or a channel avoidance device installed in the camera device. The channel avoidance device can be implemented by software, hardware or a combination of both.
[0053] The channel avoidance method provided in this disclosure will now be described in detail through the following embodiments. It is understood that these embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0054] Figure 1 is a schematic flowchart of a channel avoidance method provided in an embodiment of this disclosure, applied to a camera device. For example, as shown in Figure 1, the channel avoidance method may include:
[0055] S101. If it is determined that a target device exists in the target network, modify the checksum in the response message of the target network to the target device to obtain a collision frame.
[0056] The target network is the wireless communication network to which the camera device is connected.
[0057] For example, when it is determined that a target device exists in the target network, in order to enable the target device to avoid channel interference within the target network and reduce its channel preemption capability, collision firmware can be loaded. This collision firmware is specifically designed for network collision. Considering that if the preamble information is consistent when sending collision frames, the probability of network collision can be increased to some extent, after the camera device reconnects to the target network using the previously saved target network identifier and password, the preamble information can be obtained first. The acquisition of the preamble information depends on the modulation scheme and rate. The preamble can be parsed based on the 802.11b / g / n / ac / ax version and the average rate. Taking the 802.11b version as an example, see Figure 2. Figure 2 is a schematic diagram of preamble information provided by an embodiment of this disclosure. The network version corresponding to the average rate can be counted, and its corresponding synchronization sequence (Sync) and start frame delimiter (SFD) can be obtained to parse the preamble information.
[0058] The preamble information is DSS1M. The long preamble consists of 144 bits, including 128 scrambled 1s and 16 SFD flag bits, while the short preamble consists of 72 bits, including 56 scrambled 0s and 16 SFD flag bits.
[0059] The long header uses DSSS1M, and the short header uses DSSS2M. It contains 48 bits that specify the configuration: Signal (8 bits): specifies the payload data rate (1, 2, 5.5, or 11 Mbps); Service (8 bits): additional HR configuration bits; Length (16 bits): the length of the payload data in microseconds; Cyclic Redundancy Check (CRC) (16 bits): protects the header data content; Payload data, which can be DSSS1M, DSSS2M, CCK5.5M, or CCK11M modulated payload data.
[0060] After obtaining the preamble information, the response message from the target network to the target device can be determined based on the preamble information, and the checksum in the response message can be modified. For example, see Figure 3, which is a schematic diagram of the structure of a collision frame provided in an embodiment of this disclosure. By modifying the checksum in the response message, namely Cyclic Redundancy Check (CRC), i.e., by deliberately filling in the checksum incorrectly, a collision frame can be generated. In this way, the process of the target device receiving the response message from the target network to the target device can be interrupted through the collision frame.
[0061] After obtaining the collision frame, the first data packet can be received in the air. Its main purpose is to receive the first data packet sent by the target device. Therefore, after receiving the first data packet, it can be determined whether the source network address of the first data packet matches the network address of the target device. If the received first data packet does not match the network address of the target device, a new first data packet can be received. Conversely, if the received first data packet matches the network address of the target device, it means that the first data packet is a data packet sent by the target device, and the following S102 can be executed.
[0062] S102. When the camera device receives the first data packet and the source network address of the first data packet matches the network address of the target device, a collision frame is sent to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0063] It is understood that in the embodiments of this disclosure, after sending a collision frame to the target device, as exemplified in Figure 4, which is a schematic diagram of the location of the target device performing abnormal processing after receiving the collision frame according to an embodiment of this disclosure, it can be seen that at the dashed box at the top of Figure 4, the collision frame and the response message from the target network to the target device arrive at the receiving antenna position of the target device simultaneously. Due to the presence of the collision frame, the target device will be unable to recognize the preamble information and will enter the Received Signal Strength Indicator (RSSI) monitoring state until the collision frame and the response message are sent, at which point it will switch back to the receiving state. In this way, the target device will adjust the transmission avoidance parameters because it has not received the response message, so that the target device will automatically perform channel avoidance to reduce the channel preemption capability of the target device. This can effectively avoid the defects of the camera device such as a large number of dropped calls or severe intercom lag.
[0064] In the dashed box at the bottom of Figure 4, the collision frame arrives at the target device's receiving antenna position earlier than the target network's response message to the target device. Furthermore, no response message is received until the entire Physical Layer Convergence Protocol (PCLP) header is received. Since the Cyclic Redundancy Check (CRC) in the PCLP header has been modified during collision frame generation (i.e., the checksum is intentionally incorrect), the target device will fail the check and enter RSSI monitoring state. Even if the target device receives a response message later, it will not process it. Therefore, the target device will mistakenly believe that no response message has been received. Consequently, the target device will adjust its transmission avoidance parameters due to the lack of a response message, automatically performing channel avoidance to reduce its channel preemption capability. This effectively avoids defects such as numerous dropped calls or severe intercom lag in camera equipment.
[0065] It is understandable that Figure 4 above describes the reception process of the collision frame in detail. Its reception state is relatively complex and requires comprehensive understanding in conjunction with the carrier sensing process. The reception process may include:
[0066] The target device is initially in the Receive (Rx) state, which is not shown in Figure 4 above. This is because if the target device is not in the Transmit (Tx) state, it defaults to remaining in the Rx state. In the Rx state, the target device mainly performs Clear Channel Assessment (CCA). For simplicity, Figure 4 does not include the virtual carrier sensing part. CCA includes Energy Detection (ED) and Carrier Sense (CS). In Figure 4, the target device first performs energy detection to determine if the energy is greater than a preset threshold PMD_ED.indicate (i.e., PMD_ED.ind in Figure 4). The initial channel state is preset to idle by the Physical Layer (PHY)_CCA.ind.
[0067] After determining channel availability through energy detection, the process transitions to carrier sensing. The PHY layer uses carrier sensing (CS) to detect if it's an 802.11 frame. If external interference is significant, energy detection will also indicate a busy channel. In 802.11b, carrier sensing primarily uses cross-correlation to determine if the correlation result with the preamble information exceeds a threshold. If a peak is found (i.e., peak(s)found in Figure 4), the PMD_CS.ind parameter triggers the search for the Start of Frame Delimiter (SFD). It's important to note that the meaning of SFD here is essentially the same as in wired networks: a specific sequence used to identify the beginning of a data packet. If SFD is not detected, the PHY will transition to the RSSI Monitor state until the detected RSSI is less than a given threshold, at which point it will return to the initial ED state (the RSSI is obtained through ED because there is energy on the channel). During this process, the PHY_CCA.ind transmitted from the PHY layer to the Media Access Control (MAC) layer is in a busy state. Only when neither a CS peak is detected nor an RSSI greater than the threshold is there will the PHY transition to the ED state and report that the upper-layer channel is in an idle state. Only in the idle state can the STA transmit, which is the SYNC and SFD part in Figure 4 above.
[0068] Once the SFD state is complete, meaning a data frame is being transmitted, the target device first receives the PLCP header portion of the data frame and performs a CRC check on it. The PLCP header contains information needed for subsequent data reception, such as packet length and transmission rate parameters. If the header is received incorrectly, no further reception is required. If the header is successfully received, feedback is sent to the upper layer via PHY_RXSTART.ind, informing the MAC layer that a data packet is being received. It's important to note that the PHY layer needs to determine if the rate of the incoming data packet is locally supported. If the required rate cannot be achieved, the target device will not receive the data, as shown in the PLCP header portion of Figure 4 above.
[0069] Once all the above conditions are met, the target device receives the data, i.e., the status is Data Decode. After receiving the data, it sends PHY_RXEND.ind back to the upper layer to indicate that the data reception is complete.
[0070] As can be seen from this embodiment, when it is determined that a target device exists in the target network, the checksum in the response message from the target network to the target device is modified to obtain a collision frame. When the camera device receives the first data packet and the source network address of the first data packet matches the network address of the target device, the collision frame is sent to the target device. The collision frame is used to instruct the target device to perform channel avoidance within the target network. By modifying the checksum to obtain the collision frame and sending it to the target device, channel conflicts can be effectively forged, causing the target device to automatically perform channel avoidance. This reduces the target device's channel preemption capability and effectively avoids defects such as numerous dropped calls or severe intercom lag in the camera device.
[0071] Based on the embodiment shown in Figure 1 above, for example, in S101 above, it is determined that there is a relevant implementation of the target device in the target network, which can be referred to the embodiment shown in Figure 5 below.
[0072] Figure 5 is a schematic diagram of a process for determining the existence of a target device in a target network according to an embodiment of this disclosure. For example, as shown in Figure 5, the method may include:
[0073] S501. When the camera device is connected to the target network, detect network abnormal events within a preset time period; wherein, the network abnormal events include at least one of network interruption events and events in which the packet loss rate is greater than a preset packet loss rate threshold.
[0074] The duration of the preset time period can be set according to actual needs, and this embodiment of the present disclosure does not impose any restrictions. Similarly, the value of the preset packet loss rate threshold can also be set according to actual needs, and this embodiment of the present disclosure does not impose any restrictions.
[0075] By detecting network anomalies within a preset time period, the network quality of the target network to which the camera device is connected can be determined. If the number or frequency of network anomalies within the preset time period is less than a preset threshold, it can be considered that the target network is experiencing network fluctuations. Conversely, if the number or frequency of network anomalies within the preset time period is greater than the preset threshold, then step S502 is executed. The preset threshold value can also be set according to actual needs; this embodiment does not impose specific limitations on it.
[0076] S502. If the number or frequency of network abnormal events exceeds a preset threshold, determine that a target device exists in the target network.
[0077] For example, in this embodiment of the disclosure, if the number or frequency of network anomalies exceeds a preset threshold, it can be directly determined that a target device exists in the target network; alternatively, if the number or frequency of network anomalies exceeds the preset threshold, the camera device can be further controlled to acquire all second data packets in the target channel in monitoring mode; wherein, the target channel is the channel through which the camera device accesses the target network; considering that the network address, i.e., the Media Access Control Address (MAC) header, is unencrypted in the 802.11 protocol, see Figure 6 for example. Figure 6 is a schematic diagram of the structure of an 802.11 protocol MAC address provided in this embodiment of the disclosure. Even if the wireless network uses WPA2 / WPA3 encryption for connection, the MAC header is still readable, and the source MAC address can also be read from the MAC header. Therefore, after acquiring all second data packets in the target channel, each second data packet can be parsed to obtain the source network address corresponding to each second data packet; and based on the source network address corresponding to each second data packet, it can be determined that a target device exists in the target network.
[0078] As shown in Figure 6, Address1 represents the receiving end, Address2 represents the transmitting end, and Address3 represents the filtered address received by the receiving end. In a wireless network, the third address is used by the receiving end to determine whether the frame belongs to the network it is connected to, thereby determining the source network address.
[0079] The monitoring mode is a working mode of a wireless network card that allows connected terminal devices to capture all surrounding wireless data packets without being connected to any network. It is supported by most mainstream Wi-Fi modules.
[0080] For example, in this embodiment of the disclosure, when it is determined that a target device exists in the target network based on the source network address corresponding to each second data packet, the target network address corresponding to the maximum number of occurrences can be determined first based on the source network address corresponding to each second data packet; and the suspicious probability corresponding to the target network address can be determined based on the key network parameters corresponding to the target network address; if the suspicious probability corresponding to the target network address is greater than a preset probability threshold, the sending device of the second data packet corresponding to the target network address is determined as the target device.
[0081] The value of the preset probability threshold can be set according to actual needs. For example, in this embodiment of the disclosure, the preset probability threshold can be 50%.
[0082] Specifically, before determining the probability of suspicion for a target network address based on its key network parameters, the Wi-Fi firmware can be used to sense and statistically analyze these parameters. The Wi-Fi firmware can be designed to detect different key network parameters, and different Wi-Fi firmwares can be stored in designated partitions and loaded for sensing and analyzing these parameters.
[0083] For example, in this embodiment of the disclosure, key network parameters may include average network rate, maximum received signal strength indication, minimum arbitration inter-frame space number (AIFSN), and average backoff value. In this case, when determining the suspicious probability of the target network address based on the key network parameters corresponding to the target network address, the average network rate, maximum received signal strength indication, minimum arbitration inter-frame space number (AIFSN), and average backoff value can be compared with their own anomaly threshold values to obtain the corresponding comparison results. Then, each comparison result and the corresponding anomaly weight value are weighted and summed to obtain the suspicious probability of the target network address.
[0084] It should be noted that different 802.11 versions, such as 11b, 11g, 11n, 11ac, and 11ax, have different maximum speeds. Taking version 11b as an example, see Table 1 below. The maximum speed in version 11b is 11Mbps. The same applies to versions 11g, 11n, 11ac, and 11ax, where the maximum speed can also be used. The specific settings can be made according to actual needs.
[0085] Table 1
[0086] Regarding the received signal strength indication, the signal strength can be indicated. This information is available from the firmware PHY layer and is measured in dB. Generally, certification requirements stipulate a minimum of 20 dB. The firmware PHY layer can be designed based on requirements; after loading, it can sense and acquire the indicated signal strength. Regarding the Arbitration Inter-Frame Spacing Number (AIFSN), the 802.11 protocol specifies: AIFS[AC] = AIFSN[AC] × aSlotTime + aSIFSTime. Regarding the backoff value, it is used for pre-transmission frame avoidance counting, measured in slot time. The value decreases by 1 in idle states and remains unchanged in non-idle states. It is understood that the initial backoff value largely determines the preemption capability.
[0087] After determining the average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value, these parameters can be compared with their own abnormal threshold values to obtain the corresponding comparison results, as shown in Table 2 below.
[0088] Table 2
[0089] Referring to Table 2, for any of the above key parameters, if the key parameter does not reach the corresponding anomaly threshold, the comparison result can be recorded as "0"; if the key parameter has reached the corresponding anomaly threshold, the comparison result can be recorded as "1". After obtaining the comparison result for each key parameter, each comparison result and the corresponding anomaly weight value can be weighted and summed to obtain the suspicious probability corresponding to the target network address. If the suspicious probability corresponding to the target network address is greater than the preset probability threshold of 50%, then the sending device of the second data packet corresponding to the target network address is determined, and it is determined to be the target device. In this way, it can be determined that the target device exists in the target network.
[0090] For example, for the average (network) rate, the corresponding abnormal threshold value can be the highest (network) rate, that is, the highest rate of the network is set as the abnormal threshold value of the average network rate.
[0091] In this embodiment of the disclosure, when it is determined that a target device exists in the target network, the suspicion probability is first determined based on the source network address corresponding to each second data packet by using the key network parameters corresponding to the target network address with the maximum number of occurrences. If the suspicion probability is greater than a preset probability threshold, the sending device of the second data packet corresponding to the target network address is determined as the target device. This not only avoids processing other network addresses that do not correspond to the maximum number of occurrences, greatly reducing the amount of data processing and thus improving processing efficiency, but also accurately determines the suspicion probability based on the key network parameters, thereby improving the accuracy of determining the target device.
[0092] When the presence of a target device in the target network is confirmed, in order to address the shortcomings of existing technologies in enabling the target device to perform channel avoidance in the wireless network to prevent issues such as numerous dropped calls or severe intercom lag, a collision frame can be obtained by modifying the checksum in the response message from the target network to the target device. When the source network address of the first data packet received by the camera device matches the network address of the target device, a collision frame is sent to the target device. This effectively forges a channel conflict, allowing the target device to automatically perform channel avoidance, thereby reducing the target device's channel preemption capability and effectively preventing issues such as numerous dropped calls or severe intercom lag.
[0093] For example, in this embodiment of the present disclosure, when the camera device sends a collision frame to the target device, it can continuously send collision frames to the target device during the time period between the time of receiving the first data packet and the time of sending the response message of the target network to the first data packet. In this way, by continuously sending collision frames to the target device throughout the entire time period, channel conflicts can be forged more effectively, enabling the target device to automatically perform channel avoidance, thereby reducing the target device's channel preemption capability and effectively avoiding the defects of the camera device such as a large number of dropped calls or severe intercom lag.
[0094] The channel avoidance device provided in this disclosure is described below. The channel avoidance device described below can be referred to in correspondence with the channel avoidance method described above.
[0095] Figure 7 is a schematic diagram of a channel avoidance device provided in an embodiment of this disclosure, applied to a camera device. For example, as shown in Figure 7, the channel avoidance device 70 may include:
[0096] Modification unit 701 is configured to modify the checksum in the response message of the target network to the target device when it is determined that a target device exists in the target network, thereby obtaining a collision frame;
[0097] The sending unit 702 is configured to send the collision frame to the target device when the camera device receives the first data packet and the source network address of the first data packet matches the network address of the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0098] For example, in an embodiment of this disclosure, the sending unit 702 is configured to send the collision frame to the target device, including:
[0099] During the time interval between the reception time of the first data packet and the sending time of the response message from the target network to the first data packet, the collision frame is continuously sent to the target device.
[0100] For example, in this embodiment of the disclosure, the modification unit 701 is configured to determine that a target device exists in the currently accessed target network, including:
[0101] When the camera device is connected to the target network, network anomaly events are detected within a preset time period; wherein, the network anomaly events include at least one of network interruption events and events where the packet loss rate is greater than a preset packet loss rate threshold;
[0102] If the number or frequency of network anomalies exceeds a preset threshold, it is determined that the target device exists in the target network.
[0103] For example, in this embodiment of the disclosure, the modification unit 701 is configured to determine that the target device exists in the target network when the number or frequency of network anomaly events exceeds a preset threshold, including:
[0104] If the number or frequency of network anomalies exceeds the preset threshold, the camera device is controlled to acquire all second data packets in the target channel in monitoring mode; wherein, the target channel is the channel through which the camera device accesses the target network.
[0105] Each of the second data packets is parsed to obtain the source network address corresponding to each second data packet;
[0106] Based on the source network address corresponding to each of the second data packets, it is determined that the target device exists in the target network.
[0107] For example, in this embodiment of the disclosure, the modification unit 701 is configured to determine the existence of the target device in the target network based on the source network address corresponding to each second data packet, including:
[0108] Based on the source network address corresponding to each of the second data packets, determine the target network address corresponding to the maximum number of occurrences;
[0109] Based on the key network parameters corresponding to the target network address, the probability of suspicion corresponding to the target network address is determined;
[0110] If the probability of suspicion corresponding to the target network address is greater than a preset probability threshold, the sending device of the second data packet corresponding to the target network address is identified as the target device.
[0111] For example, in this embodiment of the disclosure, the key network parameters include average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value. The modification unit 701 is configured to determine the suspicious probability corresponding to the target network address based on the key network parameters corresponding to the target network address, including:
[0112] The average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value are compared with their own abnormal threshold values to obtain the corresponding comparison results.
[0113] The suspicious probability corresponding to the target network address is obtained by weighted summation of each comparison result and the corresponding abnormal weight value.
[0114] The channel avoidance device 70 provided in this embodiment can execute the technical solution of the channel avoidance method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the channel avoidance method. Please refer to the implementation principle and beneficial effects of the channel avoidance method. It will not be repeated here.
[0115] Figure 8 is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this disclosure. As shown in Figure 8, the electronic device may include: a processor 810, a communications interface (CI) 820, a memory 830, and a communication bus 840. The processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a channel avoidance method. This method includes: when it is determined that a target device exists in the target network, modifying the checksum in the response message of the target network to the target device to obtain a collision frame; when the camera device receives a first data packet and the source network address of the first data packet matches the network address of the target device, sending the collision frame to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0116] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of this disclosure. The aforementioned storage medium includes any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0117] On the other hand, this disclosure also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the channel avoidance method provided by any of the above methods. The method includes: when it is determined that a target device exists in a target network, modifying the checksum in the response message of the target network to the target device to obtain a collision frame; when the camera device receives a first data packet and the source network address of the first data packet matches the network address of the target device, sending the collision frame to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0118] In another aspect, this disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a channel avoidance method provided by any of the above methods. The method includes: upon determining that a target device exists in a target network, modifying a checksum in a response message from the target network to the target device to obtain a collision frame; and, upon the camera device receiving a first data packet and the source network address of the first data packet matching the network address of the target device, sending the collision frame to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
[0119] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in each of the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of each embodiment of this disclosure.
Claims
1. A channel avoidance method, applied to a camera device, comprising: If it is determined that a target device exists in the target network, the checksum in the response message of the target network to the target device is modified to obtain a collision frame; When the camera device receives a first data packet and the source network address of the first data packet matches the network address of the target device, it sends the collision frame to the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
2. The channel avoidance method according to claim 1, wherein, Sending the collision frame to the target device includes: During the time interval between the reception time of the first data packet and the sending time of the response message from the target network to the first data packet, the collision frame is continuously sent to the target device.
3. The channel avoidance method according to claim 1 or 2, wherein, The step of determining that a target device exists in the currently accessed target network includes: When the camera device is connected to the target network, network anomaly events are detected within a preset time period; wherein, the network anomaly events include at least one of network interruption events and events where the packet loss rate is greater than a preset packet loss rate threshold; If the number or frequency of network anomalies exceeds a preset threshold, it is determined that the target device exists in the target network.
4. The channel avoidance method according to claim 3, wherein, Determining the presence of the target device in the target network when the number or frequency of network anomalies exceeds a preset threshold includes: If the number or frequency of network anomalies exceeds the preset threshold, the camera device is controlled to acquire all second data packets in the target channel in monitoring mode; wherein, the target channel is the channel through which the camera device accesses the target network. Each of the second data packets is parsed to obtain the source network address corresponding to each second data packet; Based on the source network address corresponding to each of the second data packets, it is determined that the target device exists in the target network.
5. The channel avoidance method according to claim 4, wherein, The step of determining the existence of the target device in the target network based on the source network address corresponding to each second data packet includes: Based on the source network address corresponding to each of the second data packets, determine the target network address corresponding to the maximum number of occurrences; Based on the key network parameters corresponding to the target network address, the probability of suspicion corresponding to the target network address is determined; If the probability of suspicion corresponding to the target network address is greater than a preset probability threshold, the sending device of the second data packet corresponding to the target network address is identified as the target device.
6. The channel avoidance method according to claim 5, wherein, The key network parameters include average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value. Determining the suspicious probability corresponding to the target network address based on the key network parameters includes: The average network rate, maximum received signal strength indication, minimum arbitration inter-frame interval, and average backoff value are compared with their own abnormal threshold values to obtain the corresponding comparison results. The probability of suspicion corresponding to the target network address is obtained by weighted summation of each comparison result and the corresponding anomaly weight value.
7. The channel avoidance method according to claim 1, wherein, Before modifying the checksum in the response message from the target network to the target device to obtain the collision frame, the method further includes: After the camera device reconnects to the target network using the previously saved identifier and password, it obtains the preamble information. The response message of the target network to the target device is determined based on the preamble information.
8. The channel avoidance method according to claim 6, wherein, Also includes: Set the highest network rate as the abnormal threshold value of the average network rate.
9. A channel avoidance device, applied to a camera device, comprising: The modification unit is configured to modify the checksum in the response message of the target network to the target device when it is determined that a target device exists in the target network, thereby obtaining a collision frame; The sending unit is configured to send the collision frame to the target device when the camera device receives the first data packet and the source network address of the first data packet matches the network address of the target device; wherein the collision frame is used to instruct the target device to perform channel avoidance in the target network.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the channel avoidance method as described in any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the channel avoidance method as described in any one of claims 1 to 8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the channel avoidance method as described in any one of claims 1 to 8.