Bluetooth connection method and gateway device

By setting up multiple Bluetooth modules on the gateway device and managing connections based on scanning results and priority policies, the problem of the limited number of Bluetooth device connections is solved, enabling more Bluetooth devices to communicate and transmit data simultaneously.

CN121908244APending Publication Date: 2026-04-21ZHEJIANG GUMING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG GUMING TECH CO LTD
Filing Date
2025-12-15
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, the number of Bluetooth devices that a master device can connect to simultaneously is limited, which cannot meet the ever-increasing communication demands.

Method used

Multiple Bluetooth modules are set up on the gateway device. Each module is triggered to scan by Bluetooth scanning conditions and connects to the Bluetooth device to be connected according to the scanning results. The connection is managed by signal strength and priority policies to realize data transmission between multiple devices.

Benefits of technology

By working together with multiple Bluetooth modules, the number of Bluetooth devices that can be connected to the gateway at the same time is increased, meeting the growing communication needs and optimizing the data transmission efficiency of the devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908244A_ABST
    Figure CN121908244A_ABST
Patent Text Reader

Abstract

The invention provides a Bluetooth connection method and gateway equipment, and the method comprises the steps: controlling a plurality of Bluetooth modules to carry out Bluetooth scanning when determining that a Bluetooth scanning condition is satisfied, and controlling each Bluetooth module to carry out the Bluetooth connection with the scanned to-be-connected Bluetooth equipment according to the Bluetooth scanning result of the plurality of Bluetooth modules. Equipment data sent by each to-be-connected Bluetooth equipment is received through each Bluetooth connection, and the equipment data is transmitted to the server; according to the application, the plurality of Bluetooth modules are arranged on the gateway equipment, so that hardware support is provided for the gateway equipment to be connected with more Bluetooth equipment at the same time, more Bluetooth equipment can transmit equipment data to the server by means of the gateway equipment, and the ever-increasing communication requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a Bluetooth connection method and gateway device. Background Technology

[0002] With the rapid development of communication technology and the advent of the era of the Internet of Things, interconnectivity between devices has become increasingly popular. Bluetooth, as a short-range wireless communication technology, has become one of the mainstream communication technologies due to its low cost, low power consumption, flexibility, and security. More and more devices are beginning to support Bluetooth and utilize it to achieve communication connections between devices. These devices that support Bluetooth communication are also called Bluetooth devices.

[0003] A device that connects to multiple Bluetooth devices is called a master device. Generally speaking, the number of Bluetooth devices that can be connected to a master device at the same time is limited, which can no longer meet the ever-increasing communication needs. Therefore, there is an urgent need for a solution that can connect to more Bluetooth devices at the same time. Summary of the Invention

[0004] The purpose of this application is to provide a Bluetooth connection method and a gateway device to solve the above-mentioned technical problems.

[0005] On one hand, a Bluetooth connection method is provided, applied to a gateway device, wherein the gateway device is equipped with multiple Bluetooth modules, and the method includes: When the Bluetooth scanning conditions are met, control multiple Bluetooth modules to perform Bluetooth scanning; Based on the Bluetooth scanning results of the multiple Bluetooth modules, each Bluetooth module is controlled to establish a Bluetooth connection with the Bluetooth device it scanned, so as to receive device data sent by each Bluetooth device and transmit the device data to the server.

[0006] In one embodiment, the step of controlling each Bluetooth module to establish a Bluetooth connection with its respective scanned Bluetooth device based on the Bluetooth scanning results of the plurality of Bluetooth modules includes: For a scanned Bluetooth device to be connected, one Bluetooth module is selected from the plurality of Bluetooth modules as the target module of the Bluetooth device to be connected; Control the target module to connect to the Bluetooth device to be connected.

[0007] In one embodiment, determining one Bluetooth module from a plurality of Bluetooth modules as the target module for a scanned Bluetooth device to be connected includes: When multiple Bluetooth modules scan for the Bluetooth device to be connected, the Bluetooth signal strength scanned by each Bluetooth module for the Bluetooth device to be connected is obtained; The target module of the Bluetooth device to be connected is determined based on the strength of each Bluetooth signal.

