Connection method and device of proxy equipment, storage medium and electronic equipment

By scanning and judging the signal strength of BLE Mesh network devices in real time and switching agent devices dynamically, the problem of unstable connection signals of terminal devices in the BLE Mesh network is solved, and communication stability is improved.

CN119172865APending Publication Date: 2024-12-20SHANGHAI MXCHIP INFORMATION TECHN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411242299.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the BLE Mesh network, the connection between the terminal device and the proxy device has signal instability problems, resulting in connection timeout and insufficient communication stability, especially when the terminal device moves.

Method used

By scanning the signal strength of the devices in the BLE Mesh network in real time, determining and connecting devices with higher signal strength as target devices or proxy devices, and switching backup devices when the signal strength drops, dynamic update of proxy devices is achieved.

Benefits of technology

It improves the success rate of the agent device connection and the stability of communication during terminal device movement to ensure the sustained and stable signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172865A_ABST
    Figure CN119172865A_ABST
Patent Text Reader

Abstract

The invention provides a proxy device connection method and apparatus, a storage medium and an electronic device. The method comprises the steps of scanning a broadcast of a to-be-connected device in a BLE Mesh network to obtain signal strength; if the signal strength is greater than the standby signal strength threshold, when the terminal device is not connected with the standby device, determining the device to be connected as a target device and connecting the target device; judging whether proxy equipment exists or not; if not, taking the target equipment as proxy equipment; if yes and the signal strength of the proxy device is greater than the proxy signal strength threshold, setting the target device as a standby device; and when monitoring that the signal intensity of the proxy equipment is not greater than the proxy signal intensity threshold, disconnecting the proxy equipment and switching the standby equipment into the proxy equipment. In the scheme, the equipment with the signal strength meeting the requirement is selected and set as the proxy equipment or the standby equipment, and the standby equipment is switched to the proxy equipment when the signal becomes poor, so that the purposes of improving the success rate of connection with the proxy equipment and improving the communication stability in the moving process of the terminal equipment are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Bluetooth Mesh communication control, and in particular to a connection method and device for a proxy device, a storage medium, and an electronic device. Background Art

[0002] In scenarios such as smart homes, commercial building automation, and industrial IoT, BLE Mesh networks, or Bluetooth low energy mesh networks, are particularly suitable. They have the characteristics of high reliability, scalability, and low power consumption, making them an ideal choice for IoT device interconnection. Devices in a BLE Mesh network communicate via Bluetooth broadcasts. When a terminal device (such as a mobile phone) wants to communicate with a device in a BLE Mesh network in order to control it, it needs to directly connect (GATT) to a proxy device (that is, a device that supports proxy), which forwards the message to the corresponding device that needs to be controlled.

[0003] In the prior art, a terminal device directly connects to the first proxy device scanned in the BLE Mesh network. After the connection is successful, the terminal device will continue to use the proxy device until the connection is disconnected and then connect to a new proxy device.

[0004] The first proxy device scanned in the prior art has the problem of connection timeout due to unstable signal, and when the terminal device moves, the signal of the connected proxy device may become worse, and the communication stability is not guaranteed at this time. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a connection method and apparatus for a proxy device, a storage medium, and an electronic device, so as to achieve the purpose of improving the success rate of connecting to the proxy device and improving the stability of communication during the movement of the terminal device.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] An embodiment of the present invention discloses a connection method for a proxy device, which is applied to a terminal device. The method includes:

[0008] Use Bluetooth to scan the broadcast information sent by each connected device in the BLE Mesh network in real time;

[0009] For each of the broadcast information sent by the device to be connected, extract the corresponding signal strength;

[0010] If the signal strength of the device to be connected is greater than a preset backup signal strength threshold, determining whether the terminal device is connected to a backup device;

[0011] If not, determining that the device to be connected is a target device, and connecting to the target device;

[0012] Determining whether the terminal device is provided with a corresponding proxy device;

