Bidirectional wireless communication frequency hopping method, system, device and medium

By performing channel self-testing and switching when communication is interrupted, combined with an adaptive spreading factor algorithm, the problem of communication interference in densely populated frequency bands is solved, and fast and reliable communication reconnection and synchronous frequency hopping data transmission are achieved.

CN120897276AActive Publication Date: 2025-11-04HUNAN DINGLI ELECTRIC TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511427480.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-11-04
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

In frequency bands with high user density, when multiple communication devices are working simultaneously, frequency hopping technology is prone to interference within the same frequency band due to the randomness or repetition of the frequency hopping sequence. This can lead to communication link interruptions, prolonged reconnection time, reduced reconnection success rate, increased system power consumption, and exacerbated communication instability, thus affecting user experience.

Method used

A dual-baseband channel mechanism is introduced, with fixed intervals between multiple channels preset and arranged in ascending order of frequency. When communication is interrupted, a channel self-check is performed, and an idle and interference-free channel is selected for switching. An adaptive spreading factor algorithm is used to calculate the optimal spreading factor to maintain synchronous frequency hopping data transmission.

Benefits of technology

It improves the speed and success rate of communication reconnection, enhances the reliability and stability of data transmission, reduces power consumption, avoids communication interruptions caused by frequency conflicts, and ensures fast and accurate reconnection and synchronization between the master and slave ends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120897276A_ABST
    Figure CN120897276A_ABST
Patent Text Reader

Abstract

The invention relates to a bidirectional wireless communication frequency hopping method, system and device and a medium. The method comprises the following steps: introducing a frequency hopping mechanism based on a double-base-frequency channel and a plurality of wireless communication channels into bidirectional wireless communication connection between a master end and a slave end, and when communication of the master end and the slave end is disconnected, automatically switching to an idle channel without interference for communication reconnection through channel frequency hopping and one-by-one channel self-inspection. And when the master end and the slave end enter a normal communication connection state, initializing the master end and the slave end to be a synchronous frequency hopping sequence, calculating an optimal spreading factor of a wireless communication channel synchronously skipped by the master end and the slave end by adopting a self-adaptive spreading factor algorithm, and keeping synchronous frequency hopping data transmission between the master end and the slave end based on the optimal spreading factor. By adopting the method, the speed and success rate of reconnection after communication disconnection of the master end and the slave end can be improved, and the reliability and stability of wireless communication data transmission are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wireless communication, in particular to a bidirectional wireless communication frequency hopping method, system, device and medium. BACKGROUND

[0002] Frequency hopping technology is a widely used spread spectrum method in the field of wireless communication. Its basic principle is to control the carrier frequency to switch between multiple frequency points quickly through a specific code sequence, thereby expanding the frequency spectrum and improving the anti-interference ability of the signal. In traditional frequency hopping systems, the sending end and the receiving end switch the frequency synchronously according to the predetermined frequency hopping pattern, so as to reduce narrowband interference, improve communication security, and allow multiple users to share the same frequency band resources.

[0003] However, with the popularity of wireless communication devices and the increasing scarcity of frequency spectrum resources, frequency hopping technology has exposed several problems in practical application. In particular, in a user-intensive frequency band, when multiple communication devices work simultaneously, the randomness or repeatability of the frequency hopping sequence can easily cause same-frequency band interference. Once a frequency conflict occurs, the communication link will be forced to interrupt, and the device needs to be reconnected. This process not only prolongs the reconnection time, but also reduces the reconnection success rate, and increases the power consumption of the system, which is not conducive to the efficient use of energy. In addition, frequent reconnection and signal competition can further exacerbate communication instability, and even cause complete communication interruption, seriously affecting user experience. SUMMARY

[0004] Therefore, it is necessary to provide a bidirectional wireless communication frequency hopping method, system, device and medium to solve the above technical problems.

[0005] A bidirectional wireless communication frequency hopping method, the method is applied to the bidirectional wireless communication connection between at least one master and at least one slave, and the method comprises: presetting a plurality of wireless communication channels arranged in order of increasing frequency between the master and the slave, and presetting a base frequency channel and at least one standby base frequency channel between the master and the slave; When the master-slave communication is disconnected, the master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master jumps from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame for channel self-checking. If the base frequency channel is idle and there is no interference, the master jumps from the base frequency channel back to the selected wireless communication channel and enters a normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master jumps from the base frequency channel to any standby base frequency channel in turn and sends a signal connection frame for channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master jumps from the standby base frequency channel back to the selected wireless communication channel and enters a normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave jumps between the base frequency channel and the standby base frequency channel at a fixed interval and works in a receiving state. When the slave receives a signal connection frame sent by the master, the slave enters a sending state, sends a signal ACK confirmation frame to the master, and jumps to the wireless communication channel selected by the master and reenters a receiving state after the signal ACK confirmation frame is sent. The slave enters a normal communication connection state by receiving a communication connection frame sent by the master. When the master-slave communication is disconnected, the slave jumps between the base frequency channel and the standby base frequency channel at a fixed interval and works in a receiving state. When the slave receives a signal connection frame sent by the master, the slave enters a sending state, sends a signal ACK confirmation frame to the master, and jumps to the wireless communication channel selected by the master and reenters a receiving state after the signal ACK confirmation frame is sent. The slave enters a normal communication connection state by receiving a communication connection frame sent by the master.

[0006] In one embodiment, the master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking, comprising: For a plurality of wireless communication channels arranged in order of frequency increasing in turn, the master first jumps to the wireless communication channel with the lowest frequency from the base frequency channel and sends a signal connection frame for channel self-checking. If the wireless communication channel with the lowest frequency is not idle or there is interference, the master jumps to the next wireless communication channel in order and sends a signal connection frame for channel self-checking until the wireless communication channel jumped to is idle and there is no interference. If all the wireless communication channels are jumped to once and the master enters a normal communication connection state, the master starts frequency hopping from the wireless communication channel with the lowest frequency again.

[0007] In one embodiment, the master sends a signal connection frame for channel self-checking, comprising: The master continuously sends a plurality of signal connection frames to the slave in the current channel and enters a receiving state after the signal connection frames are sent. The master waits for receiving a plurality of signal ACK confirmation frames continuously sent by the slave. The number of the signal connection frames sent by the master is consistent with the number of the signal ACK confirmation frames sent by the slave. If the master end does not receive the signal ACK confirmation frame sent by the slave end within the preset time, it indicates that the current channel is not idle or there is interference; if the master end receives the signal ACK confirmation frame sent by the slave end within the preset time, it indicates that the current channel is idle and there is no interference.

[0008] In one embodiment, the master end jumps back to the selected wireless communication channel from the base frequency channel or the standby base frequency channel, and enters the normal communication connection state by sending a communication connection frame, including: The master end jumps back to the selected wireless communication channel from the base frequency channel or the standby base frequency channel, continuously sends a plurality of communication connection frames to the slave end in the selected wireless communication channel, and enters a receiving state after the communication connection frame is sent, waiting to receive a plurality of communication ACK confirmation frames continuously sent by the slave end; wherein the number of communication connection frames sent by the master end is consistent with the number of communication ACK confirmation frames sent by the slave end. If the master end does not receive the communication ACK confirmation frame sent by the slave end within the preset time, the master end jumps to any wireless communication channel from the selected wireless communication channel in turn, and sends a signal connection frame one by one for channel self-checking, until a new available wireless communication channel is selected, and the normal communication connection state is reattempted; if the master end receives the communication ACK confirmation frame sent by the slave end within the preset time, the master end enters the normal communication connection state.