[0008] In one embodiment, determining the target module of the Bluetooth device to be connected based on the Bluetooth signal strength includes: Compare the Bluetooth signal strengths described above; Based on the comparison results, the Bluetooth module corresponding to the maximum Bluetooth signal strength is selected as the target module of the Bluetooth device to be connected.

[0009] In one embodiment, controlling the target module to connect to the Bluetooth device to be connected includes: Determine whether the number of currently connected Bluetooth devices to the target module has reached a threshold; If not, control the target module to connect to the Bluetooth device to be connected; If so, after disconnecting the target module from the connected Bluetooth device, control the target module to connect to the Bluetooth device to be connected.

[0010] In one embodiment, the control to disconnect the target module from the connected Bluetooth device includes: Obtain the priority of each of the connected Bluetooth devices; Control the disconnection of the target module from the lowest priority Bluetooth device among the connected devices.

[0011] In one embodiment, the gateway device is provided with a mapping table between Bluetooth devices and priorities, and obtaining the priority of each connected Bluetooth device includes: The priority corresponding to each of the connected Bluetooth devices is determined based on the correspondence table.

[0012] In one embodiment, the method further includes: Obtain the working duration and / or offline duration of each of the connected Bluetooth devices; The priority of each connected Bluetooth device in the corresponding relationship table is adjusted according to the working time and / or offline time of each connected Bluetooth device.

[0013] In one embodiment, before the control disconnects the connection between the target module and the lowest priority of the connected Bluetooth devices, the method further includes: The lowest priority among the connected Bluetooth devices is determined to be lower than the priority of the Bluetooth device to be connected.

[0014] On the other hand, a gateway device is also provided, which is provided with a plurality of Bluetooth modules. The gateway device further includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described above.

[0015] The Bluetooth connection method and gateway device provided in this application control multiple Bluetooth modules to perform Bluetooth scanning when Bluetooth scanning conditions are met. Based on the Bluetooth scanning results of the multiple Bluetooth modules, each Bluetooth module is controlled to establish a Bluetooth connection with the Bluetooth device it scanned, so as to receive device data sent by each Bluetooth device and transmit the device data to the server. By setting multiple Bluetooth modules on the gateway device, this application provides hardware support for the gateway device to connect to more Bluetooth devices simultaneously, enabling more Bluetooth devices to transmit device data to the server through the gateway device, thus meeting the growing communication needs.

[0016] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The purposes and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to limit this disclosure. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1 A horizontal top view provided for an embodiment of this application; Figure 2 A vertical front view provided for an embodiment of this application; Figure 3 This is a first flowchart illustrating the Bluetooth connection method provided in an embodiment of this application; Figure 4 This is a second flowchart illustrating the Bluetooth connection method provided in an embodiment of this application; Figure 5 A third flowchart illustrating the Bluetooth connection method provided in an embodiment of this application; Figure 6 A fourth flowchart illustrating the Bluetooth connection method provided in this application embodiment; Figure 7 A fifth flowchart illustrating the Bluetooth connection method provided in this application embodiment; Figure 8 This is a schematic diagram of the gateway device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0020] This application provides a Bluetooth connection method applied to a gateway device. In this application, the gateway device refers to a network hardware device that can achieve interconnection and interoperability between networks with different protocols, different architectures, or different formats.

[0021] Specifically, in this embodiment, the gateway device can receive device data sent by the Bluetooth device based on the Bluetooth communication protocol, and then forward the device data to the server through another communication protocol, such as the Internet Protocol, to realize communication between the Bluetooth device and the server. The server in this embodiment can be any type of server, such as a cloud server.

[0022] In this embodiment, the gateway device is equipped with multiple Bluetooth modules. For example, it includes at least a first Bluetooth module and a second Bluetooth module. A Bluetooth module is a hardware module used to realize Bluetooth connection with an external Bluetooth device. The hardware module includes a Bluetooth chip and an antenna.