[0013] If not, setting the target device as the proxy device;

[0014] If so, and the signal strength of the proxy device is greater than a preset proxy signal strength threshold, setting the target device as the backup device;

[0015] The signal strength of the proxy device is monitored, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, the connection with the proxy device is disconnected and the backup device is switched to the proxy device.

[0016] Preferably, the determining whether the terminal device is connected to the backup device includes:

[0017] Obtain the number of devices connected to the BLE Mesh network by the terminal device;

[0018] If the number of devices is less than 2, it is determined that the terminal device is not connected to the backup device.

[0019] Preferably, after setting the target device as the backup device, the method further includes:

[0020] monitoring the signal strength of the backup device;

[0021] When the signal strength of the backup device is less than or equal to the backup signal strength threshold, disconnecting from the backup device.

[0022] Preferably, after connecting to the target device, the method further comprises:

[0023] If the terminal device is provided with a corresponding proxy device, but the signal strength of the proxy device is less than or equal to a preset proxy signal strength threshold, the connection with the proxy device is disconnected and the target device is set as the proxy device.

[0024] Preferably, the method further comprises:

[0025] If the target device is not connected within a preset time, the connection with the target device is terminated.

[0026] Preferably, if the maximum number of devices in the BLE Mesh network that the terminal device can simultaneously connect to is preset to 1, then after extracting the corresponding signal strength for the broadcast information sent by each device to be connected, the method further includes:

[0027] Update the device queue in real time based on the signal strength corresponding to each of the devices to be connected;

[0028] Query the device to be connected with the greatest signal strength in the device queue and determine it as the preferred device;

[0029] Initiate a connection process with the preferred device, and determine whether the connection with the preferred device is successful within a preset time;

[0030] If so, setting the preferred device as a proxy device;

[0031] If not, the preferred device is determined to be a problem device, and the device to be connected with the greatest signal strength other than the problem device is queried from the device queue and determined as the new preferred device, and the process of initiating the connection process with the preferred device is returned to this step.

[0032] Preferably, after setting the preferred device as a proxy device, the method further comprises:

[0033] monitoring the signal strength of the proxy device;

[0034] If the signal strength of the proxy device is less than or equal to the preset proxy signal strength threshold, returning to the step of executing the device to be connected with the largest signal strength in the query device queue and determining it as the preferred device;

[0035] When the connection with the preferred device is successful, the connection with the proxy device is disconnected and the preferred device is set as the proxy device, and the process returns to the step of monitoring the signal strength of the proxy device.

[0036] A second aspect of an embodiment of the present invention discloses a connection device for a proxy device, which is applied to a terminal device. The device includes:

[0037] A scanning unit, used to use Bluetooth to scan in real time the broadcast information sent by each device to be connected in the BLE Mesh network; for each of the broadcast information sent by the device to be connected, extract the corresponding signal strength;

[0038] A first judgment unit, configured to judge whether the terminal device is connected to a backup device if the signal strength of the device to be connected is greater than a preset backup signal strength threshold; if not, determine that the device to be connected is a target device and connect to the target device;

[0039] A second judgment unit is used to judge whether the terminal device is provided with a corresponding proxy device; if not, the target device is set as the proxy device; if so, and the signal strength of the proxy device is greater than a preset proxy signal strength threshold, the target device is set as the backup device;

[0040] The monitoring unit is configured to monitor the signal strength of the proxy device, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, disconnect the proxy device and switch the backup device to the proxy device.

[0041] A third aspect of an embodiment of the present invention discloses a storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the connection method of the proxy device described in any one of the first aspects of the embodiments of the present invention.

[0042] A fourth aspect of an embodiment of the present invention discloses an electronic device, including: a memory and a processor;

[0043] The memory is used to store computer programs;

[0044] The processor is used to execute the computer program, specifically to implement the connection method of the proxy device described in any one of the first aspects of the embodiments of the present invention.