[0009] In one embodiment, the slave end jumps to the wireless communication channel selected by the master end and reenters the receiving state, enters the normal communication connection state by receiving the communication connection frame sent by the master end, including: The slave end jumps to the wireless communication channel selected by the master end and reenters the receiving state, waiting to receive a plurality of communication connection frames continuously sent by the master end. If the slave end does not receive the communication connection frame sent by the master end within the preset time, the slave end jumps back to the base frequency channel or the standby base frequency channel from the selected wireless communication channel, and continues to jump back and forth between the base frequency channel and the standby base frequency channel at a fixed interval period; if the slave end receives the communication connection frame sent by the master end within the preset time, the slave end enters a sending state and continuously sends a plurality of communication ACK confirmation frames to the master end, and the slave end enters the normal communication connection state.

[0010] In one embodiment, the master and slave ends are initialized to a synchronous frequency hopping sequence, and an adaptive spreading factor algorithm is used to calculate the optimal spreading factor of the wireless communication channel of the synchronous hopping of the master and slave ends, and the synchronous frequency hopping data transmission between the master and slave ends is maintained based on the optimal spreading factor, including: The master and slave ends are initialized to a synchronous frequency hopping sequence. The master end calculates the optimal spreading factor of the current wireless communication channel by using an adaptive spreading factor algorithm, configures the physical layer parameters based on the optimal spreading factor, and sends a data packet to trigger the slave end receiving process; wherein the adaptive spreading factor algorithm includes: measuring the SNR / RSSI of the channel, setting the value of the optimal spreading factor by comparing the SNR value with the preset threshold, or calculating the value of the optimal spreading factor by dynamically balancing the transmission reliability and transmission energy consumption of the channel; wherein the value of the optimal spreading factor ranges from 7 to 12; the data packet is composed of a packet header and a data payload, and the packet header includes a preamble and an indicated optimal spreading factor; The slave end synchronizes to the wireless communication channel consistent with the master end and performs preamble detection, after successful preamble detection, parses the data packet header to obtain the optimal spreading factor, reconfigures the receiver spreading factor based on the optimal spreading factor, and after receiving the data payload, sends ACK or NACK by measuring the received SNR / RSSI, and the master end receives the response; When the master end receives NACK, the retransmission mechanism is triggered, and after increasing the value of the optimal spreading factor of the current wireless communication channel of the master and slave ends, the data packet is re-sent to maintain the synchronous frequency hopping data transmission between the master and slave ends; when the master end receives ACK, the channel quality database is updated and it is judged whether the current wireless communication channel of the master and slave ends meets the preset frequency hopping condition, if yes, the master end jumps to the next wireless communication channel, continues to calculate the optimal spreading factor of the next wireless communication channel, and re-sends the data packet to maintain the synchronous frequency hopping data transmission between the master and slave ends; if not, the master end continues to send the data packet in the current wireless communication channel and maintains the synchronous frequency hopping data transmission between the master and slave ends; The calculation of the optimal spreading factor also includes an anti-oscillation mechanism, which includes: detecting whether the latest calculated optimal spreading factor is consistent with the current spreading factor of the channel; if not, further detecting whether the time difference between the time when the latest data packet sending in the channel is successfully completed and the current time is greater than the preset minimum holding time, if yes, updating the current spreading factor of the channel to the latest calculated optimal spreading factor; if consistent or if the time difference is less than or equal to the minimum holding time, keeping the current spreading factor of the channel unchanged.

[0011] In one embodiment, the value of the optimal spreading factor is calculated by dynamically balancing the transmission reliability and transmission energy consumption of the channel, which includes: Collecting a group of RSSI samples of the channel for sliding average filtering, and calculating the coefficient of variation of the RSSI of the channel based on the standard deviation of the RSSI samples and the filtering result ; ​ ; wherein, is the number of samples, is the i RSSI sample; the stability of the current channel communication environment is marked by comparing the size of the coefficient of variation with a preset threshold value; wherein, when is greater than the preset threshold value, it is marked as an unstable environment; otherwise, it is marked as a stable environment; According to the environmental marking result, the environmental noise reference of the current channel is calibrated and the effective RSSI value is calculated as: ; ; wherein, is the calibrated environmental noise reference; is a set of noise signals, represents the percentile; Based on further determine whether the decision tree model is available, if available, use the decision tree model to predict the initial spreading factor of the channel, denoted as , wherein, represents the current battery voltage of the master; if not available, use piecewise linear approximation to select the initial spreading factor according to the preset RSSI and spreading factor mapping table; wherein, the value range of the initial spreading factor is an integer within 7 to 12; Further, according to the initial spreading factor, a test packet is sent, and the transmission reliability of the channel is verified by measuring the packet loss rate, if the packet loss rate is greater than a preset value, the value of the initial spreading factor is increased and the test packet is re-sent for transmission reliability verification; otherwise, the current battery voltage of the master is measured and the expected transmission time of the test packet is calculated for transmission energy optimization of the channel, if the battery voltage is less than a preset voltage and the expected transmission time is greater than a preset time, the value of the initial spreading factor is reduced, and the reduced value is output as the best spreading factor; otherwise, the initial spreading factor is directly output as the best spreading factor; wherein, the expected transmission time is represented as ; wherein, is the channel bandwidth, is the number of bits of the test packet payload.

[0012] A bidirectional wireless communication frequency hopping system, the system is applied to the bidirectional wireless communication connection between at least one master and at least one slave, the system comprises: a channel preset module for presetting a plurality of wireless communication channels arranged in order of increasing frequency with fixed channel spacing between the master and the slave, and presetting a base frequency channel and at least one standby base frequency channel between the master and the slave; The master end frequency hopping module is used for when the master-slave end communication is disconnected, the master end hops from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame to perform channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master end hops from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame to perform channel self-checking. If the base frequency channel is idle and there is no interference, the master end hops from the base frequency channel back to the selected wireless communication channel again and enters the normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master end hops from the base frequency channel to any standby base frequency channel in turn and sends a signal connection frame to perform channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master end hops from the standby base frequency channel back to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. The slave end frequency hopping module is used for when the master-slave end communication is disconnected, the slave end hops between the base frequency channel and the standby base frequency channel at a fixed interval period and works in a receiving state. When the slave end receives the signal connection frame sent by the master end, the slave end enters a sending state, sends a signal ACK confirmation frame to the master end, and after the signal ACK confirmation frame is sent, the slave end hops into the wireless communication channel selected by the master end and reenters the receiving state to enter the normal communication connection state by receiving the communication connection frame sent by the master end. The synchronous frequency hopping data transmission module is used for when the master-slave end both enter the normal communication connection state, the master-slave end is initialized to the synchronous frequency hopping sequence, and the adaptive spreading factor algorithm is used to calculate the optimal spreading factor of the wireless communication channel of the synchronous hopping of the master-slave end. The optimal spreading factor is used to keep the synchronous frequency hopping data transmission between the master-slave end.

