Short-distance Bluetooth connection method
By introducing random seeds and jump directions in the Bluetooth control center, and adopting dynamic channel selection mechanism and priority sorting, the channel congestion problem caused by channel selection synchronization between multiple Bluetooth control centers is solved, achieving more efficient channel resource management and system stability.
Patent Information
- Application Number
- CN202411944063.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-03-18
AI Technical Summary
When working in the same area of multiple Bluetooth control centers, there is a problem of channel congestion caused by channel selection synchronization, resulting in frequent congestion and interference during signal transmission.
By introducing random seeds and jump directions, the synchronization of channel selection is reduced, and a dynamic channel selection mechanism is adopted, priority sorting and jump count upper limit strategy is adopted to reduce the frequency and confusion of channel switching.
It effectively reduces channel congestion, improves the success rate of signal transmission and the overall performance of the system, and ensures the reasonable allocation of channel resources and the stable operation of the system.
Smart Images

Figure CN119653419A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital information transmission, and in particular to a short-range Bluetooth connection method. Background Art
[0002] As a short-range wireless communication technology, Bluetooth uses radio waves to establish connections between devices. It usually works in the 2.4 GHz ISM band and follows the standards set by the Bluetooth SIG. Bluetooth technology works in the 2.4 GHz industrial, scientific, and medical bands that are commonly used worldwide. Common Bluetooth devices usually work in the 2.4 GHz to 2.4835 GHz band, with an available frequency of up to 83.5 MHz. Usually, 79 RF modulation points are set up in the ISM band with a bandwidth of 1 MHz. Bluetooth devices work on these 79 channels and hop randomly. Some devices also work on 23 channels and hop randomly within the 23 channels. Bluetooth has the technical advantage of openness. Short-range wireless communication technology is mainly used to achieve interconnection between fixed devices and mobile communication devices through wireless connections within a small range. It can achieve flexible, secure, and low-cost audio and data communications between various digital devices. As long as the Bluetooth function is turned on, Bluetooth devices can quickly connect to other Bluetooth-enabled devices.
[0003] For example, Chinese patent announcement number CN111970669B discloses a Bluetooth connection method, apparatus and Bluetooth device, the method comprising: sending a clock sequence and a group code, instructing the slave device to hop frequency in the channel group corresponding to the group code, and instructing the slave device to synchronize its own clock sequence according to the clock sequence, wherein the group code is a code corresponding to dividing the Bluetooth channel into a first preset number of channel groups according to a preset rule, and is used to instruct the Bluetooth device to hop frequency in the corresponding channel group; receiving connection response information from the slave device, and determining the Bluetooth connection status according to the connection response information, wherein the connection response information is determined based on the clock sequence matching result and the group code matching result with the slave device. In the embodiment of the present invention, the master device to establish a Bluetooth connection sends a clock sequence and a group code to the slave device, instructing the slave device to synchronize frequency hopping in the corresponding channel group, thereby enhancing the anti-interference ability of the Bluetooth device and avoiding interference during the Bluetooth connection process.
[0004] In the comparison file, there are multiple Bluetooth control centers in the same area. When signals need to be sent, the time periods for multiple devices to send signals are close and overlapped, resulting in congestion when the actual signals are sent. Because the methods used are all authorization text methods, when switching channels, there is a high probability that channel congestion will be discovered at the same time. The first device sends first, and the second device sends a signal right after. The first and second devices should discover channel congestion at the same time, so the switch is initiated at this time, but the switching method is the same, resulting in continuous switching into the same channel, causing continuous congestion.
[0005] When multiple Bluetooth control centers work in the same area, they use the same channel to communicate, especially when they all need to send signals and the time periods are close or overlapping. Since they all follow the same frequency hopping and channel selection mechanism, there is a risk of simultaneously discovering channel congestion and trying to switch to the same channel. Summary of the invention
[0006] The present application provides a short-range Bluetooth connection method, which reduces the synchronization of channel selection between Bluetooth control centers by introducing random seeds and jump directions, reduces the risk of switching to the same channel at the same time, implements a dynamic channel selection mechanism between Bluetooth control centers, and reduces channel congestion.
[0007] This application provides a short-range Bluetooth connection method, including: S101, the Bluetooth control center registers the information obtained in the self-identification process to the communication network in the same area, the Bluetooth control center includes a channel monitoring module, the channel monitoring module is used to monitor the channel status, and the obtained information includes MAC address and hardware information; S102, periodically scanning the channel, storing the scanned data in a local database, and analyzing the channel load trend by a preset algorithm; S103, generating a random seed based on the MAC address, where the MAC address is a globally unique identifier, and converting the identifier into an irregular digital sequence through mathematical operations; and prioritizing the channels according to the load trends of the channels and the random seed; S104, according to the priority channel list obtained by sorting the channels in priority in step S103, the optimal channel is selected for communication, and the Bluetooth control center sends a signal, and records the channel usage during the process of sending the signal; S105, during the signal transmission process, if signal congestion is detected, a congestion handling process is triggered, and a channel is reselected according to the current channel load trend.
[0008] Preferably, the self-identification process is to read the MAC address and hardware information of the Bluetooth control center, where the MAC address is a globally unique identifier, and transmit the identified MAC address and hardware information to a server in the communication network. Other devices can connect and communicate with Bluetooth by searching the MAC address in the query server.
[0009] Preferably, the channel load trend is analyzed by using a preset exponential smoothing method, 24 hours of channel data is collected, the collected data is arranged in chronological order to form a time series, and the smoothing coefficient is selected as , It is an empirical value for technicians in this field, obtained based on historical data and expert experience. , where S(t) is the smoothed value at time point t, is the actual value at time point t, S(t-1) is the smoothed value at time point t-1, and the smoothed values calculated at each time point are connected to form a smooth sequence.
[0010] Preferably, each of the Bluetooth control centers generates a random seed, and each of the random seeds generates a corresponding jump direction, the jump direction is the order in which the Bluetooth control center traverses the channels, and the multiple channels are sorted according to the jump direction.
[0011] Preferably, the order of traversing the channels is a single-direction traversal, that is, no back and forth jumps are performed, and only forward or backward movement is performed.
[0012] Preferably, the process of generating a jump direction with a random seed is as follows: the random seed is sent as input to a hash function, the hash function converts the random seed into a fixed number, and the mapping process of the hash function is d=H(s), where s is the input value of the random seed, d is the generated jump direction, and H is the hash function.
[0013] Preferably, the Bluetooth control center sets an upper limit on the number of jumps, and when the upper limit on the number of jumps is reached, the Bluetooth control center sends a broadcast message to other surrounding Bluetooth control centers.
[0014] Preferably, the Bluetooth control center sets the channel allocation step of the jump quantity upper limit: S301, based on the random seed and the jump direction, preset the upper limit of the jump quantity, and record the number of current Bluetooth control center connections; S302, according to the priority channel list in step S104, the Bluetooth control center occupies the first channel in the channel list, and while occupying the channel, monitors the occupancy status of the current channel; S303, when the number of jumps reaches a preset upper limit of the number of jumps, the Bluetooth control center sends information through a broadcast channel; S304, based on the information packet obtained in step S303, starting from the Bluetooth control center with the least number of connections, jump the channel according to the strategy of giving priority to the smallest number of connections; S305, monitoring the situation after the channel jump. If the channel congestion is still found after the jump, repeat steps S302 to S304 until a stable state is reached. The stable state is a state in which the channel allocation is reasonable and there is no obvious congestion.
[0015] Preferably, the upper limit of the jump number limits the maximum number of times the Bluetooth control center jumps channels within a certain period of time, and the upper limit of the jump number is set based on the processor and network load data of the Bluetooth control center.
[0016] Preferably, according to the minimum connection priority jump strategy, a list of channels that need to be jumped is made, and the channels are further selected, starting from the Bluetooth control center with the least number of connections, and gradually expanding to other Bluetooth control centers on the list, and setting the jump time and target channel for each channel that needs to be jumped.
[0017] One or more technical solutions provided in this application have at least the following technical effects or advantages: By introducing random seeds, the synchronization of channel selection between Bluetooth control centers is reduced, the risk of switching to the same channel at the same time is reduced, and a dynamic channel selection mechanism between Bluetooth control centers is implemented to reduce channel congestion; By jumping the direction, it ensures that the Bluetooth control center will not simply repeat the previous selection when switching channels, increasing the diversity of channel selection. Channel sorting provides the Bluetooth control center with an ordered selection list, making it easy to quickly switch to an idle channel when congested. A channel coordination allocation strategy based on the upper limit of the number of jumps and the status information of surrounding devices can effectively reduce the frequency and confusion of channel switching, avoid the vicious cycle caused by the simultaneous switching of a large number of devices, and ensure the reasonable allocation of channel resources and the stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of a short-range Bluetooth connection method of the present invention; Figure 2 A schematic flow chart of a channel allocation step for setting an upper limit on the number of jumps for a Bluetooth control center according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] To facilitate the understanding of the present invention, the present application will be described more comprehensively below with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, but the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, the purpose of providing these embodiments is to enable a more thorough and comprehensive understanding of the disclosed content of the present invention.
[0020] It should be noted that the terms “vertical”, “horizontal”, “up”, “down”, “left”, “right” and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more related listed items.
[0022] Embodiment 1: Figure 1 1 is a flow chart of a short-range Bluetooth connection method according to an embodiment of the present invention, comprising the following steps: S101, the Bluetooth control center registers the information obtained in the self-identification process to the communication network in the same area, and the Bluetooth control center includes a channel monitoring module, and the channel monitoring module is used to monitor the status of the Bluetooth channel; The self-identification process is to read the MAC address and hardware information of the Bluetooth control center. The MAC address is a globally unique identifier. The MAC address enables the Bluetooth control center to be accurately identified and the identified MAC address and hardware information are transmitted to the server in the communication network. Other devices can connect and communicate with Bluetooth by searching the MAC address in the server; the channel monitoring module monitors the channel occupancy and the number of active devices. The occupancy refers to which channels are being used and which channels are idle; the number of active devices refers to how many devices are using Bluetooth for communication in the current environment.
[0023] S102, periodically scan the channel, store the scanned data in a local database, and analyze the channel load trend by a preset algorithm.
[0024] The channel of the Bluetooth control center is set to be scanned once every 10 milliseconds. The Bluetooth control center traverses all channels, collects information about each channel, and creates a channel usage analysis table based on the collected information. The periodic channel scanning enables the Bluetooth control center to monitor the channel uninterruptedly, so that the Bluetooth control center can collect the latest information in a timely manner and respond to channel congestion, signal interference and other situations in a timely manner. After the scan is completed, the collected data is stored in a local database, which is used to save and manage the scanned data; the channel load in the next hour is predicted by using a preset exponential smoothing method, and 24 hours of channel data is collected. The collected data is arranged in chronological order to form a time series, and the smoothing coefficient is selected as , It is an empirical value for technicians in this field, obtained based on historical data and expert experience. , where S(t) is the smoothed value at time point t, is the actual value at time point t, S(t-1) is the smoothed value at time point t-1, the smoothed values calculated at each time point are connected to form a smoothed sequence, and the last value of the smoothed sequence is used as the starting point of the prediction. Combining the smoothing coefficient and the periodic changes of historical data, the channel load in the next hour is predicted. If the smoothed value increases, it means that the channel load has increased, that is, the channel is congested. If the smoothed value decreases, it means that the channel load has decreased.
[0025] S103, generating a random seed based on the MAC address, where the MAC address is a globally unique identifier and is converted into an irregular digital sequence; and prioritizing the channels according to the channel load conditions and the random seed.
[0026] In some embodiments, the MAC address format of the Bluetooth control center is six groups of two-digit hexadecimal numbers, the MAC address 00:1A:2B:3C:4D:5E generates a random seed, the hexadecimal MAC address is converted into a long integer, the converted long integer is 0x001A2B3C4D5E, the first two digits 0x are the hexadecimal prefix, indicating that the number is hexadecimal, the current timestamp is 1672531200000 milliseconds, the timestamp is XORed with the long integer of the MAC address, the random seed seed=0x001A2B3C4D5E⊕0x63775800, the 0x63775800 is the hexadecimal of 1672531200000 milliseconds; the Bluetooth control center has three available channels, namely the first channel, the second channel and the third channel, and the three channels are obtained through monitoring by the channel monitoring module. The load conditions of the channels are as follows: the load of the first channel is 30%, the load of the second channel is 50%, and the load of the third channel is 20%. The channels are evaluated according to the set scoring criteria: 3 points are given for a load below 30%, 2 points are given for a load between 30% and 50%, and 1 point is given for a load above 50%. Therefore, the first channel gets 2 points, the second channel gets 1 point, and the third channel gets 3 points. According to the calculated random seed, the first channel, the second channel, and the third channel are scored respectively, and the scores obtained are +0.5, -0.2, and +0.1 respectively. The load conditions and the scores of the random seeds are combined, and the first channel gets 2.5 points, the second channel gets 0.8 points, and the third channel gets 3.1 points. According to the scores, the channels are arranged from high to low, and the third channel is greater than the first channel and greater than the second channel, forming a channel list arranged by priority.
[0027] The random seed is an initial value used for a random number generator. By providing a specific seed value, the random number generator can generate a series of determined random number sequences. Different random number sequences are obtained for different seed values. In scenarios where random numbers are used to avoid conflicts or perform channel selection in Bluetooth communications, the selection of random seeds ensures the stability of the system. Specifically, each device generates a unique random seed based on its own unique identifier and timestamp information. This random seed is then used as the starting point of the random number generator to generate a series of random numbers. Since the random seeds of each device are different, the random number sequences they generate will also be different.
[0028] When a device needs to select an idle channel for communication, it uses these random numbers to assist the channel selection process. Random numbers can be used to determine the priority of channel selection, randomly skip certain channels, or otherwise affect the channel selection algorithm. Since different devices generate different random numbers, they are more likely to make different decisions when selecting channels, thereby avoiding congestion or conflicts caused by selecting the same channel at the same time.
[0029] Therefore, by assigning different random seeds to each device, the system can manage channel resources more effectively and improve communication efficiency and stability. S104, according to the priority channel list obtained in step S103, the optimal channel is selected for communication, and the Bluetooth control center immediately sends a signal and records the channel usage during the signal sending process.
[0030] Before selecting a channel, the Bluetooth control center uses a channel monitoring module to check the channel to ensure that the channel is available at the current moment and is not occupied by other devices or is in a congested state. Based on the priority channel list in step S103, the third channel is selected for communication. The Bluetooth control center immediately sends a signal through the third channel. During the signal sending process, the channel usage is recorded, including information such as the sending success rate and signal strength.
[0031] S105, during the signal transmission process, if signal congestion is detected, a congestion handling process is triggered, and a channel with a higher priority is reselected according to the current channel load.
[0032] When the Bluetooth control center sends a signal, if it detects that the number of retransmissions is greater than the preset threshold of 3 times, it triggers the congestion handling program and reselects a channel with a lower load according to the load of the current channel.
[0033] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages: The dynamic channel selection mechanism of the Bluetooth control center reduces the congestion problem caused by the synchronization of channel selection between Bluetooth control centers, improves the success rate of signal transmission and the overall performance of the system. At the same time, through real-time monitoring and priority sorting, the Bluetooth control center can select the optimal channel more quickly and accurately, improves communication efficiency, introduces randomness and real-time channel monitoring, and enhances the system's anti-interference ability and adaptability.
[0034] Embodiment 2: Based on the case where the number of Bluetooth control centers in Embodiment 1 is relatively small, such as two, the introduction of random seeds enables the Bluetooth control centers to select different channels, and the probability of selecting the same channel at the same time is relatively low. However, in the same area, there are multiple Bluetooth control centers at the same time, and channels of the multiple Bluetooth control centers overlap when jumping, causing congestion. Therefore, a jumping direction is assigned to the random seed so that the Bluetooth control centers do not overlap when jumping.
[0035] Each Bluetooth control center generates a random seed, and generates a corresponding jump direction for each random seed. The jump direction is the order in which the Bluetooth control center traverses the channels, and multiple channels are sorted according to the jump direction. The order of traversing the channels is a single-direction traversal, that is, no back and forth jumps, only forward or backward movement, and the random seed is sent as input to the hash function. The hash function converts the random seed into a fixed number. The mapping process of the hash function is d=H(s), where s is the input value of the random seed, d is the generated jump direction, and H is the hash function. The hash function outputs a unique jump direction. Through the jump direction, it is ensured that the device will not simply repeat the previous choice when jumping the channel, thereby increasing the diversity of channel selection.
[0036] In most countries, the frequency bandwidth and number of channels used by Bluetooth are allocated to 79 frequency hopping channels. The 79 channels are sorted according to the hopping direction. The sorting is linear increasing, linear decreasing and fixed step increasing. The linear increasing is from left to right, increasing one channel each time; the linear decreasing is from left to right, decreasing one channel each time; the fixed step increasing is from left to right, and the fixed step increasing is 5 each time. The sorting order is 1, 6, 11, ..., 76. The total number of 79 channels is the factorial of 79. The three Bluetooth control centers A, B, and C are currently congested in the first On one channel, according to the random seed and the jumping direction, Bluetooth control center A chooses to jump in the order of the second channel, the third channel, ..., the seventy-ninth channel; Bluetooth control center B chooses to jump in the order of the seventy-ninth channel, the seventy-eighth channel, ..., the first channel; and Bluetooth control center C chooses to jump in the middle order of the thirty-ninth channel, the fortieth channel, ..., back to the thirty-eighth channel and then continues to jump. The three Bluetooth control centers jump on different channels in different orders, avoiding channel overlap caused by frequent jumping and reducing channel congestion.
[0037] By monitoring the status of the current channel, including monitoring the channel occupancy rate and channel strength, according to the priority channel list in Example 1, the Bluetooth control center first communicates through the first channel in the channel list. If it is detected that the current channel is congested, other channels are selected according to the random seed and the jump direction, so that the Bluetooth control center chooses to traverse all channels in reverse order and selects a channel with a small number of connections and a small load to communicate again.
[0038] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages: By jumping direction, it is ensured that the device will not simply repeat the previous selection when jumping channels, thereby increasing the diversity of channel selection. Channel sorting provides devices with an ordered selection list, which facilitates quick jumping to idle channels in congestion. By providing each Bluetooth control center with a unique random seed and channel sorting, the diversity and flexibility of channel selection are ensured.
[0039] Embodiment three: Based on embodiment two, when multiple Bluetooth control centers continuously search for idle channels for communication through jumping directions, subsequent information will overlap when jumping channels, causing circulation confusion. An upper limit on the number of jumps is set for multiple Bluetooth control centers. When the upper limit on the number of jumps is reached, the Bluetooth control center sends a broadcast message. Other Bluetooth centers know the number of jump directions of surrounding Bluetooth control centers through the received broadcast messages. When congestion occurs, the Bluetooth control center with the least number of connections is selected for jumping, so as to avoid channel congestion caused by a large number of Bluetooth control centers jumping at the same time.
[0040] Figure 2 To set the channel allocation limit for the Bluetooth control center: S301, based on the random seed and the jump direction, preset an upper limit of the jump quantity, and record the number of current Bluetooth control center connections.
[0041] The upper limit of the number of jumps limits the maximum number of times the Bluetooth control center jumps channels within a certain period of time, thereby preventing the Bluetooth control center from causing system instability due to too frequent channel jumps. Based on the processor of the Bluetooth control center, when the number of jumps exceeds 10 times per second, the response speed of the Bluetooth control center slows down, and the upper limit of the number of jumps is set to 10 times. By monitoring the network load data, 5 jumps per second is the maximum limit that the network can tolerate, and the upper limit of the number of jumps is adjusted to 5 times; MySQL is used to record the number of connections of the Bluetooth control center, and a table for storing the connection information of the Bluetooth control center is created in the MySQL database, the table includes key fields such as the MAC address, connection time, disconnection time and status of the Bluetooth control center, the connection time records the time point when the Bluetooth is connected to the Bluetooth control center, and when the Bluetooth control center is connected, a new record is inserted into the table, the new record includes the MAC address, connection time and status, and the status is connected; when the Bluetooth control center is disconnected, the corresponding record is searched according to the MAC address of the device, the disconnection time and status are updated, the status is updated to disconnected, the number of connected states is counted, and the current number of Bluetooth control center connections is recorded.
[0042] S302: According to the priority channel list in step S104, the Bluetooth control center occupies the first channel in the channel list, and monitors the occupancy status of the current channel while occupying the channel.
[0043] If the first channel is not occupied, the Bluetooth control center occupies the channel and communicates; if the first channel is occupied, the Bluetooth control center occupies the next channel in the channel list until an available channel is found or the channel list is traversed; if it is found that the current channel is occupied by other Bluetooth control centers, the current Bluetooth control center stops using the channel and jumps to other channels.
[0044] S303: When the number of jumps reaches a preset upper limit of the number of jumps, the Bluetooth control center sends information through a broadcast channel.
[0045] The information sent includes MAC address, random seed, jump direction, number of currently connected Bluetooth devices and channel occupancy status. The collected information is packaged into an information packet. The broadcast channel can be accessed by all Bluetooth control centers. The information packet is sent using the broadcast channel. After other Bluetooth control centers receive the information packet, they parse the content and respond quickly, so that all surrounding Bluetooth control centers can obtain the information of the current Bluetooth control center.
[0046] S304: Based on the information packet obtained in step S303, starting from the Bluetooth control center with the least number of connections, the channel is jumped according to the strategy of giving priority to the smallest number of connections.
[0047] After the preliminary selection of the channel based on step S302, a list of channels that need to be jumped is listed according to the jump strategy of minimum connection priority, and the channel is further selected, starting from the Bluetooth control center with the least number of connections, and gradually expanding to other Bluetooth control centers on the list. A jump time and target channel are set for each channel that needs to be jumped to avoid temporary communication interruption caused by simultaneous jumps; after the jump is completed, the Bluetooth control center sends jump feedback information through the broadcast channel, and the jump feedback information includes the jump result, the current channel occupancy status and the updated connection information. The minimum connection priority strategy enables the Bluetooth control center to have the least impact on the overall network communication when jumping, and it is easier to jump when the number of connections is minimized, and fewer connections and communications need to be processed during the jump.
[0048] In some embodiments, there are three Bluetooth control centers and five available communication channels. Each control center is currently connected to a certain number of devices and is communicating through a certain channel. Due to channel congestion and signal interference, these control centers need to be channel-hopping. The first control center is connected to ten devices and uses the first channel; the second control center is connected to five devices and uses the second channel; the third control center is connected to eight devices and uses the third channel; According to step S302, the first control center jumps to the fourth channel; the second control center remains on the second channel, which is currently in good condition; the third control center jumps to the fifth channel. The first control center jumps to the fourth channel at the specified time, and broadcasts a jump feedback indicating that the jump is successful. The fourth channel is now used by the first control center, with an occupancy rate of 30%.
[0049] S305, monitoring the situation after the channel jump. If the channel congestion is still found after the jump, repeat steps S302 to S304 until a stable state is reached. The stable state is a state in which the channel allocation is reasonable and there is no obvious congestion.
[0050] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages: Channels are jumped based on random seeds, jump directions, upper limits on jump numbers, and status information of surrounding Bluetooth control centers, reducing the frequency and confusion of channel jumps, avoiding the vicious cycle caused by a large number of devices jumping at the same time, ensuring the rational allocation of channel resources and the stable operation of the system. Through orderly jumping, channel idleness and conflicts are reduced, the effective utilization rate of channels is improved, frequent device jumps and vicious cycles caused by channel congestion are avoided, and the overall stability of the system is enhanced.
[0051] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A short-range Bluetooth connection method, characterized in that: include: S101, the Bluetooth control center registers the information obtained in the self-identification process to the communication network in the same area, the Bluetooth control center includes a channel monitoring module, the channel monitoring module is used to monitor the channel status, the obtained information includes MAC address and hardware information; S102, periodically scanning the channel, storing the scanned data in a local database, and analyzing the channel load trend by a preset algorithm; S103, generating a random seed based on the MAC address, where the MAC address is a globally unique identifier, and converting the identifier into an irregular digital sequence through mathematical operations; and prioritizing the channels according to the load trends of the channels and the random seed; S104, according to the priority channel list obtained by sorting the channels in priority in step S103, the optimal channel is selected for communication, and the Bluetooth control center sends a signal, and records the channel usage during the process of sending the signal; S105, during the signal transmission process, if signal congestion is detected, a congestion handling process is triggered, and a channel is reselected according to the current channel load trend.
2. A short-range Bluetooth connection method as claimed in claim 1, characterized in that: The self-identification process is to read the MAC address and hardware information of the Bluetooth control center. The MAC address is a globally unique identifier, and the identified MAC address and hardware information are transmitted to the server in the communication network. Other devices can connect and communicate with Bluetooth by searching the MAC address in the server.
3. A short-range Bluetooth connection method as claimed in claim 1, characterized in that: By using the preset exponential smoothing method to analyze the channel load trend, the channel data is collected and the collected data is arranged in chronological order to form a time series. The smoothing coefficient is selected as , It is an empirical value for technicians in this field, obtained based on historical data and expert experience. , where S(t) is the smoothed value at time point t, is the actual value at time point t, S(t-1) is the smoothed value at time point t-1, and the smoothed values calculated at each time point are connected to form a smooth sequence.
4. A short-range Bluetooth connection method as claimed in claim 1, characterized in that: Each of the Bluetooth control centers generates a random seed, and each of the random seeds generates a corresponding jump direction. The jump direction is the order in which the Bluetooth control center traverses the channels, and multiple channels are sorted according to the jump direction.
5. A short-range Bluetooth connection method as claimed in claim 4, characterized in that: The order of traversing the channels is a single-direction traversal, that is, no back and forth jumps are performed, and only forward or backward movement is performed.
6. A short-range Bluetooth connection method as claimed in claim 4, characterized in that: The process of generating jump directions from random seeds: Send the random seeds as input to the hash function, and the hash function converts the random seeds into fixed numbers. The mapping process of the hash function is d=H(s), where s is the input value of the random seed, d is the generated jump direction, and H is the hash function.
7. A short-range Bluetooth connection method as claimed in claim 4, characterized in that: The Bluetooth control center sets an upper limit on the number of jumps. When the upper limit is reached, the Bluetooth control center sends a broadcast message to other Bluetooth control centers around it.
8. A short-range Bluetooth connection method as claimed in claim 7, characterized in that: The steps for setting the channel allocation limit of the jump quantity in the Bluetooth control center are as follows: S301, based on the random seed and the jump direction, preset an upper limit value of the jump quantity, and record the number of current Bluetooth control center connections; S302, according to the priority channel list in step S104, the Bluetooth control center occupies the first channel in the channel list, and while occupying the channel, monitors the occupancy status of the current channel; S303, when the number of jumps reaches a preset upper limit of the number of jumps, the Bluetooth control center sends information through a broadcast channel; S304, based on the information obtained in step S303, starting from the Bluetooth control center with the least number of connections, jump the channel according to the strategy of giving priority to the smallest number of connections; S305, monitoring the situation after the channel jump. If the channel congestion is still found after the jump, repeat steps S302 to S304 until a stable state is reached. The stable state is a state in which the channel allocation is reasonable and there is no obvious congestion.
9. A short-range Bluetooth connection method as claimed in claim 8, characterized in that: The upper limit of the number of jumps limits the maximum number of times the Bluetooth control center jumps channels within a certain period of time, and the upper limit of the number of jumps is set based on the processor and network load data of the Bluetooth control center.
10. A short-range Bluetooth connection method as claimed in claim 8, characterized in that: According to the minimum connection priority jump strategy, a list of channels that need to be jumped is made, and the channels are further selected, starting from the Bluetooth control center with the least number of connections, and gradually expanding to other Bluetooth control centers on the list, and setting a jump time and target channel for each channel that needs to be jumped.
Citation Information
Patent Citations
A Bluetooth connection method, apparatus and Bluetooth device
CN111970669B