[0045] Based on the above-mentioned embodiment of the present invention, a connection method and device for a proxy device, a storage medium, and an electronic device are provided. Bluetooth is used to scan the broadcast information sent by each device to be connected in a BLE Mesh network in real time; for each of the broadcast information sent by the device to be connected, the corresponding signal strength is extracted; if the signal strength of the device to be connected is greater than a preset backup signal strength threshold, it is determined whether the terminal device is connected to a backup device; if not, it is determined that the device to be connected is a target device and the target device is connected; it is determined whether the terminal device is provided with a corresponding proxy device; if not, the target device is set as the proxy device; if so, and the signal strength of the proxy device is greater than the preset proxy signal strength threshold, the target device is set as the backup device; the signal strength of the proxy device is monitored, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, the connection with the proxy device is disconnected and the backup device is switched to the proxy device. In this scheme, when the signal strength of the device to be connected meets the requirements, it is set as a proxy device or a backup device. When the signal strength of the proxy device deteriorates, the backup device is switched to the proxy device, thereby achieving the purpose of improving the success rate of connecting with the proxy device and improving the stability of communication during the movement of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0047] Figure 1 A flowchart of a connection method for a proxy device disclosed in an embodiment of the present invention;

[0048] Figure 2 A flowchart of another method for connecting a proxy device disclosed in an embodiment of the present invention;

[0049] Figure 3 A structural diagram of a connection device of a proxy device disclosed in an embodiment of the present invention;

[0050] Figure 4 The present invention is a structural diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0053] like Figure 1 FIG. 1 is a flow chart of a connection method for a proxy device disclosed in an embodiment of the present invention, and the method is applied to a terminal device. It should be noted that the terminal device is a terminal device supporting Bluetooth, such as a mobile phone.

[0054] The connection method of the proxy device mainly includes the following steps:

[0055] Step S101: Use Bluetooth to scan in real time the broadcast information sent by each device to be connected in the BLE Mesh network.

[0056] It should be noted that BLE Mesh network, namely Bluetooth Low Energy Mesh Network, is a wireless communication technology that is based on Bluetooth technology but has been extended to support multi-hop communication and more complex network topologies. Compared with traditional Bluetooth technology, the advantage of BLE Mesh is that it can support more devices to connect at the same time, and through multi-hop communication, the signal can be relayed through multiple intermediate devices, thereby expanding the coverage of the signal and reducing the problem of signal attenuation.

[0057] In step S101, in the BLE Mesh network, devices that support proxy are devices to be connected. When the signal strength of these devices meets the requirements, they can be connected to the terminal device as proxy devices.

[0058] It should be noted that the proxy device is used to receive messages from the terminal device and forward them to other devices in the BLE Mesh network, or receive messages from other devices in the BLE Mesh network and forward them to the terminal device.

[0059] In one embodiment, the broadcast information obtained by Bluetooth scanning needs to be subjected to multiple layers of verification to verify whether the broadcast information comes from the device to be connected in the BLE Mesh network.

[0060] Specifically, it first verifies whether the specified content in the proxy broadcast is consistent with the data encrypted by the networkkey of the BLE Mesh network. Then it compares the mac address in the broadcast information with the mac address of the device (node) in the BLE Mesh network information.

[0061] Step S102: extracting the corresponding signal strength for each broadcast information sent by the device to be connected.

[0062] In step S102, the device to be connected will send out a proxy broadcast (service uuid is 1828), so that after the terminal device obtains the Bluetooth scan, the terminal device can know the signal strength of the device to be connected according to the scanned broadcast.

[0063] Step S103: If the signal strength of the device to be connected is greater than the preset backup signal strength threshold, determine whether the terminal device is connected to the backup device; if not, execute step S104.

[0064] It can be understood that if the signal strength of the device to be connected is less than or equal to the preset standby signal strength threshold, it can be determined that the connection requirement is not met and subsequent connection will not be performed.

[0065] The preset standby signal strength threshold may be 75 dBm.