[0023] To avoid co-channel interference between the antennas of the various Bluetooth modules, the antennas in each Bluetooth module in this embodiment can be directional antennas, whose signal radiation range is focused in a specific direction, thereby achieving transmission over longer distances. Specifically, each antenna can be responsible for covering an area in one direction, so that the entire gateway device can cover a wider area.

[0024] Taking the setup of two Bluetooth modules on a gateway device as an example, the two Bluetooth modules can be positioned relative to each other on the gateway device to achieve coverage of a wider area. For example, please refer to... Figure 1 and Figure 2 As shown, these two Bluetooth modules can be positioned adjacent to two opposite sides of the gateway device. Figure 1 and Figure 2 The images show a top view and a front view of the gateway device, illustrating the location of the Bluetooth module on the gateway device. Figure 1 The area within the circular region is the signal coverage area corresponding to each Bluetooth module.

[0025] The Bluetooth connection method provided in this application embodiment can be applied to the aforementioned gateway device. Please refer to [link / reference]. Figure 3 As shown, the specific steps may include the following: S31: When the Bluetooth scanning conditions are met, control each Bluetooth module to perform a Bluetooth scan.

[0026] S32: Based on the Bluetooth scanning results of multiple Bluetooth modules, control each Bluetooth module to establish a Bluetooth connection with the Bluetooth device to be connected that it has scanned, so as to receive device data sent by each Bluetooth device to be connected through each Bluetooth connection and transmit the device data to the server.

[0027] The following is a detailed explanation of each of the above steps.

[0028] For step S31, in one embodiment, the gateway device can periodically control all or some of the Bluetooth modules on the gateway device to perform Bluetooth scanning, for example, performing a Bluetooth scan every preset time interval; or, it can control each Bluetooth module to perform Bluetooth scanning when a preset time point is reached, for example, performing a Bluetooth scan once a day at 6 o'clock; or, it can control each Bluetooth module to perform Bluetooth scanning when it receives a Bluetooth scanning command issued by the user.

[0029] For step S32, please refer to Figure 4 As shown, it may include the following sub-steps: S321: For a scanned Bluetooth device to be connected, select one Bluetooth module from multiple Bluetooth modules as the target module for the Bluetooth device to be connected.

[0030] S322: Controls the target module to connect to the Bluetooth device to be connected.

[0031] First, let's explain step S321 in detail.

[0032] In this embodiment, the Bluetooth devices to be connected refer to the devices that each Bluetooth module scans and has the ability to connect to the corresponding Bluetooth module via Bluetooth. The number of Bluetooth devices to be connected can be one or more.

[0033] It should be noted that if a Bluetooth device to be connected is detected by only one Bluetooth module, then that Bluetooth module can be directly used as the target module for the Bluetooth device to be connected, and the target module can be controlled to connect to the Bluetooth device to be connected in the future.

[0034] If multiple Bluetooth modules scan for the same Bluetooth device to be connected, the gateway device can select one of these Bluetooth modules as the target module for that Bluetooth device.

[0035] In one embodiment, when multiple Bluetooth modules scan the same Bluetooth device to be connected, it can first be determined whether the number of Bluetooth devices currently connected to each Bluetooth module has reached a threshold. If the number of Bluetooth devices currently connected to a Bluetooth module has not reached the threshold, that Bluetooth module can be used as the target module for the Bluetooth device to be connected. If the number of Bluetooth devices currently connected to each Bluetooth module has not reached the threshold, the Bluetooth module corresponding to the one with the highest scanned signal strength can be used as the target module for the Bluetooth device to be connected.

[0036] In another embodiment, when multiple Bluetooth modules scan the same Bluetooth device to be connected, the Bluetooth signal strength scanned by each Bluetooth module for the Bluetooth device to be connected can be obtained; and the target module of the Bluetooth device to be connected can be determined based on the Bluetooth signal strength.