[0013] A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: A plurality of wireless communication channels between the master-slave end are arranged in a fixed channel interval and in a frequency increasing order, and a base frequency channel and at least one standby base frequency channel between the master-slave end are preset. When the master-slave communication is disconnected, the master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master jumps from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame for channel self-checking. If the base frequency channel is idle and there is no interference, the master jumps from the base frequency channel back to the selected wireless communication channel again and enters a normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master jumps from the base frequency channel to any standby base frequency channel in turn and sends a signal connection frame for channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master jumps from the standby base frequency channel back to the selected wireless communication channel and enters a normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave jumps between the base frequency channel and the standby base frequency channel at a fixed interval and works in a receiving state. When the slave receives a signal connection frame sent by the master, the slave enters a sending state, sends a signal ACK confirmation frame to the master, and jumps to the wireless communication channel selected by the master and reenters a receiving state after the signal ACK confirmation frame is sent. The slave enters a normal communication connection state by receiving a communication connection frame sent by the master. When the master-slave communication is disconnected, the slave jumps between the base frequency channel and the standby base frequency channel at a fixed interval and works in a receiving state. When the slave receives a signal connection frame sent by the master, the slave enters a sending state, sends a signal ACK confirmation frame to the master, and jumps to the wireless communication channel selected by the master and reenters a receiving state after the signal ACK confirmation frame is sent. The slave enters a normal communication connection state by receiving a communication connection frame sent by the master.

[0014] A computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the following steps: A plurality of wireless communication channels between the master and the slave are arranged in a fixed order of increasing frequency, and a base frequency channel and at least one standby base frequency channel between the master and the slave are preset. When the master-slave communication is disconnected, the master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master jumps from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame for channel self-checking. If the base frequency channel is idle and there is no interference, the master jumps from the base frequency channel back to the selected wireless communication channel again and enters a normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master jumps from the base frequency channel to any standby base frequency channel in turn and sends a signal connection frame for channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master jumps from the standby base frequency channel back to the selected wireless communication channel and enters a normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave end periodically jumps back and forth between the base frequency channel and the standby base frequency channel at fixed intervals, and works in the receiving state. When the slave end receives the signal connection frame sent by the master end, the slave end enters the sending state, sends the signal ACK confirmation frame to the master end, and after the signal ACK confirmation frame is sent, the slave end jumps into the wireless communication channel selected by the master end and reenters the receiving state, enters the normal communication connection state by receiving the communication connection frame sent by the master end; When the master-slave end enters the normal communication connection state, the master-slave end is initialized to a synchronous frequency hopping sequence, and the optimal spreading factor of the synchronous hopping wireless communication channel of the master-slave end is calculated by using an adaptive spreading factor algorithm, and the synchronous hopping data transmission between the master-slave end is maintained based on the optimal spreading factor.

[0015] Compared with the prior art, the above-mentioned bidirectional wireless communication frequency hopping method, system, device and medium have the following beneficial effects: 1. The double base frequency channels are introduced in the bidirectional wireless communication connection between the master-slave end and the channel self-checking is performed. The double base frequency channels can form a redundant link. When the base frequency channel is not idle or there is interference, it can automatically switch to an idle and interference-free standby base frequency channel, thereby enhancing the reliability and stability of wireless communication data transmission and improving the speed and success rate of reconnection after the master-slave end communication is disconnected.

[0016] 2. By presetting multiple wireless communication channels and sending signal connection frames one by one for channel self-checking, when a single wireless communication channel is not idle or there is interference, the frequency hopping can be performed to other idle and interference-free wireless communication channels, thereby avoiding the situation that frequency conflicts occur when multiple devices hop frequencies and further cause the communication link to be forced to be interrupted, improving the stability of frequency hopping reconnection, and the load balancing of multiple wireless communication channels is beneficial to improve the utilization rate of frequency spectrum resources and reduce the frequency hopping power consumption. Moreover, by sending the communication connection frame to enter the normal communication connection state, the frequency hopping of the master-slave end can be ensured to be synchronous, and the fast and accurate reconnection of the master-slave end is ensured.

[0017] 3. When the master-slave end enters the normal communication connection state, the optimal spreading factor calculated based on the adaptive spreading factor algorithm is used to maintain the synchronous hopping data transmission between the master-slave end, which can ensure that the same spreading factor value is always used during the frequency hopping process of both sides, avoid the synchronization loss problem caused by parameter mismatch, and greatly improve the synchronization reliability between the master-slave end and the quality of data transmission. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 It is a flowchart of a bidirectional wireless communication frequency hopping method in one embodiment; Figure 2 It is a working flowchart of the master end and the slave end after the communication is disconnected in one embodiment; Figure 3 A flowchart of a synchronization frequency hopping data transmission between a master and a slave in an embodiment; Figure 4 A flowchart of calculating the optimal spreading factor based on RSSI in an embodiment; Figure 5 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0020] In an embodiment, as shown in Figure 1 , a bidirectional wireless communication frequency hopping method is provided for reestablishing connection after communication disconnection and maintaining synchronization frequency hopping data transmission between a master and a slave after communication reconnection. The method is applied to bidirectional wireless communication connection between at least one master and at least one slave, i.e. for one master and one slave, one master and multiple slaves, multiple masters and one slave, and multiple masters and multiple slaves, the method is applicable. The method includes the following steps: Step S1, preset multiple wireless communication channels between the master and the slave are arranged in a fixed order according to the increasing frequency, and a base frequency channel and at least one standby base frequency channel between the master and the slave are preset.

[0021] Among them, the preset multiple wireless communication channels are staggered with existing wireless communication channels (such as existing Bluetooth and WIFI, etc.).

[0022] It should be understood that by presetting multiple wireless communication channels to be staggered with existing wireless communication channels, it is beneficial to avoid crowded frequency bands and stagger the intermodulation interference of Bluetooth, WIFI and other systems, thereby improving the channel signal-to-noise ratio. At the same time, double base frequency channels are introduced in the bidirectional wireless communication connection between the master and the slave and channel self-checking is performed. The double base frequency channels can form a redundant link, and when the base frequency channel is not idle or there is interference, it can automatically switch to an idle and interference-free standby base frequency channel, thereby enhancing the reliability and stability of wireless communication data transmission and improving the speed and success rate of reconnection after the master and slave communication disconnection.

[0023] Step S2, when the master-slave communication is disconnected, the master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master jumps from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame for channel self-checking. If the base frequency channel is idle and there is no interference, the master jumps from the base frequency channel back to the selected wireless communication channel again and enters the normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master jumps from the base frequency channel to any standby base frequency channel in turn and sends a signal connection frame for channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master jumps from the standby base frequency channel back to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame.