[0066] In step S103, both the backup device and the proxy device are connected to the terminal device, and the two cooperate with each other. When the proxy device signal deteriorates, the current proxy device is disconnected and the backup device is switched to the proxy device, so as to realize the senseless switching of the proxy device and avoid the situation of signal disconnection. The backup device can also take on the sending of some messages for the proxy device.

[0067] It is understandable that when a terminal device has a backup device connected to it, there must also be a proxy device connected to it. Therefore, it is possible to determine whether the terminal device is connected to a backup device by the number of devices currently connected to the terminal device. The details are as follows:

[0068] Get the number of devices connected to the terminal device in the BLE Mesh network. If the number of devices is less than 2, it is determined that the terminal device is not connected to the backup device.

[0069] That is, when the number of devices is less than 2, the terminal device can only be connected to a proxy device, or there is no connected device.

[0070] Step S104: Determine that the device to be connected is a target device, and connect to the target device.

[0071] In step S104, if the target device is not successfully connected within a preset time (eg, two seconds), the target device is determined to be a problematic device, and the connection with the target device is stopped.

[0072] Step S105: Determine whether the terminal device is equipped with a corresponding proxy device; if not, execute step S106; if so, execute step S107.

[0073] In the specific implementation process of step S105, the number of devices in the BLE Mesh network to which the terminal device is currently connected is obtained. If the number of devices is equal to 1, it is determined that the terminal device is connected and a corresponding proxy device is set.

[0074] Step S106: Setting the target device as a proxy device.

[0075] Step S107: Determine whether the signal strength of the proxy device is greater than a preset proxy signal strength threshold; if so, execute step S108; if not, execute step S109.

[0076] In step S107, the devices in the BLE Mesh network that have established a connection with the terminal device can directly read the Bluetooth signal strength.

[0077] The proxy signal strength threshold needs to be greater than or equal to the standby signal strength threshold. For example, if the standby signal strength threshold is 75 dBm, the proxy signal strength threshold may be 80 dBm.

[0078] Step S108: setting the target device as a standby device and monitoring the signal strength of the proxy device; when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, disconnecting the proxy device and switching the standby device to the proxy device.

[0079] In step S108, the signal strength of the proxy device may be detected once at a preset time interval (eg, 5 seconds).

[0080] It should be noted that disconnecting the original proxy device with poor signal and switching the standby device to the new proxy device are performed simultaneously to achieve seamless switching and prevent signal interruption.

[0081] In one embodiment, after the target device is set as a standby device, the signal strength of the standby device is monitored; when the signal strength of the standby device is less than or equal to a standby signal strength threshold, the connection with the standby device is disconnected.

[0082] It is understandable that as long as there is a corresponding backup device for the terminal device, the signal strength of the backup device will be monitored. When the signal strength of the backup device signal is less than or equal to the backup signal strength threshold, it is determined that it does not meet the conditions to serve as a proxy device and the connection is disconnected in time.

[0083] Specifically, the signal strength of the backup device may be detected once at a preset time interval (eg, 5 seconds).

[0084] In another embodiment, since the connection will be disconnected when the signal strength of the backup device is less than or equal to the backup signal strength threshold, there is a situation where the terminal device has been disconnected from the backup device before detecting that the signal strength of the proxy device is less than or equal to the proxy signal strength threshold. At this time, the operation of switching from the backup device to the proxy device cannot be completed. At this time, the connection with the proxy device is still maintained until the proxy device update is completed through steps S101 to S106.

[0085] Step S109: disconnecting the proxy device and setting the target device as the proxy device.

[0086] In step S109, since the current proxy device signal strength is relatively poor, the target device is directly set as a proxy device without setting the target device as a backup device first.

[0087] In one embodiment, the terminal device may be provided with multiple backup devices. When the proxy device signal strength is less than or equal to the proxy signal strength threshold, a backup device is randomly selected and switched to the proxy device and the original proxy device is disconnected.