[0037] Understandably, when each Bluetooth module performs Bluetooth scanning, it can obtain the corresponding Bluetooth signal strength for the Bluetooth devices it scans to connect to. The stronger the Bluetooth signal strength, the higher the Bluetooth communication quality between the Bluetooth device to be connected and the corresponding Bluetooth module.

[0038] Therefore, in this embodiment, the strengths of each Bluetooth signal can be compared, and based on the comparison results, the Bluetooth module corresponding to the maximum value of the Bluetooth signal strength can be used as the target module of the Bluetooth device to be connected.

[0039] In this embodiment, controlling the connection between the target module and the Bluetooth device to be connected may include: Determine if the number of currently connected Bluetooth devices to the target module has reached the threshold. If not, control the target module to connect to the Bluetooth device to be connected; If so, after disconnecting the target module from the connected Bluetooth device, control the target module to connect to the Bluetooth device to be connected.

[0040] The connected Bluetooth devices of the target module refer to devices that have already established a Bluetooth connection with the target module. For example, if a Bluetooth module is already connected to Bluetooth devices A and B, and then scans for Bluetooth device C that has not established a Bluetooth connection with it, then Bluetooth devices A and B are the connected Bluetooth devices of the Bluetooth module, and Bluetooth device C is the Bluetooth device to be connected to the Bluetooth module.

[0041] It should be noted that the threshold in this embodiment can be flexibly set by the developers. Specifically, it can be set according to the number of Bluetooth devices that the Bluetooth module's Bluetooth protocol supports for simultaneous connection, for example, it can be set to 5, 6, or 7. Of course, this threshold can also be dynamically issued by the server. For example, the server can periodically analyze the Bluetooth communication quality of each Bluetooth module and then dynamically adjust the threshold.

[0042] In one embodiment, controlling the disconnection of the target module from the connected Bluetooth device may include: Get the priority of each connected Bluetooth device; Controls disconnection between the target module and the lowest priority connected Bluetooth device.

[0043] In this embodiment, the priority of the Bluetooth device reflects the priority order for the Bluetooth device to connect with the gateway device via Bluetooth. The higher the priority, the more likely it is to connect with the gateway device via Bluetooth.

[0044] In this embodiment, devices that need to be disconnected are selected based on the priority of connected Bluetooth devices. Compared with randomly selecting devices to disconnect, this is more targeted, reasonably kicking out lower-priority devices and retaining higher-priority devices.

[0045] It should be noted that for disconnected Bluetooth devices, you can wait for the next scan. For example, when the gateway device meets the Bluetooth scanning conditions again, if it scans the disconnected Bluetooth device, it can reconnect to the Bluetooth device using the method described above.

[0046] As an example, a mapping table between Bluetooth devices and their priorities can be configured on the gateway device. This mapping table contains multiple mappings between Bluetooth devices and multiple priorities. Specifically, users can pre-configure the mapping table on the gateway device according to their application scenarios. For example, frequently used Bluetooth devices and their priorities can be set in the mapping table. Alternatively, developers can pre-configure an initial mapping table on the gateway device. The priorities of each Bluetooth device in this mapping table can be flexibly set by developers based on experience according to the application scenarios of the gateway device. Furthermore, this mapping table can be modified by users.

[0047] The above process of obtaining the priority of each connected Bluetooth device may include: determining the priority corresponding to each connected Bluetooth device according to the correspondence table.

[0048] Taking milk tea making as an example, the Bluetooth devices involved include, but are not limited to, at least one of the following: smart tea and coffee machines, smart brewing machines, smart milk foam machines, smart mixers, smart sugar mixers, smart dispensing machines, and automatic fruit processors.

[0049] Users or developers can estimate the usage frequency of each Bluetooth device and assign corresponding priorities to these devices, forming the aforementioned correspondence table, which is then pre-configured in the gateway device. For example, a higher priority can be assigned to Bluetooth devices used more frequently; a higher priority indicates that a Bluetooth connection should be established first.

