Anti-collision methods, devices, equipment and storage media for wireless channels
By employing a two-stage channel detection and random standby mechanism, combined with signal strength and synchronization word detection, the problem of data packet collisions caused by internal interference in the wireless channel is solved, thereby improving the anti-collision and anti-interference capabilities of wireless devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2022-12-09
- Publication Date
- 2026-07-17
AI Technical Summary
Existing wireless channel anti-collision mechanisms are ineffective in dealing with internal interference from alarm-type wireless devices, making it difficult to effectively avoid packet collisions and packet loss.
A two-stage collision detection method is adopted. First, the channel is checked for idleness and then randomly put into standby mode. Then, further signal detection is performed to determine the timing of transmission. By combining signal strength and synchronization word detection, packet collisions between internal devices are avoided.
It significantly reduces packet collisions and packet loss rates within wireless devices, improving anti-interference performance, especially in complex environments such as offices.
Smart Images

Figure CN116017758B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and storage medium for preventing collisions in a wireless channel. Background Technology
[0002] Currently, the anti-collision mechanisms of alarm wireless devices are all implemented through CCA (Clear Channel Assessment) or LBT (Listen Before Talk), and the specific principle is as follows:
[0003] 1. Set a signal strength threshold. When the device needs to send wireless data, it first detects the current signal strength of the channel. If the current signal strength is higher than the signal strength threshold, it is determined that the current channel is busy; otherwise, it is determined that the channel is idle.
[0004] 2. If the current channel is idle, the device will send packets directly; if the current signal strength is higher than the signal strength threshold, the device will continue to monitor. Time until the channel is idle;
[0005] 3. If the equipment is continuously monitored The channel remains busy after a certain time, with random delays. ms, keep the device in standby mode;
[0006] 4. Delay After ms, channel busy detection is performed again. If the channel is idle, the device sends packets directly. If the signal strength threshold is exceeded, detection continues. Time until the channel is idle;
[0007] 5. If the channel is still busy, force the transmission of data packets.
[0008] However, the CCA process mentioned above involves , as well as These are all common anti-collision mechanisms used to avoid external noise, and they involve... , as well as These are all fixed values, which are insufficient to prevent interference within alarm-type wireless devices. Summary of the Invention
[0009] The main objective of this application is to provide a method, apparatus, device, and storage medium for preventing collisions in wireless channels, aiming to solve the technical problem of poor anti-collision or anti-interference effects within alarm-type wireless devices.
[0010] To achieve the above objectives, this application provides a method for preventing collisions in a wireless channel, applied to a first wireless transmitting device in a wireless system. The system further includes a second wireless transmitting device and a gateway device. The method for preventing collisions in a wireless channel includes:
[0011] Phase 1 Collision Detection: When preparing to send a data packet, the signal received on the corresponding channel is detected and continuously monitored. Time, and / or until the corresponding channel is detected to be idle;
[0012] Random standby Time, the stated Time requirement met:
[0013] Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system.
[0014] The second stage of collision detection involves detecting the signals received on the corresponding channel and continuously monitoring them. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0015] In one possible implementation of this application, the Time and the Time requirement met:
[0016] The This refers to the sending time associated with data packets within the system.
[0017] In one possible implementation of this application, for each stage of collision detection, if it is determined that the signal strength of the signal received on the corresponding channel is not greater than a preset strength threshold, it is necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle.
[0018] In one possible implementation of this application, the detection of the signal received by the corresponding channel is performed and continuously monitored. The time, and / or the step until the corresponding channel is detected to be idle, includes:
[0019] Signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold.
[0020] If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel;
[0021] If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is detected to be idle.
[0022] In one possible implementation of this application, the detection of the signal received by the corresponding channel is performed and continuously monitored. The time, and / or the step until the corresponding channel is determined to be idle, includes:
[0023] Signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold.
[0024] If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel;
[0025] If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is determined to be idle.
[0026] In one possible implementation of this application, both the first wireless transmitting device and the second wireless transmitting device are microcontroller devices.
[0027] This application also provides a wireless channel anti-collision device, applied to a first wireless transmitting device in a wireless system, the system further including a second wireless transmitting device and a gateway device, the wireless channel anti-collision device comprising:
[0028] The first-stage collision detection module is used to detect the signals received on the corresponding channel when preparing to send data packets, and to continuously detect them. Time, and / or until the corresponding channel is detected to be idle;
[0029] Standby module, used for random standby. Time, the stated Time requirement met:
[0030] Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system.
[0031] The second-stage collision detection module is used to detect the signals received on the corresponding channel and to continuously detect them. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0032] In one possible implementation of this application, the Time and the Time requirement met:
[0033] The This refers to the sending time associated with data packets within the system.
[0034] And / or for each stage of collision detection, if it is determined that the signal strength of the signal received on the corresponding channel is not greater than a preset strength threshold, it is also necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle.
[0035] And / or the apparatus is further configured to: perform signal detection on the corresponding channel, determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold; if not greater, determine whether a data packet with a valid synchronization word is detected in the corresponding channel; if a data packet with a valid synchronization word is detected, detect the signal received on the corresponding channel and continue to detect. Time, and / or until the corresponding channel is detected to be idle;
[0036] And / or the apparatus is further configured to: perform signal detection on the corresponding channel, determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold; if not greater, determine whether a data packet with a valid synchronization word is detected in the corresponding channel; if a data packet with a valid synchronization word is detected, detect the signal received on the corresponding channel and continue to detect. Time, and / or until the corresponding channel is determined to be idle;
[0037] And / or both the first wireless transmitting device and the second wireless transmitting device are single-chip microcomputer devices.
[0038] This application also provides a wireless channel anti-collision device, the device comprising: a memory, a processor, and a wireless channel anti-collision program stored in the memory and executable on the processor, the wireless channel anti-collision program being configured to implement the steps of the wireless channel anti-collision method as described in any of the preceding claims.
[0039] This application also provides a storage medium storing a wireless channel anti-collision program, which, when executed by a processor, implements the steps of the wireless channel anti-collision method as described in any of the preceding claims.
[0040] This application provides a method for preventing collisions in wireless channels. Compared with existing technologies that use common anti-collision mechanisms to avoid external noise and thus prevent collisions in the wireless channel within the system, resulting in poor anti-collision or anti-interference effects within the wireless device, the method for preventing collisions in wireless channels in this application includes: a first-stage collision detection: when preparing to send a data packet, detecting the signal received on the corresponding channel and continuously detecting... Time, and / or until the corresponding channel is detected to be idle; random standby. Time, the stated Time requirement met: Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the The first stage is the parsing time for data packet association within the system; the second stage is collision detection: detecting the signals received on the corresponding channel and continuously detecting them. The timing for sending data packets is determined by the time, and / or until it is determined that the corresponding channel is idle, then the current moment is considered the optimal time. In this application, Time satisfied This can be understood as avoiding the collision between the data packets to be sent and the response data packets. In addition, N is related to the number of devices in the wireless system, thus effectively avoiding the possibility of collision between response data packets from different devices in the system, further improving the anti-collision or anti-interference effect. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the first scenario of the anti-collision method for the wireless channel of this application;
[0042] Figure 2 This is a flowchart illustrating the first embodiment of the anti-collision method for wireless channels in this application;
[0043] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application;
[0044] Figure 4 This is a schematic diagram illustrating the two-way wireless interaction between different devices involved in the anti-collision method of the wireless channel of this application.
[0045] Figure 5 This is a schematic diagram of the synchronization word detection involved in the anti-collision method for the wireless channel of this application;
[0046] Figure 6 This is an overall schematic diagram of the anti-collision detection of the wireless channel involved in this application.
[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application. Although the terms first, second, third, etc., may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.
[0049] This application provides a method for preventing collisions in a wireless channel, referring to... Figure 1 In this embodiment, a first wireless transmitting device is applied to a wireless system, the system further includes a second wireless transmitting device and a gateway device, and the anti-collision method for the wireless channel includes:
[0050] Step S10: First-stage collision detection: When preparing to send a data packet, the signal received on the corresponding channel is detected and continuously monitored. Time, and / or until the corresponding channel is detected to be idle;
[0051] Step S20: Random standby Time, the stated Time requirement met:
[0052] Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system.
[0053] Step S30: Second-stage collision detection: Detect the signal received on the corresponding channel and continue detection. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0054] In this embodiment, the basic concepts are explained first:
[0055] Wireless: refers to the wireless transmission of signals. Compared with wired transmission, wireless transmission has more interference and instability.
[0056] Single channel: A wireless channel refers to a wireless "frequency band (Channel)," and a single channel means using only one wireless "frequency band." In this embodiment, the anti-collision of the wireless channel involved is the anti-collision of a single wireless channel. Since this embodiment involves the anti-collision of a single wireless channel, it is necessary to consider the response status after the data packet is sent.
[0057] SUB-G: refers to wireless networking technology in the frequency band below 1GHz. SUB-G has a slower speed but a longer transmission distance, making it suitable for the Internet of Things (IoT) field with small data volumes.
[0058] Anti-collision: A single channel can only support the interaction of one wireless data packet at a time. If there are two or more wireless data packets interacting, they will interfere with each other, resulting in data loss. Anti-collision refers to the mechanism or solution to avoid this interference.
[0059] Microcontroller: also known as a single-chip microcomputer. The first wireless transmitting device and the second wireless transmitting device in this application are both single-chip microcomputers (the first wireless transmitting device and the second access device are specifically a wireless detector and a remote control). They are suitable for simple logic processing. However, single-chip microcomputers are limited by instruction and storage space and cannot perform a large number of large number operations. Compared with computers, single-chip microcomputers have a longer delay when processing complex algorithms. Therefore, when designing anti-collision management, the timeliness of the specific product needs to be considered to avoid additional hardware costs and reduce the user experience of the product.
[0060] Therefore, it should be emphasized that the access device described in this application is not applicable to situations where significant computing resources are required for data statistics and modeling.
[0061] Wireless system: refers to a system that interacts wirelessly through a wireless network. It consists of a gateway device, a first wireless transmitting device (wireless detector or remote control), other second wireless transmitting devices, and wireless peripherals. The wireless detectors / peripherals are connected to the host via a SUB-G network. The host interacts with the outside world (external devices such as the cloud or clients) via a data card, Wi-Fi, or wired network.
[0062] Signal strength: refers to the strength of the signal used by wireless devices;
[0063] Noise, also known as interference, refers to noise caused by external interference entering the system via electromagnetic waves or power supply. Examples include noise from electrical equipment and celestial discharge phenomena. Internal noise refers to noise generated by the circuitry of the system's internal equipment. Noise is not a fixed value, but natural noise follows a Gaussian distribution. When the signal strength is lower than the noise level, wireless data is likely to be lost.
[0064] Synchronization word detection: The synchronization word is a common data segment in the SUB-G wireless data structure, used to distinguish whether the current data packet needs to be parsed. It should be noted that each wireless system has an independent and fixed synchronization field (generally only 1-4 bytes). When any wireless device in the system receives a data packet whose synchronization word matches the synchronization field set within its own system, it can determine that this data packet is from within that system and needs to be parsed; otherwise, it is a data packet from another system and can be discarded.
[0065] It should be noted that the basic structure of a data packet can be divided into: preamble, synchronization word, data header, CRC checksum, and valid data. The preamble is a series of signals sent before transmitting the useful signal to alert the receiver to prepare for reception and avoid losing the useful signal; the length of the preamble depends on the actual application. The synchronization word is an identification ID of only 1-4 bytes, used to identify the data source. The synchronization word is also used to align the data (setting different byte counts in the synchronization word distinguishes between the preamble and the valid data).
[0066] In this embodiment, the research and development background is as follows:
[0067] Currently, the anti-collision mechanisms of alarm wireless devices are all implemented through CCA (Clear Channel Assessment) or LBT (Listen Before Talk), and the specific principle is as follows:
[0068] 1. Set a signal strength threshold. When the device needs to send wireless data, it first detects the current signal strength of the channel. If the current signal strength is higher than the signal strength threshold, it is determined that the current channel is busy; otherwise, it is determined that the channel is idle.
[0069] 2. If the current channel is idle, the device will send packets directly; if the current signal strength is higher than the signal strength threshold, the device will continue to monitor. Time until the channel is idle;
[0070] 3. If the equipment is continuously monitored The channel remains busy after a certain time, with random delays. ms, keep the device in standby mode;
[0071] 4. Delay After ms, channel busy detection is performed again. If the channel is idle, the device sends packets directly. If the signal strength threshold is exceeded, detection continues. Time until the channel is idle;
[0072] 5. If the channel is still busy, force the transmission of data packets.
[0073] During the research process, the inventors used actual data statistics as the standard and found that in an office development environment, the device received 2,619 packets and lost 42 packets in a certain period of time, with a packet loss rate of 1.6%.
[0074] Based on this, the inventors considered that in the above-mentioned CCA process, the current anti-collision mechanism can play a certain role in resisting interference in most external interference scenarios. However, in the office development environment, wireless packet loss and interference will still occur.
[0075] Through research, the inventors noticed that the issue in the office development environment was due to interference from a large amount of response data.
[0076] Based on this, the inventors propose an anti-collision scheme for wireless channels in this application, aiming to improve the anti-collision or anti-interference effect.
[0077] Specifically, the anti-collision method for wireless channels in this application includes: a first-stage collision detection: when preparing to send a data packet, detecting the signal received by the corresponding channel and continuously detecting... Time, and / or until the corresponding channel is detected to be idle; random standby. Time, the stated Time requirement met: Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the The first stage is the parsing time for data packet association within the system; the second stage is collision detection: detecting the signals received on the corresponding channel and continuously detecting them. The timing for sending data packets is determined by the time, and / or until it is determined that the corresponding channel is idle, then the current moment is considered the optimal time. In this application, Time satisfied This can be understood as avoiding the collision between the data packets to be sent and the response data packets. In addition, N is related to the number of devices in the wireless system, thus effectively avoiding the possibility of collision between response data packets from different devices in the system, further improving the anti-collision or anti-interference effect.
[0078] Furthermore, the inventors discovered that within the same system, if the number of connected devices remains unchanged, , as well as They all follow certain patterns, therefore, , , It can be a fixed value obtained after actual measurement, because , , It can be a fixed value obtained after actual measurement rather than one that needs to be changed frequently. Therefore, this also facilitates the stability of the anti-collision or anti-interference effect of different systems.
[0079] The specific steps are as follows:
[0080] Step S10, First-stage collision detection: When preparing to send a data packet, the signal received on the corresponding channel is detected and continuously monitored. Time, and / or until the corresponding channel is detected to be idle;
[0081] As an example, both the first wireless transmitting device and the second wireless transmitting device are microcontroller devices.
[0082] As an example, the wireless channel in the anti-collision method for wireless channels is a single wireless channel.
[0083] As an example, anti-collision methods for wireless channels are primarily used to prevent collisions between transmitted and received data packets within a wireless system.
[0084] As an example, a wireless system is a wireless alarm system.
[0085] As an example, a wireless system consists of multiple nodes.
[0086] As an example, the nodes set up in the wireless system include: a first wireless transmitting device, a second wireless transmitting device, a gateway device, and an output device, etc.
[0087] As an example, both the first and second wireless transmitting devices are wireless detectors.
[0088] As an example, the first wireless transmitting device is a wireless detector, and the second wireless transmitting device is a remote control; no specific limitations are imposed.
[0089] As an example, there can also be multiple second wireless transmitting devices, that is, the wireless system can be equipped with three or more wireless detectors;
[0090] As an example, both wireless detectors and remote controllers are microcontrollers, which are limited by instruction and access space and cannot perform a large number of large number operations.
[0091] As an example, both the first and second wireless transmitting devices are connected to a gateway device (such as a host) via a SUB-G network. The gateway device (such as the host) interacts with external devices (such as cloud devices or clients) via a data SIM card, Wi-Fi, or wired network connection. Figure 1 .
[0092] As an example, after both the first wireless transmitting device and the second wireless transmitting device are connected to a gateway device (such as a host) via a SUB-G network, when the first wireless transmitting device sends a data packet to the gateway device, it is easily affected by the data packets or response data packets sent by the second wireless transmitting device or other devices.
[0093] As an example, Figure 4 A schematic diagram illustrating wireless interaction between the first wireless transmitting device and the gateway device.
[0094] As an example, both sending and responding to data packets require the use of a channel.
[0095] As an example, the actual application scenario of this application is as follows:
[0096] Many families have installed wireless alarm systems outside their homes, which promptly alert the authorities when unauthorized intrusion is detected.
[0097] To enable the wireless alarm system to promptly alert the system when an intruder is detected, multiple wireless detectors need to be installed. After detecting data, these detectors connect via the SUB-G network and send the corresponding data to the gateway device.
[0098] As an example, when the first wireless transmitting device is preparing to send a data packet, it invokes the anti-collision mechanism or backoff strategy of the corresponding channel in the pre-configured wireless system.
[0099] As an example, the anti-collision mechanism or backoff strategy is configured locally;
[0100] As an example, the anti-collision mechanism or backoff strategy, when it needs to be updated, can be configured by the gateway device and distributed locally.
[0101] As an example, when the anti-collision mechanism or backoff strategy is configured by the gateway device and sent locally, if the gateway device changes its configuration accordingly, the anti-collision mechanism or backoff strategy of the first wireless transmitting device will also be changed accordingly.
[0102] As an example, since the anti-collision mechanism or backoff policy is configured and distributed locally by the gateway device, the backoff policy can be flexibly changed.
[0103] The anti-collision mechanism or backoff strategy in this embodiment specifically includes:
[0104] As an example, when a wireless device is preparing to send a data packet, it detects the signal strength of the signal received on the corresponding channel.
[0105] As an example, when a wireless device is preparing to send a data packet, it checks for valid synchronization word data packets of the signals received on the corresponding channel.
[0106] As an example, when a wireless device is preparing to send a data packet, it checks the signal strength of the signal received on the corresponding channel and the valid synchronization word data packet.
[0107] As an example, the process of detecting the signal received on the corresponding channel continues. The testing process ends when the time is up.
[0108] As an example, when detecting the signal received on the corresponding channel, if the received signal strength is consistently greater than or equal to a set threshold (signal strength threshold is approximately -95 dBm, 0x50), then... The testing process ends when the time is up.
[0109] As an example, if the corresponding channel is not continuously detected... However, if the received signal strength is detected to be less than the set threshold, the corresponding channel is considered idle, and the detection process ends.
[0110] As an example, if the corresponding channel is not continuously detected... If the received signal strength is less than a set threshold, but a signal can be detected continuously, then continue... The testing process ends when the time is up.
[0111] Step S20, random standby Time, the stated Time requirement met:
[0112] Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system.
[0113] As an example, the inventors further discovered that in the current wireless protocol, devices interact bidirectionally. In a single-channel wireless environment, after device A sends a packet to device B, it needs to wait for device B to respond (due to the nature of the single channel). There are often some idle time slots between packet sending and response. These time slots are often very short and insufficient to meet the requirement of sending a complete protocol data packet. Based on the current anti-collision mechanism or backoff strategy, data packets may be sent during idle time slots. This can cause the current anti-collision delay to delay and backoff normal packet sending, but it may cause packet collisions and interference with responses.
[0114] Based on this, the inventors considered: random standby under certain conditions. Time, and set The duration of the detection The wireless device enters a standby period after a certain time, or after detecting that the channel is idle.
[0115] As an example, standby time period and , as well as All are related.
[0116] As an example, the maximum standby time period ,max All data packets are associated to minimize data packet conflicts.
[0117] As an example, random standby occurs when the number of devices in a wireless system changes. Corresponding changes.
[0118] As an example, the reason why the random standby time changes when the number of second wireless transmitting devices changes is that different devices have different start response times, and therefore, it is necessary to avoid conflict with the response data packets of each device.
[0119] As an example, taking a wireless application system as an example, the time to send the wake-up long packet is the longest (270ms), the actual parsing time is 24ms, and the time to send the response is 24ms.
[0120] in, It can be defined as 270+5ms. Defined as 24+5ms to 125(N=25)+24+5ms; It takes 5ms. (125ms + 5ms)
[0121] Experiments have verified that, after modification in the above manner, the CCA process is no longer affected by bidirectional packet collisions within the system.
[0122] As an example, wireless systems are not static; when a new detector is connected to a wireless system, , , as well as Everything is subject to change.
[0123] Based on this, as an example, when the gateway device needs to update the anti-collision policy, it supports wirelessly sending the information to the detectors (nodes). , , as well as That is, to achieve , and Configuration.
[0124] As an example, the It is related to the number of access devices in the system and the efficiency of wireless transmission.
[0125] As an example, due to the stated It is related to the number of access devices and wireless transmission efficiency within the system. Therefore, it avoids excessive fault tolerance time, which would waste channel resources, and also avoids excessive fault tolerance time, which would prevent the fault tolerance time from playing its role in avoiding conflicts.
[0126] Step S30, Second stage collision detection: Detect the signal received on the corresponding channel and continue detection. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0127] As an example, after the standby time period T2, the signal received by the channel continues to be detected.
[0128] As an example, after a standby time period T2, the signal strength of the signal received on the corresponding channel is detected.
[0129] As an example, after the standby time period T2, the valid synchronization word data packets of the signals received by the corresponding channel are detected.
[0130] As an example, after the standby time period T2, the signal strength and valid synchronization word data packets of the signals received on the corresponding channel are detected.
[0131] As an example, the process of detecting the signal received on the corresponding channel continues. The testing process ends when the time is up.
[0132] As an example, when detecting the signal received on the corresponding channel, if the received signal strength is consistently greater than or equal to a set threshold (signal strength threshold is approximately -95 dBm, 0x50), then... The testing process ends when the time is up.
[0133] As an example, if the corresponding channel is not continuously detected... However, if the received signal strength is detected to be less than the set threshold, the corresponding channel is considered idle, and the detection process ends.
[0134] As an example, if the corresponding channel is not continuously detected... If, within a certain time frame, the received signal strength is detected to be less than a set threshold, but a signal can still be detected, then the process continues... The testing process ends when the time is up.
[0135] As an example, taking a wireless application system as an example, the time to send the wake-up long packet is the longest (270ms), the actual parsing time is 24ms, and the time to send the response is 24ms.
[0136] in, It can be defined as 270+5ms. Defined as 24+5ms to 125(N=25)+24+5ms, T3 is defined as 24+5ms; It takes 5ms. (125ms + 5ms)
[0137] As an example, the signal received by the corresponding channel is detected and continuously detected. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0138] As an example, T1, T2, and T3 have an ordinal relationship, but not any other relationship.
[0139] In this embodiment, the Time and the Time requirement met:
[0140] The This refers to the sending time associated with data packets within the system.
[0141] That is, in this embodiment, The This refers to the time when data packets are sent within the system. This is the maximum sending time associated with data packets within the system, and The This refers to the response time for data packets within the system. This refers to the maximum response time associated with data packets within the system.
[0142] Overall, in this embodiment, as Figure 4 As shown, we can conclude that:
[0143] ;
[0144] because Therefore, the time parameter , , The stacked packets all take longer than any single long wake-up packet to avoid packet collisions that can still occur when sending long wake-up packets.
[0145] In other words, in this embodiment, the inventors discovered that current wireless protocols have a long packet wake-up mechanism, where a wake-up long packet needs to be sent for a very long time. However, if the time parameter... , , The stacking of packets does not have a longer packet transmission time than a single long wake-up packet, which can lead to packet collision interference even during anti-collision delay backoff.
[0146] Based on this, the inventors considered that if the time of sending the data packet is recorded as... The time for parsing data packets is denoted as The data packet response time is recorded as If the maximum transmission time, maximum parsing time, and maximum acknowledgment time associated with all data packets in the wireless system are used instead of the transmission time, parsing time, and acknowledgment time corresponding to ordinary data packets, then the phenomenon of packet collision interference that still occurs during anti-collision delay backoff caused by the current transmitted data packet being a wake-up long packet can be avoided.
[0147] As an example, after determining the timing for sending the data packet, the data packet is sent based on the timing.
[0148] This application provides a method for preventing collisions in wireless channels. Compared with existing technologies that use common anti-collision mechanisms to avoid external noise and thus prevent collisions in the wireless channel within the system, resulting in poor anti-collision or anti-interference effects within the wireless device, the method for preventing collisions in wireless channels in this application includes: a first-stage collision detection: when preparing to send a data packet, performing signal detection on the corresponding channel and continuously detecting... Time, and / or until the corresponding channel is detected to be idle; random standby. Time, the stated Time requirement met: Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the The first stage is the parsing time for data packet association within the system; the second stage is collision detection: signal detection is performed on the corresponding channel, and continuous detection is continued. The timing for sending data packets is determined by the time, and / or until it is determined that the corresponding channel is idle, then the current moment is considered the optimal time. In this application, Time satisfied This can be understood as avoiding the collision between the data packets to be sent and the response data packets. In addition, N is related to the number of devices in the wireless system, thus effectively avoiding the possibility of collision between response data packets from different devices in the system, further improving the anti-collision or anti-interference effect.
[0149] Furthermore, based on the first embodiment of this application, a second embodiment of this application is provided. In this embodiment, for each stage of collision detection, if it is determined that the signal strength of the signal received by the corresponding channel is not greater than a preset strength threshold, it is also necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle.
[0150] As an example, the inventors used actual data statistics during the research process and found that in an office development environment, the device received 2,619 packets and lost 42 packets in a certain period of time, with a packet loss rate of 1.6%. Among them, 36 of the losses were due to the failure of the CCA signal threshold.
[0151] Based on this, the inventors considered that the current anti-collision detection of wireless systems relies on a custom signal strength threshold. That is, when detecting the signal received by the corresponding channel, the corresponding signal is considered to have interference if it is above the signal strength threshold, and to have no interference (idle) if it is below the signal strength threshold. However, sometimes data below the signal strength threshold can also cause actual interference, even if the data cannot be received completely because the signal is too low.
[0152] Through experiments and using actual data, the inventors discovered that the currently used CCA signal strength threshold is 0x50 (approximately -95dBm). However, before and after periods of signal conflict, the signal strength of some valid data received by the device is much lower than 0x50 (the signal strength range of the test data is between 0x38 and 0x43). The device's noise floor signal strength is around 0x30-0x40; data below this value is highly likely to be incorrectly received. In other words, the current CCA mechanism can only effectively detect channel data with relatively strong signal strength, and cannot detect channel data close to the device's noise level.
[0153] The inventors thought that by lowering the CCA signal strength threshold, they could receive some valid data with signal strength much less than 0x50. However, experiments showed that if the CCA signal strength threshold was forcibly lowered, the device might misjudge the device's noise floor as channel occupancy.
[0154] Furthermore, the inventors realized that, while retaining the original CCA mechanism, synchronization word detection could be used to determine whether the corresponding channel is free from interference.
[0155] For each stage of collision detection, if it is determined that the signal strength of the received signal on the corresponding channel is not greater than a preset strength threshold, it is necessary to further determine whether a data packet with a valid synchronization word has been detected on the corresponding channel. Only if no data packet with a valid synchronization word is detected is the corresponding channel finally determined to be idle. The specific process is as follows: Figure 5 As shown. Before the detection begins, the system configures a SUB-G RF transceiver for each device (when the SUB-G RF transceiver receives data with a specified synchronization word ID, it will notify each device that data has been detected through a preset or specified interrupt pin and signal, i.e., the RF transceiver is used for synchronization word ID detection).
[0156] As an example, since each wireless system has an independent and fixed synchronization word ID, the first wireless transmitting device can quickly identify whether the corresponding interference is from its own system.
[0157] As an example, although data below the noise floor signal strength value may be highly unlikely to be received correctly, it can be accurately detected when it affects the transmission of data packets by the first wireless transmitter, thus enabling the first wireless transmitter to avoid such data below the noise floor signal strength value.
[0158] As an example, the inventors used actual data to show that in an office development environment, the device received 2,619 packets and lost 42 packets in a certain period of time, with a packet loss rate of 1.6%. Among them, 36 packets were lost due to the failure of the CCA signal threshold. After adding synchronization word detection, the device received 1,073 packets and lost 8 packets, reducing the packet loss rate to 0.71%, and the problem of CCA signal threshold detection failure no longer occurred.
[0159] Furthermore, based on the first and second embodiments of this application, a third embodiment of this application is provided, wherein the signal received by the corresponding channel is detected and continuously detected. The time, and / or the step until the corresponding channel is detected to be idle, includes:
[0160] Step A1: Perform signal detection on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold.
[0161] Step A2: If the value is not greater than the specified value, determine whether a data packet with a valid synchronization word has been detected in the corresponding channel.
[0162] Step A3: If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is detected to be idle.
[0163] This embodiment describes how anti-collision detection is performed in the first stage, specifically as follows: Figure 6 The first detection shows that when preparing to send a data packet, signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold. If it is greater, the corresponding channel is determined to be busy, and detection continues. The time, and / or until the corresponding channel is detected to be idle, if not greater than a certain value, determines whether a data packet with a valid synchronization word has been detected in the corresponding channel. If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected, and the detection continues. Time, and / or until the corresponding channel is detected to be idle ( Figure 6 (The first test in the process).
[0164] Wait for time T2. The setting of time T2 is basically the same as in the above embodiment, and will not be repeated here.
[0165] like Figure 6 As shown, the signal received by the corresponding channel is detected and continuously detected. The time, and / or the step until the corresponding channel is determined to be idle, includes:
[0166] Step B1: Perform signal detection on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold.
[0167] Step B2: If the value is not greater than the specified value, determine whether a data packet with a valid synchronization word has been detected in the corresponding channel.
[0168] Step B3: If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is determined to be idle.
[0169] This embodiment describes how anti-collision detection is performed in the second stage, specifically as follows: Figure 6 The second detection shows that after a standby time T2, signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold. If it is greater, the corresponding channel is determined to be busy, and detection continues. The time, and / or until the corresponding channel is detected to be idle, if not greater than a certain value, determines whether a data packet with a valid synchronization word has been detected in the corresponding channel. If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected, and the detection continues. Time, and / or until the corresponding channel is detected to be idle ( Figure 6 (Second test in the process).
[0170] In this embodiment, both the first-stage collision detection and the second-stage collision detection are for each stage of collision detection. If it is determined that the signal strength of the signal received by the corresponding channel is not greater than the preset strength threshold, it is also necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle, thus improving the anti-collision detection effect.
[0171] Reference Figure 3 , Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0172] like Figure 3 As shown, the anti-collision device for this wireless channel may include: a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005.
[0173] Optionally, the anti-collision device for this wireless channel may also include a user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, a WiFi module, etc. The user interface may include a display screen, an input submodule such as a keyboard, and optionally, standard wired or wireless interfaces. The network interface may include standard wired or wireless interfaces (such as a Wi-Fi interface).
[0174] Those skilled in the art will understand that Figure 3 The anti-collision device structure for wireless channels shown does not constitute a limitation on anti-collision devices for wireless channels. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0175] like Figure 3 As shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, and a port power reduction program. The operating system is a program that manages and controls the hardware and software resources of the anti-collision device for the wireless channel, and supports the operation of the port power reduction program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the port power reduction system.
[0176] exist Figure 3 In the anti-collision device for the wireless channel shown, the processor 1001 is used to execute the port power reduction program stored in the memory 1005 to implement the steps of the port power reduction method described above.
[0177] The specific implementation of the anti-collision device for the wireless channel in this application is basically the same as the embodiments of the above-described methods for reducing port power consumption, and will not be repeated here.
[0178] This application also provides a wireless channel anti-collision device, applied to a first wireless transmitting device in a wireless system, the system further including a second wireless transmitting device and a gateway device, the wireless channel anti-collision device comprising:
[0179] The first-stage collision detection module is used to detect the signals received on the corresponding channel when preparing to send data packets, and to continuously detect them. Time, and / or until the corresponding channel is detected to be idle;
[0180] Standby module, used for random standby. Time, the stated Time requirement met:
[0181] Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system.
[0182] The second-stage collision detection module is used to detect the signals received on the corresponding channel and to continuously detect them. The timing for sending data packets is determined by the time, and / or until the corresponding channel is determined to be idle, at the current moment.
[0183] In one possible implementation of this application, the Time and the Time requirement met:
[0184] The This refers to the sending time associated with data packets within the system.
[0185] And / or for each stage of collision detection, if it is determined that the signal strength of the signal received on the corresponding channel is not greater than a preset strength threshold, it is also necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle.
[0186] And / or the apparatus is further configured to: perform signal detection on the corresponding channel, determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold; if not greater, determine whether a data packet with a valid synchronization word is detected in the corresponding channel; if a data packet with a valid synchronization word is detected, detect the signal received on the corresponding channel and continue to detect. Time, and / or until the corresponding channel is detected to be idle;
[0187] And / or the apparatus is further configured to: perform signal detection on the corresponding channel, determine whether the current signal strength of the signal received on the corresponding channel is greater than the signal strength threshold; if not greater, determine whether a data packet with a valid synchronization word is detected in the corresponding channel; if a data packet with a valid synchronization word is detected, detect the signal received on the corresponding channel and continue to detect. Time, and / or until the corresponding channel is determined to be idle;
[0188] And / or both the first wireless transmitting device and the second wireless transmitting device are single-chip microcomputer devices.
[0189] The specific implementation of the anti-collision device for wireless channels in this application is basically the same as the embodiments of the anti-collision method for wireless channels described above, and will not be repeated here.
[0190] This application also provides a storage medium storing a wireless channel anti-collision program, which, when executed by a processor, implements the steps of the wireless channel anti-collision method as described in any of the preceding claims.
[0191] The specific implementation of the storage medium in this application is basically the same as the anti-collision embodiments of the wireless channel described above, and will not be repeated here.
[0192] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0193] 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.
[0194] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, 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 is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0195] The above are merely preferred embodiments of this application and do not limit the scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the protection scope of this application.
Claims
1. A method for preventing collisions in a wireless channel, characterized in that, A first wireless transmitting device is used in a wireless system, the system further includes a second wireless transmitting device and a gateway device, the wireless channel is a single wireless channel, and the anti-collision method for the wireless channel includes: Phase 1 Collision Detection: When preparing to send a data packet, the signal received on the corresponding channel is detected and continuously monitored. Time, and / or until the corresponding channel is detected to be idle; Random standby Time, the stated Time requirement met: Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system. The second stage of collision detection involves detecting the signals received on the corresponding channel and continuously monitoring them. The timing for sending a data packet is determined by the time, and / or until it is determined that the corresponding channel is idle.
2. The anti-collision method for wireless channels as described in claim 1, characterized in that, The Time and the Time requirement met: The This refers to the sending time associated with data packets within the system.
3. The anti-collision method for wireless channels as described in claim 1, characterized in that, For each stage of collision detection, if it is determined that the signal strength of the signal received on the corresponding channel is not greater than the signal strength threshold, it is still necessary to determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. Only if no data packet with a valid synchronization word has been detected is the corresponding channel finally determined to be idle.
4. The anti-collision method for wireless channels as described in claim 3, characterized in that, The signal received by the corresponding channel is detected and continuously detected. The time, and / or the step until the corresponding channel is detected to be idle, includes: Signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received by the corresponding channel is greater than the signal strength threshold. If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel; If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is detected to be idle.
5. The anti-collision method for wireless channels as described in claim 3, characterized in that, The signal received by the corresponding channel is detected and continuously detected. The time, and / or the step until the corresponding channel is determined to be idle, includes: Signal detection is performed on the corresponding channel to determine whether the current signal strength of the signal received by the corresponding channel is greater than the signal strength threshold. If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel; If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is determined to be idle.
6. The anti-collision method for wireless channels as described in claim 1, characterized in that, Both the first wireless transmitting device and the second wireless transmitting device are microcontroller devices.
7. A wireless channel anti-collision device, characterized in that, A first wireless transmitting device is applied in a wireless system, the system further includes a second wireless transmitting device and a gateway device, the wireless channel is a single wireless channel, and the anti-collision device for the wireless channel includes: The first-stage collision detection module is used to detect the signals received on the corresponding channel when preparing to send data packets, and to continuously detect them. Time, and / or until the corresponding channel is detected to be idle; Standby module, used for random standby. Time, the stated Time requirement met: Where N is related to the number of devices in the wireless system, the This is the preset fault tolerance time. The response time associated with data packets within the system, the This refers to the parsing time for data packet associations within the system. The second-stage collision detection module is used to detect the signals received on the corresponding channel and to continuously detect them. The timing for sending a data packet is determined by the time, and / or until it is determined that the corresponding channel is idle.
8. The anti-collision device for a wireless channel as described in claim 7, characterized in that, The Time and the Time requirement met: The This refers to the sending time associated with data packets within the system. And / or for each stage of collision detection, if it is determined that the signal strength of the signal received on the corresponding channel is not greater than the signal strength threshold, it is also necessary to further determine whether a data packet with a valid synchronization word has been detected in the corresponding channel. If no data packet with a valid synchronization word has been detected, the corresponding channel is finally determined to be idle. And / or the device is further configured to: perform signal detection on the corresponding channel and determine whether the current signal strength of the signal received by the corresponding channel is greater than the signal strength threshold; If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel; If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is detected to be idle; And / or the device is further configured to: perform signal detection on the corresponding channel and determine whether the current signal strength of the signal received by the corresponding channel is greater than the signal strength threshold; If it is not greater than, then determine whether a data packet with a valid synchronization word has been detected in the corresponding channel; If a data packet with a valid synchronization word is detected, the signal received on the corresponding channel is detected and the detection continues. Time, and / or until the corresponding channel is determined to be idle; And / or both the first wireless transmitting device and the second wireless transmitting device are single-chip microcomputer devices.
9. A device for preventing collisions in a wireless channel, characterized in that, The device includes: a memory, a processor, and a wireless channel anti-collision program stored in the memory and executable on the processor, the wireless channel anti-collision program being configured to implement the steps of the wireless channel anti-collision method as described in any one of claims 1 to 6.
10. A storage medium, characterized in that, The storage medium stores a wireless channel anti-collision program, which, when executed by a processor, implements the steps of the wireless channel anti-collision method as described in any one of claims 1 to 6.