[0088] It should be noted that due to the limitations of the Bluetooth performance of terminal devices and the number of connections, it is not recommended to connect too many devices as backup devices. If Bluetooth performance is the highest priority, only one backup device is required.

[0089] Based on the connection method of a proxy device disclosed in the above embodiment of the present invention, in this scheme, when the signal strength of the device to be connected meets the requirements, it is set as a proxy device or a backup device. When the signal strength of the proxy device deteriorates, the backup device is switched to the proxy device, thereby achieving the purpose of improving the success rate of connecting with the proxy device and improving the stability of communication during the movement of the terminal device.

[0090] Based on the above embodiment of the present invention, a connection method of a proxy device is disclosed, such as Figure 2 As shown, it is a flowchart of another connection method of a proxy device disclosed in an embodiment of the present invention, which is applied to a terminal device that pre-sets the maximum number of devices that can be connected to the BLE Mesh network at the same time as 1, and includes the following steps:

[0091] Step S201: Use Bluetooth to scan in real time the broadcast information sent by each device to be connected in the BLE Mesh network.

[0092] Step S202: extracting the corresponding signal strength for each broadcast information sent by the device to be connected.

[0093] It should be noted that the specific implementation process of steps S201 to S202 can be found in the above-mentioned embodiment of the present invention, which will not be described again here.

[0094] Step S203: updating the device queue in real time based on the signal strength corresponding to each device to be connected.

[0095] It should be noted that if the terminal device has just turned on Bluetooth, it is necessary to wait for the device queue to be updated (for example, wait for 3 seconds) so that there are enough devices to be connected and their corresponding signal strengths in the device queue before executing the subsequent connection process.

[0096] Preferably, it is determined whether the signal strength of the scanned device to be connected is greater than the proxy signal strength threshold (e.g., 80dBm). If so, the device queue is updated based on the device to be connected and its corresponding signal strength, thereby ensuring that the device to be connected in the device queue at least meets normal communication requirements.

[0097] Step S204: query the device queue for the device to be connected with the greatest signal strength and determine it as the preferred device.

[0098] Step S205: Initiate a connection process with the preferred device and determine whether the connection with the preferred device is successful within a preset time. If yes, execute step S206; if no, execute step S207.

[0099] Step S206: Setting the preferred device as a proxy device.

[0100] Preferably, after the preferred device is set as the proxy device, the signal strength of the proxy device is monitored, and if the signal strength of the proxy device is less than or equal to a preset proxy signal strength threshold (eg, 80 dBm), the process returns to step S204.

[0101] When the connection with the preferred device is successful, the connection with the current proxy device is disconnected and the preferred device is set as the new proxy device, and the signal strength of the proxy device is returned to be monitored continuously.

[0102] Step S207: Determine that the preferred device is the problem device, query the device queue for a device to be connected with the greatest signal strength other than the problem device, and determine it as the new preferred device, and return to execute step S205.

[0103] Based on the connection method of a proxy device disclosed in the above-mentioned embodiment of the present invention, in this scheme, a device with the largest signal strength is selected from a real-time updated device queue as a proxy device, and when the signal strength of the proxy device deteriorates, it returns to reselect the device with the largest signal strength as the proxy device, thereby achieving the purpose of improving the success rate of connecting with the proxy device and improving the stability of communication during the movement of the terminal device.

[0104] Based on the above embodiment of the present invention, a connection method of a proxy device is disclosed, such as Figure 3 , which is a structural diagram of a connection device of a proxy device disclosed in an embodiment of the present invention, the device is applied to a terminal device and includes: a scanning unit 301 , a first judgment unit 302 , a second judgment unit 303 and a monitoring unit 304 .

[0105] The scanning unit 301 is used to use Bluetooth to scan the broadcast information sent by each device to be connected in the BLE Mesh network in real time; for each broadcast information sent by the device to be connected, the corresponding signal strength is extracted.