[0050] It is understandable that, since the priorities of each Bluetooth device are preset, and the working status of each Bluetooth device can change at any time, in order to ensure the accuracy of the priorities, in one embodiment, the correspondence table between Bluetooth devices and priorities can also be updated.

[0051] For example, the working time and / or offline time of each connected Bluetooth device can be obtained; the priority of each connected Bluetooth device in the corresponding relationship table can be adjusted according to the working time and / or offline time of each connected Bluetooth device.

[0052] For example, the priorities of Bluetooth devices in the mapping table can be adjusted to a corresponding descending order based on their working or offline duration. For instance, if Bluetooth device A has a higher priority than Bluetooth device B in the preset mapping table, and as the operation progresses, if the working duration of Bluetooth device B gradually exceeds that of Bluetooth device A, then the priority of Bluetooth device A in the mapping table can be adjusted to be lower than that of Bluetooth device B. Similarly, if Bluetooth device C has a higher priority than Bluetooth device D in the preset mapping table, and the offline duration of Bluetooth device D is greater than that of Bluetooth device C, then the priority of Bluetooth device C in the mapping table can be adjusted to be lower than that of Bluetooth device D.

[0053] It should be noted that the offline duration can be the duration since the Bluetooth device last disconnected from the gateway device. Since the Bluetooth device has limited internal storage space, if it is disconnected from the gateway device for a long time, the storage space will be filled up, resulting in data loss. Therefore, for Bluetooth devices that have been offline for a long time, their priority can be increased to ensure that they can connect to the gateway device as soon as possible.

[0054] For example, priority scores for each Bluetooth device can be calculated based on its working and offline durations and the preset weights corresponding to these two types of information. Then, the priorities of each Bluetooth device in the corresponding relationship table can be adjusted to the corresponding order from high to low based on the priority scores.

[0055] It should be noted that for connected Bluetooth devices, they can obtain their own working or offline time, and then send this information to the gateway device based on the established Bluetooth connection, so that the gateway device can maintain the corresponding relationship table. Of course, the gateway device can also directly calculate the working or offline time of connected Bluetooth devices.

[0056] For Bluetooth devices that have not yet established a Bluetooth connection with the gateway device, they can transmit their online duration, operating frequency, or offline duration to the gateway device through other communication methods. For example, this information can be sent via Wi-Fi (Wireless Fidelity). Of course, this information can also be sent after a Bluetooth connection with the gateway device is established. Alternatively, the gateway device can directly calculate the corresponding online and offline durations based on the Bluetooth device's previous connection history to the gateway.

[0057] For example, before disconnecting the target module from the lowest priority connected Bluetooth device, it can first determine whether the lowest priority among the connected Bluetooth devices is lower than the priority of the Bluetooth device to be connected. If so, that is, when it is determined that the lowest priority among the connected Bluetooth devices is lower than the priority of the Bluetooth device to be connected, then disconnect the target module from the lowest priority connected Bluetooth device. If not, it can then be determined whether the Bluetooth device to be connected can access another Bluetooth module. Specifically, it can be determined whether the number of connected Bluetooth devices of the other Bluetooth module has reached a preset threshold. If not, control the other Bluetooth module to connect to the Bluetooth device to be connected. If so, when it is determined that the lowest priority among the connected Bluetooth devices of the other Bluetooth module is lower than the priority of the Bluetooth device to be connected, control the disconnection of the other Bluetooth module from the lowest priority connected Bluetooth device, and then connect to the Bluetooth device to be connected.

[0058] To facilitate understanding, a specific example is provided here; please refer to [link / reference needed]. Figure 5 As shown, it may include the following sub-steps: Sub-step 1: When multiple Bluetooth modules scan for the Bluetooth device to be connected, obtain the Bluetooth signal strength scanned by each Bluetooth module for the Bluetooth device to be connected.

[0059] Sub-step 2: Sort the Bluetooth signal strengths in descending order, and select the Bluetooth module with the highest ranking as the target module.