[0024] The master jumps from the base frequency channel to any wireless communication channel in turn and sends a signal connection frame for channel self-checking, including: For a plurality of wireless communication channels arranged in order of frequency increasing in turn, the master first jumps from the base frequency channel to the wireless communication channel with the lowest frequency and sends a signal connection frame for channel self-checking. If the wireless communication channel with the lowest frequency is not idle or there is interference, the master jumps to the next wireless communication channel in order and sends a signal connection frame for channel self-checking until the jumped wireless communication channel is idle and there is no interference. If all wireless communication channels are jumped for one round and the master enters the normal communication connection state, the master starts frequency hopping from the wireless communication channel with the lowest frequency again. Specifically, frequency hopping is realized based on LORA (Long Range Radio) communication technology. In this way, signals can be transmitted at a low power over a long distance while maintaining high reliability.

[0025] It should be understood that the order of frequency hopping is simple and can effectively cover all wireless communication channels, avoiding the possibility of missing some channels in pseudo-random frequency hopping, further improving the success rate of communication reconnection, and each time the channel is self-checked after jumping, the channel idle and interference situation can be monitored in real time, improving the stability and reliability of communication.

[0026] The specific steps of sending a signal connection frame for channel self-checking are as follows: the master continuously sends a plurality of signal connection frames to the slave in the current channel, and enters a receiving state after the signal connection frame is sent, and waits to receive a plurality of signal ACK confirmation frames sent by the slave in succession. The number of signal connection frames sent by the master is consistent with the number of signal ACK confirmation frames sent by the slave. If the master does not receive the signal ACK confirmation frames sent by the slave within a predetermined time, it indicates that the current channel is not idle or there is interference. If the master receives the signal ACK confirmation frames sent by the slave within a predetermined time, it indicates that the current channel is idle and there is no interference.

[0027] It should be noted that the signal ACK confirmation frame sent by the slave end referred to in the present application refers to one signal ACK confirmation frame.

[0028] It should be understood that the signal connection frame is a carrier activated detection (CAD) carrier sensing mechanism, and the purpose is to let the wireless device (such as a Wi-Fi card, a ZigBee device, a LORA device, etc.) first listen whether the wireless channel is idle before attempting to send data. The principle of signal self-checking is that the device detects the radio frequency energy or a specific signal (such as the preamble of Wi-Fi) on the channel through its radio receiver. If the detected energy exceeds a certain threshold or a valid signal is identified, the device considers that the channel is "busy" (other devices are transmitting); otherwise, it considers that the channel is "idle". By presetting multiple wireless communication channels and sending signal connection frames one by one for channel self-checking, when a single wireless communication channel is not idle or there is interference, the frequency hopping to other idle and interference-free wireless communication channels can avoid the situation that frequency conflict occurs when multiple devices hop frequency, and further causes the communication link to be forced to interrupt, thereby improving the stability of frequency hopping and reconnection, and balancing the load of multiple wireless communication channels, which is beneficial to improve the utilization rate of spectrum resources and reduce the frequency hopping power consumption.

[0029] When there are multiple standby base frequency channels, the multiple standby base frequency channels are arranged in order of increasing frequency, and the master end jumps to the standby base frequency channel in order of increasing frequency and sends a signal connection frame one by one for channel self-checking when jumping from the base frequency channel to the standby base frequency channel.

[0030] The master end jumps back to the selected wireless communication channel from the base frequency channel or the standby base frequency channel, and enters a normal communication connection state by sending a communication connection frame, including: The master end jumps back to the selected wireless communication channel from the base frequency channel or the standby base frequency channel, and continuously sends a plurality of communication connection frames to the slave end in the selected wireless communication channel, and enters a receiving state after the communication connection frame is sent, and waits to receive a plurality of communication ACK confirmation frames continuously sent by the slave end. The number of communication connection frames sent by the master end is consistent with the number of communication ACK confirmation frames sent by the slave end. If the master end does not receive the communication ACK confirmation frame sent by the slave end within a preset time, the master end jumps to any wireless communication channel one by one from the selected wireless communication channel and sends a signal connection frame one by one for channel self-checking, until a new available wireless communication channel is selected, and a normal communication connection state is reattempted. If the master end receives the communication ACK confirmation frame sent by the slave end within a preset time, the master end enters a normal communication connection state.

[0031] It should be noted that, in this application, receiving a communication ACK confirmation frame sent by the slave end means receiving just one communication ACK confirmation frame.

[0032] It should be understood that by sending a communication connection frame to enter the normal communication connection state, frequency hopping synchronization between the master and slave ends can be ensured, thus guaranteeing fast and accurate reconnection between the master and slave ends.

[0033] Step S3: When the master-slave communication is disconnected, the slave switches back and forth between the baseband channel and the backup baseband channel at fixed intervals and operates in the receiving state. When the slave receives the signal connection frame sent by the master, the slave enters the transmitting state, sends the signal ACK confirmation frame to the master, and after the signal ACK confirmation frame is sent, the slave switches to the wireless communication channel selected by the master and re-enters the receiving state. It enters the normal communication connection state by receiving the communication connection frame sent by the master.

[0034] The process of switching from the slave end to the wireless communication channel selected by the master end and re-entering the receiving state, and entering the normal communication connection state by receiving the communication connection frame sent by the master end, includes: The slave device switches to the wireless communication channel selected by the master device and re-enters the receiving state, waiting to receive several communication connection frames continuously sent by the master device. If the slave device does not receive the communication connection frames sent by the master device within a preset time, the slave device switches back from the selected wireless communication channel to the baseband channel or the backup baseband channel, and continues to switch back and forth between the baseband channel and the backup baseband channel at fixed intervals. If the slave device receives the communication connection frames sent by the master device within a preset time, the slave device enters the sending state and continuously sends several communication ACK confirmation frames to the master device, and the slave device enters the normal communication connection state.

[0035] It should be noted that, in this application, receiving a communication connection frame sent by the master end means receiving just one communication connection frame.

[0036] It should be understood that during data communication, the slave end hops frequencies according to the control of the master end, thereby maintaining frequency hopping synchronization between the master and slave ends. The slave end only actively hops to the backup baseband channel when the baseband channel is interfered with.

[0037] For example, when this method is applied to a scenario with one master and one slave, the workflow between the master and slave after the communication between them is lost is as follows: Figure 2 As shown, Figure 2 The dashed arrows indicate the transmission of signal connection frames and communication connection frames between the master and slave ends. Specific application steps include: 1. One baseband channel is preset to 433.0MHz, one spare baseband channel is preset to 433.5MHz, and 6 wireless communication channels are preset. The six wireless communication channels all belong to the 433M frequency band, and the 433M frequency band has the advantages of low power consumption and strong wireless signal penetration. Each wireless communication channel is spaced by a fixed 0.5MHz, and the six wireless communication channels are arranged in order of increasing frequency, and the specific arrangement order is: 434.0MHz, 434.5MHz, 435.0MHz, 435.5MHz, 436.0MHz and 436.5MHz.

[0038] 2. When the master-slave communication is disconnected, the master starts frequency hopping from the base frequency channel, first jumps to the channel 434.0MHz, and then the master starts channel self-checking at 434.0MHz to check whether the channel is disturbed or idle.