[0106] The first judgment unit 302 is used to judge whether the terminal device is connected to the backup device if the signal strength of the device to be connected is greater than a preset backup signal strength threshold; if not, determine that the device to be connected is the target device and connect to the target device.

[0107] Preferably, the first determination unit 302 for determining whether the terminal device is connected to the backup device is specifically configured to:

[0108] Get the number of devices connected to the BLE Mesh network by the terminal device;

[0109] If the number of devices is less than 2, it is determined that the terminal device is not connected to the backup device.

[0110] The second judgment unit 303 is used to judge whether the terminal device is equipped with a corresponding proxy device; if not, the target device is set as a proxy device; if yes, and the signal strength of the proxy device is greater than a preset proxy signal strength threshold, the target device is set as a backup device.

[0111] The monitoring unit 304 is configured to monitor the signal strength of the proxy device, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, disconnect the proxy device and switch the standby device to the proxy device.

[0112] Preferably, the connection device of the proxy device further includes:

[0113] The standby device monitoring unit is used to monitor the signal strength of the standby device after setting the target device as the standby device, and disconnect the standby device when the signal strength of the standby device is less than or equal to the standby signal strength threshold.

[0114] Preferably, the connection device of the proxy device further includes:

[0115] The replacement unit is used to disconnect the connection with the proxy device and set the target device as the proxy device after connecting to the target device if the terminal device is provided with a corresponding proxy device but the signal strength of the proxy device is less than or equal to a preset proxy signal strength threshold.

[0116] Preferably, the connection device of the proxy device further includes:

[0117] The pausing unit is used to stop connecting to the target device if the target device is not connected for a preset time.

[0118] Preferably, the connection device of the proxy device further includes:

[0119] There is no backup connection unit, which is used for, if the maximum number of devices that the terminal device can simultaneously connect to the BLE Mesh network is pre-set to 1, then after extracting the corresponding signal strength from the broadcast information sent by each device to be connected, the device queue is updated in real time based on the signal strength corresponding to each device to be connected; the device to be connected with the largest signal strength in the device queue is queried and determined as the preferred device; the connection process with the preferred device is initiated, and it is determined whether the connection with the preferred device is successful within a preset time; if so, the preferred device is set as a proxy device; if not, the preferred device is determined to be a problem device, and the device to be connected with the largest signal strength other than the problem device is queried from the device queue, and is determined as the new preferred device, and the execution of the connection process with the preferred device is returned.

[0120] Preferably, the connection device of the proxy device further includes:

[0121] The proxy device monitoring unit is used to monitor the signal strength of the proxy device after setting the preferred device as the proxy device; if the signal strength of the proxy device is less than or equal to a preset proxy signal strength threshold, return to query the device to be connected with the largest signal strength in the device queue and determine it as the preferred device; when the connection with the preferred device is successful, disconnect the proxy device and set the preferred device as the proxy device, and return to monitor the signal strength of the proxy device.

[0122] Based on the above-mentioned embodiment of the present invention, a connection device for a proxy device is disclosed. In this solution, when the signal strength of the device to be connected meets the requirements, it is set as a proxy device or a backup device. When the signal strength of the proxy device deteriorates, the backup device is switched to the proxy device, thereby achieving the purpose of improving the success rate of connecting with the proxy device and improving the stability of communication during the movement of the terminal device.

[0123] The present invention also provides an electronic device, please refer to Figure 4 , the electronic device includes a memory 401 and a processor 402.

[0124] Wherein, the memory 401 is used to store computer programs;

[0125] The processor 402 is used to execute a computer program, specifically to implement the connection method of the proxy device provided in any embodiment of the present application.

[0126] The present application also provides a computer storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the connection method of the proxy device provided in any embodiment of the present application.