[0060] Sub-step 3: Determine whether the number of connected Bluetooth devices to the target module has reached the threshold. If not, directly control the target module to connect to the Bluetooth device to be connected. If yes, proceed to sub-step 4.

[0061] Sub-step four: Determine if there is a device with a lower priority than the Bluetooth device to be connected among the connected Bluetooth devices of the target module. If yes, proceed to sub-step five; otherwise, proceed to sub-step six.

[0062] Sub-step 5: After disconnecting from the lowest priority device among the connected Bluetooth devices of the target Bluetooth module, control the target Bluetooth module to connect to the Bluetooth device to be connected.

[0063] Sub-step six: Select the next Bluetooth module as the new target module according to the signal strength sorting results, and then proceed to sub-step three.

[0064] In some embodiments, to prevent getting stuck in an infinite loop, please refer to [link / reference]. Figure 6 and Figure 7 As shown, it can be determined whether each Bluetooth module is unable to connect to the Bluetooth device to be connected. When all Bluetooth modules that have scanned the Bluetooth device to be connected attempt to connect to the Bluetooth device to be connected but fail to connect, this is used as the final exit condition.

[0065] For example, if the gateway device controls Bluetooth module A to scan for Bluetooth devices to connect to as devices d1, d2, d3, and d4, and Bluetooth module B scans for Bluetooth devices to connect to as devices d3, d4, d5, d6, d7, and d8.

[0066] For devices d1, d2, d5, d6, d7, and d8, since they are only scanned by one of the Bluetooth modules, the corresponding Bluetooth module can be directly used as the target module for Bluetooth connection.

[0067] For D3 and D4 devices, since they are scanned by both modules, a corresponding strategy needs to be selected: If Bluetooth module A detects a Received Signal Strength Indicator (RSSI) of -20dB for device d3, and Bluetooth module B detects a RSSI of -15dB for device d3, then Bluetooth module B will be selected as the target module for device d3 because it has a stronger Bluetooth signal. Device d4 can obtain its corresponding target module in the same way.

[0068] The following explanation uses Bluetooth module B as an example. It is understood that Bluetooth module A can connect to the corresponding Bluetooth device in the same way, which will not be elaborated here.

[0069] If the threshold for Bluetooth module B is 5, when the number of Bluetooth devices currently connected to Bluetooth module B is less than 5, the connection between Bluetooth module B and device d3 is directly controlled. When the number of Bluetooth devices currently connected to Bluetooth module B reaches 5, priority (i.e., weight) is used to further determine whether Bluetooth module B can be connected to device d3.