[0039] At this time, the channel self-checking mode is that the master continuously sends 8 signal connection frames to the slave in the channel, and then receives the state after sending, waits to receive the 8 signal ACK confirmation frames continuously sent by the slave. If the master does not receive the signal ACK confirmation frames sent by the slave within the preset time 1.8ms, it indicates that the current channel is not idle or disturbed. If the master receives the signal ACK confirmation frames sent by the slave within the preset time 1.8ms, it indicates that the current channel is idle and there is no disturbance.

[0040] If the channel 434.0MHz is not idle or disturbed, the master jumps to the next 434.5MHz in order and performs channel self-checking, and keeps jumping and checking one by one until a wireless communication channel is idle and there is no disturbance, and is selected as the current available wireless communication channel.

[0041] If the channel 434.0MHz is idle and there is no disturbance, the channel 434.0MHz is directly selected as the current available wireless communication channel, and the master jumps from the channel 434.0MHz back to the base frequency channel to check whether the base frequency channel is disturbed or idle.

[0042] If the base frequency channel is not idle or disturbed, the master jumps to the standby base frequency channel 433.5MHz and performs channel self-checking. If the standby base frequency channel 433.5MHz is not idle or disturbed, other standby base frequency channels are added and checked one by one until the standby base frequency channel is idle and there is no disturbance, and jumps back to the selected wireless communication channel from the standby base frequency channel. If the base frequency channel is idle and there is no disturbance, the master jumps back to the selected wireless communication channel from the base frequency channel.

[0043] After the master end jumps back to the selected wireless communication channel, it continuously sends 8 communication connection frames to the slave end, and enters a receiving state after the communication connection frame transmission is completed, waiting to receive the 8 communication ACK confirmation frames continuously sent by the slave end. If the master end does not receive the communication ACK confirmation frames sent by the slave end within a preset time of 1.8 milliseconds, the master end jumps from the selected wireless communication channel to the channel 434.0 MHz, and sequentially jumps to perform channel self-checking one by one until a new available wireless communication channel is selected, and a normal communication connection state is reattempted; if the master end receives the communication ACK confirmation frames sent by the slave end within the preset time of 1.8 milliseconds, the master end enters a normal communication connection state.

[0044] 3. When the master-slave end communication is disconnected, the slave end jumps back and forth between the base frequency channel and the standby base frequency channel at a fixed interval period (5 milliseconds) and works in a receiving state. When the slave end receives the signal connection frame sent by the master end, the slave end enters a sending state, continuously sends 8 signal ACK confirmation frames to the master end, and after the signal ACK confirmation frame transmission is completed, the slave end jumps to the wireless communication channel selected by the master end and reenters a receiving state, waiting to receive the 8 communication connection frames continuously sent by the master end.

[0045] If the slave end does not receive the communication connection frame sent by the master end within a preset time of 1.8 milliseconds, the slave end jumps back from the selected wireless communication channel to the base frequency channel or the standby base frequency channel, and continues to jump back and forth between the base frequency channel and the standby base frequency channel at a fixed interval period (5 milliseconds); if the slave end receives the communication connection frame sent by the master end within the preset time of 1.8 milliseconds, the slave end enters a sending state and continuously sends 8 communication ACK confirmation frames to the master end, and the slave end enters a normal communication connection state.

[0046] Step S4, when the master-slave end both enter a normal communication connection state, the master-slave end is initialized to a synchronous frequency hopping sequence, and an adaptive spreading factor algorithm is used to calculate the optimal spreading factor of the wireless communication channel to which the master-slave end synchronously jumps, and the synchronous frequency hopping data transmission between the master-slave end is maintained based on the optimal spreading factor.

[0047] Specifically, step S4, as shown in Figure 3 , includes: First, the master-slave end is initialized to a synchronous frequency hopping sequence.

[0048] Second, the master end uses an adaptive spreading factor algorithm to calculate the optimal spreading factor of the current wireless communication channel, configures the physical layer parameters based on the optimal spreading factor and sends a data packet, triggering the slave end receiving process. The optimal spreading factor has a value range of an integer within 7 to 12, and the data packet is composed of a packet header and a data payload, and the packet header includes a preamble and an indicated optimal spreading factor indication. The adaptive spreading factor algorithm includes: Measure the SNR (Signal-to-Noise Ratio) / RSSI (Received Signal Strength Indicator) of the channel. By comparing the SNR value with a preset threshold, set the value of the optimal spreading factor. Specifically, two thresholds are set, namely threshold H and threshold M. Threshold H is a relatively high SNR threshold value. When the channel quality is very good (SNR ≥ H), the system can afford to use a smaller spreading factor (SF) in exchange for a higher data rate because the link margin is sufficient at this time. Threshold M is a relatively low SNR threshold value. When the channel quality is poor (SNR < M), in order to ensure basic communication reliability, a larger spreading factor (SF) must be used to increase the processing gain and anti-interference ability. These two thresholds divide the SNR range into three intervals: SNR ≥ H: the "good channel" interval, set the optimal spreading factor to 7 or 8 to maximize the data rate. M ≤ SNR < H: the "medium channel" interval, set the optimal spreading factor to 9 or 10. SNR < M: the "bad channel" interval, set the optimal spreading factor to 11 or 12 to maximize the link robustness.

[0049] Or dynamically balance the transmission reliability and transmission energy consumption of the channel through RSSI, and calculate the value of the optimal spreading factor, as Figure 4 shown, including the following steps: Collect a set of RSSI samples of the channel for moving average filtering, and based on the standard deviation of the RSSI samples and the filtering result obtain the coefficient of variation of the channel RSSI as: ; ; where, is the number of samples, is the i th RSSI sample; By comparing the coefficient of variation with the preset threshold, mark the stability of the current channel communication environment; where, when is greater than the preset threshold (such as 0.3), mark it as an unstable environment; otherwise, mark it as a stable environment; According to the environmental marking result, calibrate the environmental noise baseline of the current channel and calculate the effective RSSI value as: ; ; where, is the calibrated environmental noise baseline; is the set of noise signals, represents the percentile; Based on Further determine whether the decision tree model is available, if available, use the decision tree model to predict the initial spreading factor of the channel, denoted as wherein, represents the current battery voltage of the master end; if not available, use piecewise linear approximation, select the initial spreading factor according to the preset RSSI and spreading factor mapping table; wherein the value range of the initial spreading factor is an integer within 7 to 12; Further send a test packet according to the initial spreading factor, and verify the transmission reliability of the channel by measuring the packet loss rate, if the packet loss rate is greater than a preset value (such as 10%), increase the value of the initial spreading factor and resend the test packet for transmission reliability verification; otherwise, measure the current battery voltage of the master end and calculate the expected transmission time of the test packet to optimize the transmission energy consumption of the channel, if the battery voltage is less than a preset voltage (such as 3.3V) and the expected transmission time is greater than a preset time (such as 50ms), reduce the value of the initial spreading factor, and output the reduced value as the optimal spreading factor; otherwise, directly output the initial spreading factor as the optimal spreading factor; wherein the expected transmission time is denoted as ; wherein, is the channel bandwidth, is the number of bits of the test packet payload.