[0127] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0128] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0129] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A connection method for a proxy device, It is characterized in that Applied to a terminal device, the method comprises: Use Bluetooth to scan the broadcast information sent by each connected device in the BLE Mesh network in real time; For each of the broadcast information sent by the device to be connected, extract the corresponding signal strength; If the signal strength of the device to be connected is greater than a preset backup signal strength threshold, determining whether the terminal device is connected to a backup device; If not, determining that the device to be connected is a target device, and connecting to the target device; Determining whether the terminal device is provided with a corresponding proxy device; If not, setting the target device as the proxy device; If so, and the signal strength of the proxy device is greater than a preset proxy signal strength threshold, setting the target device as the backup device; The signal strength of the proxy device is monitored, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, the connection with the proxy device is disconnected and the backup device is switched to the proxy device.

2. The method according to claim 1, It is characterized in that The determining whether the terminal device is connected to the backup device includes: Obtain the number of devices connected to the BLE Mesh network by the terminal device; If the number of devices is less than 2, it is determined that the terminal device is not connected to the backup device.

3. The method according to claim 1, It is characterized in that After setting the target device as the backup device, the method further includes: monitoring the signal strength of the backup device; When the signal strength of the backup device is less than or equal to the backup signal strength threshold, disconnecting from the backup device.

4. The method according to claim 1, It is characterized in that After connecting the target device, the method further includes: If the terminal device is provided with a corresponding proxy device, but the signal strength of the proxy device is less than or equal to a preset proxy signal strength threshold, the connection with the proxy device is disconnected and the target device is set as the proxy device.

5. The method according to claim 1, It is characterized in that The method further comprises: If the target device is not connected within a preset time, the connection with the target device is terminated.

6. The method according to claim 1, It is characterized in that If the maximum number of devices in the BLE Mesh network that the terminal device can simultaneously connect to is preset to 1, then after extracting the corresponding signal strength for the broadcast information sent by each device to be connected, the method further includes: Update the device queue in real time based on the signal strength corresponding to each of the devices to be connected; Query the device to be connected with the greatest signal strength in the device queue and determine it as the preferred device; Initiate a connection process with the preferred device, and determine whether the connection with the preferred device is successful within a preset time; If so, setting the preferred device as a proxy device; If not, the preferred device is determined to be a problem device, and the device to be connected with the greatest signal strength other than the problem device is queried from the device queue and determined as the new preferred device, and the process of initiating the connection process with the preferred device is returned to this step.

7. The method according to claim 6, It is characterized in that After setting the preferred device as a proxy device, the method further includes: monitoring the signal strength of the proxy device; If the signal strength of the proxy device is less than or equal to the preset proxy signal strength threshold, returning to the step of executing the device to be connected with the largest signal strength in the query device queue and determining it as the preferred device; When the connection with the preferred device is successful, the connection with the proxy device is disconnected and the preferred device is set as the proxy device, and the process returns to the step of monitoring the signal strength of the proxy device.

8. A connection device for a proxy device, It is characterized in that Applied to a terminal device, the device comprises: A scanning unit, used to use Bluetooth to scan in real time the broadcast information sent by each device to be connected in the BLE Mesh network; for each of the broadcast information sent by the device to be connected, extract the corresponding signal strength; A first judgment unit, configured to judge whether the terminal device is connected to a backup device if the signal strength of the device to be connected is greater than a preset backup signal strength threshold; if not, determine that the device to be connected is a target device and connect to the target device; A second judgment unit is used to judge whether the terminal device is provided with a corresponding proxy device; if not, the target device is set as the proxy device; if so, and the signal strength of the proxy device is greater than a preset proxy signal strength threshold, the target device is set as the backup device; The monitoring unit is configured to monitor the signal strength of the proxy device, and when the signal strength of the proxy device is less than or equal to the proxy signal strength threshold, disconnect the proxy device and switch the backup device to the proxy device.

9. A storage medium, It is characterized in that Used to store a computer program, which, when executed, is specifically used to implement the connection method for the proxy device according to any one of claims 1 to 7.

10. An electronic device, It is characterized in that include: Memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program, specifically to implement the connection method of the proxy device according to any one of claims 1 to 7.