[0070] Priority strategy: For Bluetooth module B, if device d3 is detected in a new scan, and if Bluetooth module B is already connected to 5 devices, and among these 5 devices there is a device with a lower priority than device d3 (let's say device d6), then Bluetooth module B can be controlled to disconnect from device d6 and then establish a connection with device d3.

[0071] For d6 devices, you can wait for the next scan. Since the positions of each Bluetooth device may change, the connection status of the d6 device will be controlled again according to the above strategy (priority strategy, offline or online priority adjustment strategy) during the next scan.

[0072] It should be noted that when the Bluetooth devices in the pre-set correspondence table in the gateway device completely include the priorities of the connected Bluetooth devices and the devices to be connected in this embodiment, the priority of each connected Bluetooth device and the device to be connected can be determined based on the correspondence table.

[0073] When the pre-set correspondence table in the gateway device does not contain the Bluetooth device to be connected, for example, when the Bluetooth device to be connected is a newly added device in the application scenario, the highest priority can be set for the Bluetooth device to be connected. That is, at this time, the connection between the target module and the lowest priority among the connected Bluetooth devices can be disconnected, and then the target module can be controlled to connect to the Bluetooth device to be connected.

[0074] As another example, the gateway device may not pre-configure the mapping table. Instead, it can automatically generate a mapping table based on the connected Bluetooth devices. This table records the correspondence between each Bluetooth device that has connected to the gateway device and its priority. Similarly, Bluetooth devices with higher priorities have a higher priority order for connecting to the gateway device. Specifically, the gateway device can obtain the working duration and / or offline duration of each connected Bluetooth device, and then determine the priority of each connected Bluetooth device based on the order of their working duration and / or offline duration, recording it in the mapping table. When the priority of each connected Bluetooth device is needed later, the relevant information can be directly retrieved from this mapping table. If the Bluetooth device to be connected is a device that has not been connected to the gateway device before, the highest priority can be set for that device.

[0075] It should be noted that in some other examples, the gateway device may not pre-configure the mapping table, but instead send the mapping table remotely to the gateway device through the server.

[0076] In this embodiment, after establishing a Bluetooth connection with the Bluetooth device to be connected via the corresponding Bluetooth module, the gateway device can receive device data sent by the Bluetooth device to be connected and send the device data to the server. The device data in this embodiment includes, but is not limited to, data related to device operation, such as device operating parameters and operating duration.

[0077] The server can store received device data. For Bluetooth devices that have previously sent data, the server can delete the sent data locally, thus freeing up more storage space. The server can also analyze the device data and, when a Bluetooth device malfunction is detected, generate an alarm message and send it to the user terminal to alert the relevant user.

[0078] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0079] In one embodiment, based on the same inventive concept, a gateway device is provided; please refer to [link to relevant documentation]. Figure 8 As shown, the gateway device is equipped with a first Bluetooth module and a second Bluetooth module. The gateway device also includes a processor 801 and a memory 802. The memory 802 stores a computer program. The processor 801 executes the computer program to implement the steps of the method described above, which will not be repeated here.

[0080] The processor 801 can be an integrated circuit chip with signal processing capabilities. The processor 801 can be a general-purpose processor, including a CPU (Central Processing Unit), an NP (Network Processor), etc.; it can also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.

[0081] The memory 802 may include, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read Only Memory), EPROM (Erasable Programmable Read-Only Memory), and EEPROM (Electrically Erasable Programmable Read Only Memory).

[0082] Those skilled in the art will understand that Figure 8 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 application of the present application. Specific electronic devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0083] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium, such as a floppy disk, optical disk, hard disk, flash memory, USB flash drive, SD (Secure Digital) card, MMC (Multi-Media Card), etc. The computer-readable storage medium stores a computer program, which, when executed by at least one processor, implements the steps of the methods in the above embodiments, which will not be repeated here.

[0084] Based on the same inventive concept, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements any of the methods described above.

[0085] The program code for executing the computer program product of this application can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0086] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.

[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer-readable storage media according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of user-operated steps to be executed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.

[0090] It should be noted that the illustrations provided in this embodiment are only schematic representations of the basic concept of this application. Therefore, the drawings only show components relevant to this application and are not drawn according to the actual number, shape, and size of components in implementation. In actual implementation, the shape, quantity, and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex. The structures, proportions, sizes, etc., shown in the accompanying drawings are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the implementation conditions of this application. Therefore, they have no substantial technical significance. Any modification to the structure, change in the proportional relationship, or adjustment of the size, without affecting the effect and purpose that this application can produce, should still fall within the scope of the technical content disclosed in this application. At the same time, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are only for clarity of description and are not intended to limit the scope of implementation of this application. Changes or adjustments in their relative relationships, without substantially changing the technical content, should also be considered within the scope of implementation of this application.

[0091] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the document does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0092] As illustrated herein, unless the context clearly indicates otherwise, the words “a,” “an,” “an,” and / or “the” do not specifically refer to the singular and may also include the plural. Generally speaking, the terms “comprising” and “including” only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0093] The definitions used herein, such as the terms “having,” “may have,” “comprising,” or “may include,” indicate the presence of the corresponding function, operation, element, etc., and do not limit the presence of one or more other functions, operations, elements, etc. Furthermore, it should be understood that the terms “comprising” or “having” as used herein indicate the presence of the features, figures, steps, operations, elements, components, or combinations thereof described in the specification, without excluding the presence or addition of one or more other features, figures, steps, operations, elements, components, or combinations thereof.