[0050] After triggering the receiving process of the slave end, the slave end synchronously jumps to the same wireless communication channel as the master end and performs preamble detection, after successful preamble detection, parses the data packet header to obtain the optimal spreading factor, reconfigures the receiver spreading factor based on the optimal spreading factor, and after receiving the data payload, measures the received SNR / RSSI, sends ACK or NACK, and the master end receives the response. The condition for sending ACK is that the slave end successfully receives the data payload and satisfies the CRC check, that is, the data packet itself has no error in transmission, and ACK can be sent. The condition for sending NACK is that the CRC check fails or the data payload cannot be successfully demodulated (for example, the preamble or header detection is successful, but the payload demodulation fails), which explicitly tells the master end that the data packet is lost or damaged and needs to be retransmitted.

[0051] When the master end receives the NACK, the retransmission mechanism is triggered, and after the value of the optimal spreading factor of the current wireless communication channel where the master and slave ends are located is improved, the data packet is retransmitted to maintain the synchronous frequency hopping data transmission between the master and slave ends; when the master end receives the ACK, the channel quality database is updated, and it is judged whether the current wireless communication channel where the master and slave ends are located meets the preset frequency hopping condition (such as lower link quality). If it meets, the master end jumps to the next wireless communication channel, continues to calculate the optimal spreading factor of the next wireless communication channel, and retransmits the data packet to maintain the synchronous frequency hopping data transmission between the master and slave ends; if it does not meet, the master end continues to transmit the data packet in the current wireless communication channel, and maintains the synchronous frequency hopping data transmission between the master and slave ends. Specifically, the update of the channel quality database is a sliding average to ensure the stability of RSSI, the packet loss rate based on the time window is used to reflect the real-time quality, and the aging mechanism is used to forcibly refresh the closed loop update strategy formed by the channel evaluation.

[0052] The calculation of the optimal spreading factor further includes an anti-oscillation mechanism, which includes: detecting whether the latest calculated optimal spreading factor is consistent with the current spreading factor of the channel; if not, further detecting whether the time difference between the time when the latest data packet transmission in the channel is successfully completed and the current time is greater than a preset minimum maintenance time; if greater, updating the current spreading factor of the channel to the latest calculated optimal spreading factor; if consistent or if the time difference is less than or equal to the minimum maintenance time, keeping the current spreading factor of the channel unchanged.

[0053] It should be understood that the above adaptive spreading factor algorithm dynamically adjusts the spreading factor by monitoring the channel quality in real time, automatically switches to high SF to improve signal fault tolerance when interference is enhanced, and switches to low SF to improve transmission rate when interference is reduced, so that the dynamic anti-interference ability of the master and slave end communication is improved, and the master and slave end continuously maintain the optimal spreading factor for synchronous frequency hopping, which can avoid the problem of synchronization loss caused by parameter mismatch, and improve the reliability of data transmission between the master and slave end. And when calculating the optimal spreading factor, the anti-oscillation mechanism is introduced, which can avoid the extra energy consumption caused by frequent switching, and further improve the performance of the synchronous frequency hopping data transmission between the master and slave end.

[0054] In the above-mentioned two-way wireless communication frequency hopping method, the utilization rate of frequency spectrum resources is expanded by introducing multiple wireless communication channels and double base frequency channels, the frequency hopping power consumption is reduced, and when the communication line is disconnected and reconnected, the channel is self-checked to hop to other idle channels without interference, which can avoid channel collision when frequency hopping, improve the speed and success rate of reconnection after the master and slave end communication line is disconnected, and maintain the synchronous frequency hopping data transmission between the master and slave end based on the optimal spreading factor during normal communication, which greatly improves the synchronous reliability between the master and slave end and the quality of data transmission. This method is efficient, convenient and has higher reliability.

[0055] In one embodiment, a bidirectional wireless communication frequency hopping system is provided, which is applied to a bidirectional wireless communication connection between at least one master and at least one slave, comprising: a channel presetting module, configured to preset a plurality of wireless communication channels arranged in a sequence of fixed channel intervals and increasing frequencies between the master and the slave, and preset a primary channel and at least one backup channel between the master and the slave; a master frequency hopping module, configured to, when the communication between the master and the slave is disconnected, hop from the primary channel to any wireless communication channel in sequence and send a signal connection frame for channel self-checking, only when the wireless communication channel is idle and no interference exists, select the wireless communication channel as a current available wireless communication channel, hop from the selected wireless communication channel back to the primary channel and send a signal connection frame for channel self-checking, if the primary channel is idle and no interference exists, hop from the primary channel back to the selected wireless communication channel and enter a normal communication connection state by sending a communication connection frame; if the primary channel is not idle or interference exists, hop from the primary channel to any backup channel in sequence and send a signal connection frame for channel self-checking, only when the backup channel is idle and no interference exists, hop from the backup channel back to the selected wireless communication channel and enter the normal communication connection state by sending a communication connection frame; a slave frequency hopping module, configured to, when the communication between the master and the slave is disconnected, hop back and forth between the primary channel and the backup channel in a fixed interval period and work in a receiving state, when the slave receives a signal connection frame sent by the master, enter a sending state, send a signal ACK confirmation frame to the master, and after the signal ACK confirmation frame is sent, hop to the selected wireless communication channel of the master and re-enter the receiving state, and enter the normal communication connection state by receiving a communication connection frame sent by the master; a synchronous frequency hopping data transmission module, configured to, when the master and the slave both enter the normal communication connection state, initialize the master and the slave to a synchronous frequency hopping sequence, calculate an optimal spreading factor of a wireless communication channel to which the master and the slave hop synchronously by using an adaptive spreading factor algorithm, and keep the synchronous frequency hopping data transmission between the master and the slave based on the optimal spreading factor.

[0056] The specific limitations of the bidirectional wireless communication frequency hopping system can be referred to the limitations of the bidirectional wireless communication frequency hopping method in the above, which will not be repeated here. The modules in the bidirectional wireless communication frequency hopping system can be realized by software, hardware and combinations thereof, in whole or in part. The modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0057] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a bidirectional wireless communication frequency hopping method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0058] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0059] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to perform the following steps: The system includes multiple wireless communication channels with fixed channel spacing between the master and slave terminals, arranged in ascending order of frequency, and one baseband channel and at least one spare baseband channel between the master and slave terminals. When communication between the master and slave ends is lost, the master end sequentially switches from the baseband channel to any wireless communication channel and sends a signal connection frame to perform a channel self-check. Only when the wireless communication channel is idle and free from interference is it selected as the currently available wireless communication channel. The master end then switches back from the selected wireless communication channel to the baseband channel and sends a signal connection frame to perform a channel self-check. If the baseband channel is idle and free from interference, the master end switches back from the baseband channel to the selected wireless communication channel again and enters the normal communication connection state by sending a communication connection frame. If the baseband channel is not idle or is subject to interference, the master end sequentially switches from the baseband channel to any backup baseband channel and sends a signal connection frame to perform a channel self-check. Only when the backup baseband channel is idle and free from interference is the master end switches back from the backup baseband channel to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave end switches between the base frequency channel and the standby base frequency channel at a fixed interval period and works in a receiving state. When the slave end receives the signal connection frame sent by the master end, the slave end enters a sending state, sends the signal ACK confirmation frame to the master end, and after the signal ACK confirmation frame is sent, the slave end switches to the wireless communication channel selected by the master end and reenters the receiving state to enter the normal communication connection state by receiving the communication connection frame sent by the master end. When the master-slave end enters the normal communication connection state, the master-slave end is initialized to a synchronous frequency hopping sequence, and an adaptive spreading factor algorithm is used to calculate the optimal spreading factor of the wireless communication channel of the synchronous hopping of the master-slave end, and the synchronous hopping data transmission between the master-slave end is maintained based on the optimal spreading factor.