[0094] The prefixes such as "first" and "second" used in this application embodiment are merely for distinguishing different descriptive objects and do not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes used to distinguish descriptive objects in this application embodiment does not constitute a limitation on the described objects. For statements regarding the described objects, please refer to the claims or the context of the embodiments. The use of such prefixes should not constitute unnecessary limitations. Furthermore, in the description of this embodiment, unless otherwise stated, "multiple" means two or more.

[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A Bluetooth connection method, characterized in that, Applied to a gateway device, wherein the gateway device is equipped with multiple Bluetooth modules, the method includes: When the Bluetooth scanning conditions are met, control multiple Bluetooth modules to perform Bluetooth scanning; Based on the Bluetooth scanning results of the multiple Bluetooth modules, each Bluetooth module is controlled to establish a Bluetooth connection with the Bluetooth device it scanned, so as to receive device data sent by each Bluetooth device and transmit the device data to the server.

2. The Bluetooth connection method according to claim 1, characterized in that, The step of controlling each Bluetooth module to establish a Bluetooth connection with its respective scanned Bluetooth device based on the Bluetooth scanning results of the multiple Bluetooth modules includes: For a scanned Bluetooth device to be connected, one Bluetooth module is selected from the plurality of Bluetooth modules as the target module of the Bluetooth device to be connected; Control the target module to connect to the Bluetooth device to be connected.

3. The Bluetooth connection method according to claim 2, characterized in that, The step of determining one Bluetooth module from a plurality of Bluetooth modules as the target module for a scanned Bluetooth device to be connected includes: When multiple Bluetooth modules scan for the Bluetooth device to be connected, the Bluetooth signal strength scanned by each Bluetooth module for the Bluetooth device to be connected is obtained; The target module of the Bluetooth device to be connected is determined based on the strength of each Bluetooth signal.

4. The Bluetooth connection method according to claim 3, characterized in that, The step of determining the target module of the Bluetooth device to be connected based on the strength of each Bluetooth signal includes: Compare the Bluetooth signal strengths described above; Based on the comparison results, the Bluetooth module corresponding to the maximum Bluetooth signal strength is selected as the target module of the Bluetooth device to be connected.

5. The Bluetooth connection method according to any one of claims 2-4, characterized in that, The control of the target module to connect to the Bluetooth device to be connected includes: Determine whether the number of currently connected Bluetooth devices to the target module has reached a threshold; If not, control the target module to connect to the Bluetooth device to be connected; If so, after disconnecting the target module from the connected Bluetooth device, control the target module to connect to the Bluetooth device to be connected.

6. The Bluetooth connection method according to claim 5, characterized in that, The control to disconnect the target module from the connected Bluetooth device includes: Obtain the priority of each of the connected Bluetooth devices; Control the disconnection of the target module from the lowest priority Bluetooth device among the connected devices.

7. The Bluetooth connection method according to claim 6, characterized in that, The gateway device has a mapping table between Bluetooth devices and their priorities. Obtaining the priority of each connected Bluetooth device includes: The priority corresponding to each of the connected Bluetooth devices is determined based on the correspondence table.

8. The Bluetooth connection method according to claim 7, characterized in that, The method further includes: Obtain the working duration and / or offline duration of each of the connected Bluetooth devices; The priority of each connected Bluetooth device in the corresponding relationship table is adjusted according to the working time and / or offline time of each connected Bluetooth device.

9. The Bluetooth connection method according to claim 6, characterized in that, Before the control disconnects the target module from the lowest priority among the connected Bluetooth devices, the method further includes: The lowest priority among the connected Bluetooth devices is determined to be lower than the priority of the Bluetooth device to be connected.

10. A gateway device, characterized in that, The gateway device is equipped with multiple Bluetooth modules, and the gateway device further includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-9.