[0060] In one embodiment, a computer readable storage medium is provided, and a computer program is stored on the computer readable storage medium. The computer program is executed by a processor to implement the following steps: A plurality of wireless communication channels with fixed channel intervals between the master-slave end are arranged in order of increasing frequency, and a base frequency channel and at least one standby base frequency channel between the master-slave end are preset. When the master-slave communication is disconnected, the master end switches from the base frequency channel to any wireless communication channel in sequence and sends a signal connection frame for channel self-checking. Only when the wireless communication channel is idle and there is no interference, the selected wireless communication channel is selected as the current available wireless communication channel. The master end switches from the selected wireless communication channel back to the base frequency channel and sends a signal connection frame for channel self-checking. If the base frequency channel is idle and there is no interference, the master end switches from the base frequency channel back to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. If the base frequency channel is not idle or there is interference, the master end switches from the base frequency channel to any standby base frequency channel in sequence and sends a signal connection frame for channel self-checking. Only when the standby base frequency channel is idle and there is no interference, the master end switches from the standby base frequency channel to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave end switches between the base frequency channel and the standby base frequency channel at a fixed interval period and works in a receiving state. When the slave end receives the signal connection frame sent by the master end, the slave end enters a sending state, sends the signal ACK confirmation frame to the master end, and after the signal ACK confirmation frame is sent, the slave end switches to the wireless communication channel selected by the master end and reenters the receiving state to enter the normal communication connection state by receiving the communication connection frame sent by the master end. When the master-slave end enters the normal communication connection state, the master-slave end is initialized to a synchronous frequency hopping sequence, and an adaptive spreading factor algorithm is used to calculate the optimal spreading factor of the wireless communication channel of the synchronous hopping of the master-slave end, and the synchronous hopping data transmission between the master-slave end is maintained based on the optimal spreading factor.

[0061] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0062] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0063] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application.

Claims

1. A bidirectional wireless communication frequency hopping method, characterized in that, The method is applied to a bidirectional wireless communication connection between at least one master end and at least one slave end, and the method includes: The system includes multiple wireless communication channels with fixed channel spacing between the master and slave terminals, arranged in ascending order of frequency, and one baseband channel and at least one spare baseband channel between the master and slave terminals. When communication between the master and slave ends is lost, the master end sequentially switches from the baseband channel to any wireless communication channel and sends a signal connection frame to perform a channel self-check. Only when the wireless communication channel is idle and free from interference is it selected as the currently available wireless communication channel. The master end then switches back from the selected wireless communication channel to the baseband channel and sends a signal connection frame to perform a channel self-check. If the baseband channel is idle and free from interference, the master end switches back from the baseband channel to the selected wireless communication channel again and enters the normal communication connection state by sending a communication connection frame. If the baseband channel is not idle or is subject to interference, the master end sequentially switches from the baseband channel to any backup baseband channel and sends a signal connection frame to perform a channel self-check. Only when the backup baseband channel is idle and free from interference is the master end switches back from the backup baseband channel to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. When the master-slave communication is disconnected, the slave switches back and forth between the baseband channel and the backup baseband channel at fixed intervals and operates in the receiving state. When the slave receives the signal connection frame sent by the master, the slave enters the transmitting state, sends the signal ACK confirmation frame to the master, and after the signal ACK confirmation frame is sent, the slave switches to the wireless communication channel selected by the master and re-enters the receiving state. It enters the normal communication connection state by receiving the communication connection frame sent by the master. When both the master and slave ends enter the normal communication connection state, the master and slave ends are initialized to a synchronized frequency hopping sequence, and the optimal spreading factor of the wireless communication channel for synchronized hopping between the master and slave ends is calculated using an adaptive spreading factor algorithm. Based on the optimal spreading factor, synchronized frequency hopping data transmission between the master and slave ends is maintained.

2. The method according to claim 1, characterized in that, The master terminal sequentially switches from the baseband channel to any wireless communication channel and sends a signal connection frame to perform channel self-test, including: For multiple wireless communication channels arranged in ascending order of frequency, the master terminal first hops from the baseband channel to the lowest frequency wireless communication channel and sends a signal connection frame for channel self-check. If the lowest frequency wireless communication channel is not idle or has interference, it hops to the next wireless communication channel in sequence and sends a signal connection frame for channel self-check until the hopped wireless communication channel is idle and free from interference. If all wireless communication channels have hopped once and the master terminal enters a normal communication connection state, the master terminal restarts frequency hopping from the lowest frequency wireless communication channel.

3. The method according to claim 1 or 2, characterized in that, The transmission signal connection frame performs a channel self-test, including: The master end continuously sends a number of signal connection frames to the slave end within the current channel, and enters the receiving state after the signal connection frames are sent, waiting to receive a number of signal ACK confirmation frames continuously sent by the slave end; the number of signal connection frames sent by the master end is the same as the number of signal ACK confirmation frames sent by the slave end. If the master end does not receive an ACK confirmation frame from the slave end within a preset time, it indicates that the current channel is not idle or is subject to interference; if the master end receives an ACK confirmation frame from the slave end within a preset time, it indicates that the current channel is idle and is free from interference.

4. The method according to claim 1, characterized in that, The master terminal switches back to the selected wireless communication channel from the baseband channel or the backup baseband channel and enters the normal communication connection state by sending a communication connection frame, including: The master end switches back to the selected wireless communication channel from the baseband channel or the backup baseband channel, and continuously sends a number of communication connection frames to the slave end within the selected wireless communication channel. After the communication connection frames are sent, the master end enters the receiving state and waits to receive a number of communication ACK confirmation frames continuously sent by the slave end. The number of communication connection frames sent by the master end is the same as the number of communication ACK confirmation frames sent by the slave end. If the master end does not receive a communication ACK confirmation frame from the slave end within a preset time, the master end will sequentially switch from the selected wireless communication channel to any wireless communication channel and send signal connection frames one by one to perform channel self-check until a new available wireless communication channel is selected, and then re-attempt to enter the normal communication connection state; if the master end receives a communication ACK confirmation frame from the slave end within a preset time, the master end will enter the normal communication connection state.

5. The method according to claim 4, characterized in that, The slave device switches to the wireless communication channel selected by the master device and re-enters the receiving state. It then enters the normal communication connection state by receiving the communication connection frame sent by the master device, including: The terminal switches to the wireless communication channel selected by the master terminal and re-enters the receiving state, waiting to receive several communication connection frames continuously sent by the master terminal. If the slave does not receive a communication connection frame from the master within a preset time, the slave switches back from the selected wireless communication channel to the baseband channel or the backup baseband channel, and continues to switch back and forth between the baseband channel and the backup baseband channel at fixed intervals. If the slave receives a communication connection frame from the master within a preset time, the slave enters the sending state and continuously sends several communication ACK confirmation frames to the master, and the slave enters the normal communication connection state.

6. The method according to claim 1, characterized in that, Initialize the master and slave ends to a synchronized frequency hopping sequence, and use an adaptive spreading factor algorithm to calculate the optimal spreading factor of the wireless communication channel for synchronized hopping between the master and slave ends. Based on the optimal spreading factor, maintain synchronized frequency hopping data transmission between the master and slave ends, including: Initialize the master and slave ends to a synchronized frequency hopping sequence; The master end uses an adaptive spreading factor algorithm to calculate the optimal spreading factor for the current wireless communication channel, configures physical layer parameters based on the optimal spreading factor, and sends data packets to trigger the slave end's reception process. The adaptive spreading factor algorithm includes: measuring the channel's SNR / RSSI, setting the optimal spreading factor value by comparing the SNR value with a preset threshold, or dynamically balancing the channel's transmission reliability and power consumption using RSSI to calculate the optimal spreading factor value. The optimal spreading factor value is an integer between 7 and 12. The data packet consists of a header and a data payload; the header includes a preamble and a displayed optimal spreading factor indication. The slave terminal synchronously switches to the same wireless communication channel as the master terminal and performs preamble detection. After successful preamble detection, the data packet header is parsed to obtain the optimal spreading factor. Based on the optimal spreading factor, the receiver spreading factor is reconfigured. After receiving the data payload, the ACK or NACK is sent by measuring the received SNR / RSSI, and the master terminal receives the response. When the master receives a NACK, it triggers a retransmission mechanism. After increasing the value of the optimal spreading factor of the current wireless communication channel of the master and slave, it retransmits data packets to maintain synchronous frequency hopping data transmission between the master and slave. When the master receives an ACK, it updates the channel quality database and determines whether the current wireless communication channel of the master and slave meets the preset frequency hopping conditions. If it does, the master jumps to the next wireless communication channel, continues to calculate the optimal spreading factor of the next wireless communication channel, and retransmits data packets to maintain synchronous frequency hopping data transmission between the master and slave. If it does not meet the conditions, the master continues to send data packets in the current wireless communication channel and maintains synchronous frequency hopping data transmission between the master and slave. The calculation of the optimal spreading factor also includes an anti-oscillation mechanism, which includes: detecting whether the latest calculated optimal spreading factor is consistent with the current spreading factor of the channel; if they are inconsistent, further detecting whether the time difference between the last successful data packet transmission on this channel and the current time is greater than a preset minimum hold time; if it is greater, updating the current spreading factor of the channel to the latest calculated optimal spreading factor; if they are consistent or if the time difference is less than or equal to the minimum hold time, keeping the current spreading factor of the channel unchanged.

7. The method according to claim 6, characterized in that, The optimal spreading factor value is calculated by considering the transmission reliability and power consumption of the RSSI dynamically balanced channel, including: A set of RSSI samples from the acquisition channel is subjected to moving average filtering, and the result is based on the standard deviation of the RSSI samples. With filtering results The coefficient of variation of the channel RSSI is obtained as follows: ; ; in, For the sample size, For the first i One RSSI sample; By comparing the coefficient of variation The value of the threshold is used to mark the stability of the current channel communication environment; where, in If the value exceeds a preset threshold, it is marked as an unstable environment; otherwise, it is marked as a stable environment. Based on the environmental labeling results, calibrate the environmental noise baseline of the current channel and calculate the effective RSSI value: ; ; in, This serves as the calibrated environmental noise benchmark. A collection of noise signals. Indicates percentiles; based on Further determine if the decision tree model is usable. If so, use the decision tree model to predict the initial spreading factor of the channel, denoted as: ,in, This indicates the current battery voltage at the main terminal; if unavailable, a piecewise linear approximation is used, and an initial spreading factor is selected according to a preset RSSI and spreading factor mapping table; wherein, the value of the initial spreading factor is an integer between 7 and 12; Further, test packets are sent based on the initial spreading factor, and the transmission reliability of the channel is verified by measuring the packet loss rate. If the packet loss rate is greater than a preset value, the value of the initial spreading factor is increased, and the test packets are resent for transmission reliability verification. Otherwise, the transmission energy consumption of the channel is optimized by measuring the current battery voltage at the master end and calculating the expected transmission time of the test packets. If the battery voltage is less than a preset voltage and the expected transmission time is greater than a preset time, the value of the initial spreading factor is decreased, and the decreased value is output as the optimal spreading factor. Otherwise, the initial spreading factor is directly output as the optimal spreading factor. The expected transmission time is expressed as... ;in, For channel bandwidth, This represents the number of bits in the test packet payload.

8. A bidirectional wireless communication frequency hopping system, characterized in that, The system is used for a bidirectional wireless communication connection between at least one master end and at least one slave end, the system comprising: The channel preset module is used to preset multiple wireless communication channels between the master and slave ends with fixed channel spacing and arranged in ascending order of frequency, and to preset one baseband channel and at least one spare baseband channel between the master and slave ends. The master-end frequency hopping module is used to, when the master-slave communication is lost, sequentially switch from the baseband channel to any wireless communication channel and send a signal connection frame for channel self-test. Only when the wireless communication channel is idle and free from interference is it selected as the currently available wireless communication channel. The master then switches back from the selected wireless communication channel to the baseband channel and sends a signal connection frame for channel self-test. If the baseband channel is idle and free from interference, the master switches back from the baseband channel to the selected wireless communication channel again and enters the normal communication connection state by sending a communication connection frame. If the baseband channel is not idle or is subject to interference, the master sequentially switches from the baseband channel to any backup baseband channel and sends a signal connection frame for channel self-test. Only when the backup baseband channel is idle and free from interference is the master switches back from the backup baseband channel to the selected wireless communication channel and enters the normal communication connection state by sending a communication connection frame. The slave frequency hopping module is used to switch back and forth between the baseband channel and the backup baseband channel at fixed intervals when the master-slave communication is interrupted. It operates in the receiving state. When the slave receives the signal connection frame sent by the master, the slave enters the transmitting state and sends the signal ACK confirmation frame to the master. After the signal ACK confirmation frame is sent, the slave jumps to the wireless communication channel selected by the master and re-enters the receiving state. It enters the normal communication connection state by receiving the communication connection frame sent by the master. The synchronous frequency hopping data transmission module is used to initialize a synchronous frequency hopping sequence for both the master and slave ends when both ends enter a normal communication connection state, and to calculate the optimal spreading factor of the wireless communication channel for synchronous hopping between the master and slave ends using an adaptive spreading factor algorithm, and to maintain synchronous frequency hopping data transmission between the master and slave ends based on the optimal spreading factor.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data transmission method and apparatus

    CN102857327A

  • Method of single receiver receiving different spreading factor sequences at low communication frequency

    CN106817148A

  • Adaptive adjustment frequency hopping communication method and device, equipment and storage medium

    CN119483636A

  • Method for transmitting a signal while avoiding the influences of an interference signal existing in the same channel in a communication system having a main communication device and a plurality of terminal communication devices

    WO2012043991A2