Control method and system of BLE intelligent equipment

Through the long connection and heartbeat mechanism between terminals and servers, multi-terminal and remote control of BLE smart devices is realized, solving the control limits of BLE smart devices under gateway-free devices, reducing user costs and improving user experience, while ensuring the system security.

CN119136334APending Publication Date: 2024-12-13HANGZHOU TUYA INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411129781.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

BLE smart devices can only be controlled locally without gateway devices and do not support multi-terminal connections and remote control, resulting in users needing to purchase expensive gateway devices to achieve remote control.

Method used

A long connection is established with the BLE smart device and the server through a certain terminal, and other terminals forward control instructions through the server to realize multi-terminal and remote control of the BLE smart device, and use a heartbeat mechanism to monitor the online status to ensure system security.

Benefits of technology

Implement multi-terminal and remote control of BLE smart devices without gateway devices, reduce user costs, improve user experience, and ensure system security and online status monitoring through security design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136334A_ABST
    Figure CN119136334A_ABST
Patent Text Reader

Abstract

The invention relates to a BLE intelligent device control method and system, and the method is applied to a first terminal, and comprises the steps: building a long connection with a server; sending a query request to the server to query a second terminal directly connected with the BLE intelligent device; in response to existence of a second terminal directly connected with the BLE intelligent equipment, sending a control instruction for the BLE intelligent equipment to the server; and receiving a response which is forwarded by the second terminal and the server, comes from the BLE intelligent equipment and is used for the control instruction. According to the control method and system of the BLE intelligent device, the BLE intelligent device is controlled in the mode that a certain terminal is directly connected with the BLE intelligent device and the server side, and other terminals conduct forwarding through the server side, so that multi-terminal control and remote control over the BLE intelligent device are achieved under the condition that no gateway device exists, and the control efficiency of the BLE intelligent device is improved. The cost of using intelligent equipment by a user is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and in particular to a control method and system for a BLE smart device. Background Art

[0002] At present, Bluetooth Low Energy (BLE) protocol smart devices (referred to as "BLE smart devices" in this application) usually only support one terminal connection at the same time without a gateway device. For example, if the smart device is a door lock, after terminal A connects to the door lock, terminal B cannot connect to control the door lock. In addition, without a gateway device, BLE smart devices do not support remote control and can only be controlled locally.

[0003] If you want to remotely control BLE smart devices, you need a gateway device. However, gateway devices are often expensive, and most users with smart devices do not buy gateway devices.

[0004] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present application provides a solution for remote and multi-terminal control of BLE smart devices without a gateway.

[0006] According to a first aspect of the present application, a control method for a BLE smart device is provided, which is applied to a first terminal and is characterized by comprising:

[0007] Establish a long connection with the server;

[0008] Sending a query request to the server to query a second terminal directly connected to the BLE smart device;

[0009] In response to the presence of a second terminal directly connected to the BLE smart device, sending a control instruction for the BLE smart device to the server; and

[0010] A response to the control instruction from the BLE smart device is received and forwarded via the second terminal and the server.

[0011] According to a second aspect of the present application, a control method for a BLE smart device is provided, which is applied to a second terminal and is characterized by comprising:

[0012] Receiving a query instruction from the server through a long connection with the server, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device;

[0013] Sending a query response to the server according to the direct connection status with the BLE smart device;

[0014] Receiving a control instruction for the BLE smart device from the first terminal and forwarded by the server;

[0015] Sending the control instruction to the BLE smart device;

[0016] receiving a response to the control instruction from the BLE smart device; and

[0017] The response is sent to the server, so that the first terminal obtains the response via the server.

[0018] According to a third aspect of the present application, a control method for a BLE smart device is provided, which is applied to a server and is characterized by comprising:

[0019] Establishing a long connection with the first terminal;

[0020] Receiving a query request from the first terminal, the query request being used to request a query of a second terminal directly connected to the BLE smart device;

[0021] Sending a query instruction to the second terminal through a long connection with the second terminal, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device;

[0022] receiving a query response from the second terminal;

[0023] sending the query response to the first terminal through a persistent connection with the first terminal;

[0024] Receiving a control instruction for the BLE smart device from the first terminal;

[0025] When the second terminal is directly connected to the BLE smart device, sending the control instruction to the second terminal, so that the second terminal sends the control instruction to the BLE smart device;

[0026] receiving a response to the control instruction from the BLE smart device and forwarded via the second terminal; and

[0027] The response is sent to the first terminal.

[0028] According to a fourth aspect of the present application, a control system for a BLE smart device is provided, characterized in that it includes:

[0029] A first terminal, configured to execute the method according to the first aspect;

[0030] A second terminal, configured to execute the method according to the second aspect; and

[0031] The server is used to execute the method as described in the third aspect.

[0032] According to a fifth aspect of the present application, there is provided an electronic device, including:

[0033] Processor; and

[0034] A memory storing computer instructions, which, when executed by the processor, causes the processor to execute the methods described in the first aspect to the third aspect.

[0035] According to the sixth aspect of the present application, a non-transitory computer storage medium is provided, storing a computer program, which, when executed by multiple processors, enables the processors to execute the methods described in the first aspect to the third aspect.

[0036] According to the control method and system of BLE smart devices provided in the present application, a terminal is directly connected to the BLE smart device and the server, and other terminals are forwarded by the server to control the BLE smart device. In this way, multi-terminal control and remote control of the BLE smart device can be achieved without a gateway device, thereby reducing the cost of users using smart devices and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without exceeding the scope of protection required by the present application.

[0038] Figure 1 It is a flowchart of a control system of a BLE smart device according to an embodiment of the present application.

[0039] Figure 2 It is a flowchart of a control system of a BLE smart device according to another embodiment of the present application.

[0040] Figure 3 It is a flowchart of a method for controlling a BLE smart device implemented via a terminal that is not directly connected to the BLE smart device according to an embodiment of the present application.

[0041] Figure 4It is a flowchart of a method for controlling a BLE smart device implemented via a terminal that is not directly connected to the BLE smart device according to another embodiment of the present application.

[0042] Figure 5 It is a flowchart of a method for controlling a BLE smart device implemented via a terminal directly connected to the BLE smart device according to an embodiment of the present application.

[0043] Figure 6 It is a flowchart of a method for controlling a BLE smart device implemented via a terminal directly connected to the BLE smart device according to another embodiment of the present application.

[0044] Figure 7 It is a flowchart of a method for controlling a BLE smart device implemented by a server according to an embodiment of the present application.

[0045] Figure 8 It is a flowchart of a method for controlling a BLE smart device implemented via a server according to another embodiment of the present application.

[0046] Fig. 9 It is a structural diagram of an electronic device provided by this application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0048] Figure 1 FIG. 1 is a flow chart of a control system of a BLE smart device according to an embodiment of the present application. Figure 1 As shown, the system includes a BLE smart device, a server, and a terminal that is not directly connected to the BLE smart device (corresponding to Figure 1 "Terminal B" in the BLE smart device) and the terminal directly connected to the BLE smart device (corresponding to Figure 1 According to some embodiments, the BLE smart device is a smart device using the BLE protocol, which may include smart door locks, temperature and humidity sensors, smart switches, smart lights, and other devices; the server may use various suitable servers, such as cloud servers; the terminal A and the terminal B may include mobile phones, tablets, notebooks, and other terminals. This application does not impose any restrictions on the specific device forms and versions of the BLE smart device, server, terminal A, and terminal B.

[0049] Comparison Figure 1 In the embodiment shown, the workflow of the control system includes:

[0050] 1. Terminal A establishes a long connection with the server.

[0051] According to some embodiments, the protocols used by the long connection at the transport layer include TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), and the MQTT (Message Queuing Telemetry Transport) protocol and other suitable protocols may be used at the application layer, and this application does not impose any restrictions on this. Figure 1 As shown, terminal A establishes a connection with the server through the TCP protocol to ensure that both parties can communicate.

[0052] 2. Terminal A and the BLE smart device establish a BLE connection.

[0053] Terminal A establishes a connection with the Bluetooth Low Energy (BLE) smart device through the BLE protocol to control the BLE smart device.

[0054] 3. The user of terminal B opens the corresponding application (App) and prepares to operate and control the BLE smart device.

[0055] 4. Terminal B establishes a long connection with the server.

[0056] As mentioned above, the protocols used by the long connection at the transport layer include TCP and / or UDP, and the MQTT (Message Queuing Telemetry Transport) protocol and other suitable protocols can be used at the application layer, and this application does not impose any restrictions on this. Figure 1 As shown, terminal B establishes a connection with the server through the TCP protocol to ensure that both parties can communicate.

[0057] 5. Terminal B sends a query request to the server to query the online terminal that has established a direct connection with the BLE smart device.

[0058] 6. The server pushes instructions to terminal A.

[0059] The server pushes the command to terminal A and asks it for its online status, that is, whether it is directly connected to the BLE smart device.

[0060] 7. Terminal A replies the online status to the server.

[0061] After receiving the instruction from the server, terminal A replies with its current online status, and the reply content includes online and offline.

[0062] 8. The server pushes the online instruction to terminal B.

[0063] If terminal A is online, the server pushes the online status information of terminal A to terminal B.

[0064] 9. Terminal B sends control instructions to the server.

[0065] After confirming that there is a terminal directly connected to the BLE smart device, terminal B decides to control the BLE smart device and sends the control command to the server.

[0066] 10. The server pushes the control command to terminal A.

[0067] After receiving the control instruction from terminal B, the server forwards the instruction to terminal A.

[0068] 11. Terminal A sends the control command to the BLE smart device:

[0069] After receiving the command from the server, terminal A sends the control command to the BLE smart device through the BLE connection.

[0070] 12. The BLE smart device reports the response to the control command to terminal A:

[0071] After executing the control command, the BLE smart device generates a response and reports it to terminal A.

[0072] 13. Terminal A reports the response to the server.

[0073] After receiving the response from the BLE smart device, terminal A reports the response to the server through the TCP connection.

[0074] 14. The server pushes a response to terminal B.

[0075] After receiving the control response from terminal A, the server pushes the response to terminal B.

[0076] After terminal B learns about terminal A that is directly connected to the BLE smart device through the server, it forwards the control instructions for the BLE smart device through terminal A. However, if terminal B does not monitor the online status of terminal A, if terminal A changes from an online state to an offline state due to some reasons (for example, network disconnection, user killing the process), terminal B may need to receive a timeout message to discover it. If terminal B can monitor the online status of terminal A, it can effectively prevent the situation where terminal A accidentally goes offline and cannot be detected in time. To this end, the present application also provides a heartbeat mechanism to facilitate terminal B to monitor the online status of terminal A in real time.

[0077] Figure 2This is a flowchart of a control system of a BLE smart device according to another embodiment of the present application. 1. Terminal A establishes a long connection with the server.

[0078] According to some embodiments, the protocols used by the long connection at the transport layer include TCP and / or UDP, and the MQTT protocol and other suitable protocols may be used at the application layer, and this application does not impose any restrictions on this. Figure 1 As shown, terminal A establishes a connection with the server through the TCP protocol to ensure that both parties can communicate.

[0079] 2. Terminal A and the BLE smart device establish a BLE connection.

[0080] Terminal A establishes a connection with the Bluetooth Low Energy (BLE) smart device through the BLE protocol to control the BLE smart device.

[0081] 3. Terminal B establishes a long connection with the server.

[0082] As mentioned above, the protocols used by the long connection at the transport layer include TCP and / or UDP, and the MQTT (Message Queuing Telemetry Transport) protocol and other suitable protocols can be used at the application layer, and this application does not impose any restrictions on this. Figure 1 As shown, terminal B establishes a connection with the server through the TCP protocol to ensure that both parties can communicate.

[0083] 4. Terminal B sends a query request to the server to query the online terminal that has established a direct connection with the BLE smart device.

[0084] 5. The server pushes instructions to terminal A.

[0085] The server pushes the command to terminal A and asks it for its online status, that is, whether it is directly connected to the BLE smart device.

[0086] 6. Terminal A replies the online status to the server.

[0087] After receiving the instruction from the server, terminal A replies with its current online status, and the reply content includes online and offline.

[0088] 7. The server pushes the online instruction to terminal B.

[0089] If terminal A is online, the server pushes the online status information of terminal A to terminal B.

[0090] 8. Terminal B starts the heartbeat signal timer:

[0091] After receiving the online notification from terminal A, terminal B starts a heartbeat signal timer. The timer is used to monitor the reception of the heartbeat signal. If the heartbeat signal is not received within the preset time, terminal B will consider terminal A to be offline.

[0092] 9. Terminal A pushes heartbeat to the server.

[0093] Terminal A periodically sends heartbeat signals to the server to indicate that it is online.

[0094] 10. The server pushes the heartbeat signal to terminal B.

[0095] After receiving the heartbeat signal from terminal A, the server forwards the signal to terminal B.

[0096] 11. Terminal B resets the heartbeat signal timer.

[0097] After receiving the heartbeat signal, terminal B will reset the heartbeat timer and start the time again. In this way, if terminal A continues to stay online, terminal B can periodically receive the heartbeat signal and continuously reset the timer.

[0098] 12. The cycle of the heartbeat mechanism.

[0099] This process will continue to cycle to ensure that the online status of terminal A is continuously monitored. If terminal B does not receive a heartbeat signal within a cycle and the heartbeat timer times out, terminal B will determine that terminal A is offline and take corresponding measures. The measures taken include, for example, sending a query request to the server again to query the terminal directly connected to the BLE smart device.

[0100] In addition, in order to ensure the security of the entire system, this application can also introduce the following security designs:

[0101] Design 1: Communication within the same security domain

[0102] In the case of 1 and Figure 2 In the illustrated embodiment, terminal A and terminal B are placed in the same security domain to communicate with each other, ensuring that only authorized terminals can participate in the communication.

[0103] Design 2: TLS encryption

[0104] All data transmitted through the TCP channel is encrypted based on TLS (Transport Layer Security), establishing a secure TLS encrypted session to prevent data from being eavesdropped or tampered with during transmission.

[0105] Design 3: End-to-end encryption

[0106] The transmitted content is also end-to-end encrypted. A shared symmetric key exists in the same security domain, and encryption such as AES / GCM is performed using the symmetric key to ensure that the data cannot be cracked even if it is intercepted during transmission.

[0107] Design 4: Authentication and Authorization

[0108] Each terminal is authenticated before accessing the system to ensure that only legitimate terminals can access the system. At the same time, the communication and operation between terminals are also carried out in the same security domain, and terminals in different security domains cannot communicate.

[0109] Through the above process and design, this application achieves the goal of remote, multi-terminal control of BLE smart devices without a gateway, while ensuring the security of the system and real-time monitoring of the terminal's online status.

[0110] exist Figure 1 and Figure 2 Based on the system shown, according to one aspect of the present application, a method for controlling a BLE smart device is provided. Figure 3 1 is a flow chart of a method for controlling a BLE smart device implemented by a terminal that is not directly connected to the BLE smart device (first terminal) according to an embodiment of the present application. Figure 3 As shown, the method includes the following steps.

[0111] Step S301, establishing a long connection with the server;

[0112] Step S302, sending a query request to the server to query a second terminal directly connected to the BLE smart device;

[0113] Step S303, in response to the existence of a second terminal directly connected to the BLE smart device, sending a control instruction for the BLE smart device to the server; and

[0114] Step S304: receiving a response to the control instruction from the BLE smart device forwarded via the second terminal and the server.

[0115] exist Figure 1 In the embodiment shown, terminal B first establishes a long connection with the server, and then sends a query request to the server to request to query the online terminal that is directly connected to the BLE smart device. After the query, the server informs terminal B that there is an online terminal A that is directly connected to the BLE smart device. Terminal B sends a control instruction to the server, the server pushes the control instruction to terminal A, terminal A sends the control instruction to the BLE smart device, and after the BLE smart device executes the control instruction, it generates a response and reports it to terminal A, terminal A reports the response to the server, and finally, the server pushes the response to terminal B.

[0116] Figure 4 1 is a flow chart of a method for controlling a BLE smart device implemented by a terminal that is not directly connected to the BLE smart device (first terminal) according to another embodiment of the present application. Figure 3 compared to, Figure 4 Steps S401 to S404 in the method are Figure 3 Steps S301 to S304 are similar, except that: Figure 4 The method shown also includes:

[0117] Step S405, in response to the existence of a second terminal directly connected to the BLE smart device, starting a heartbeat signal timer;

[0118] Step S406, monitoring the heartbeat signal from the second terminal and forwarded by the server through the heartbeat signal timer; and

[0119] Step S407: Determine whether the second terminal is online by monitoring whether the heartbeat signal is received within a preset time.

[0120] exist Figure 2 In the embodiment shown, after receiving the online notification from terminal A, terminal B starts a heartbeat signal timer, which is used to monitor the reception of the heartbeat signal. If the heartbeat signal is not received within a preset time, terminal B will consider that terminal A is offline.

[0121] Terminal A periodically sends a heartbeat signal to the server to indicate that it is online. After receiving the heartbeat signal from terminal A, the server forwards the signal to terminal B. After receiving the heartbeat signal, terminal B resets the heartbeat timer and restarts the timing. In this way, if terminal A continues to stay online, terminal B can periodically receive the heartbeat signal and continuously reset the timer. This process will continue to cycle to ensure that the online status of terminal A is continuously monitored. If terminal B does not receive a heartbeat signal within a cycle, the heartbeat timer times out, and terminal B will determine that terminal A is offline and take appropriate measures.

[0122] Figure 5 1 is a flow chart of a method for controlling a BLE smart device implemented by a terminal (second terminal) directly connected to the BLE smart device according to an embodiment of the present application. Figure 5 As shown, the method includes:

[0123] Step S501, receiving a query instruction from the server through a long connection with the server, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device;

[0124] Step S502, sending a query response to the server according to the direct connection status with the BLE smart device;

[0125] Step S503, receiving a control instruction for the BLE smart device from the first terminal and forwarded by the server;

[0126] Step S504, sending the control instruction to the BLE smart device;

[0127] Step S505, receiving a response to the control instruction from the BLE smart device; and

[0128] Step S506: Send the response to the server, so that the first terminal obtains the response via the server.

[0129] exist Figure 1 In the illustrated embodiment, terminal A establishes a long connection with the server and a BLE connection with the BLE smart device. After establishing a long connection with the server, terminal B sends a query request to the server to request to query the online direct connection terminal that is directly connected to the BLE smart device. The server pushes the instruction to terminal A and asks its online status, that is, whether it is in a direct connection state with the BLE smart device. After receiving the instruction from the server, terminal A replies to its current online status, and the content of the reply includes online and offline. If terminal A is online, the server pushes the online status information of terminal A to terminal B. After confirming that there is a terminal directly connected to the BLE smart device, terminal B decides to control the BLE smart device and sends the control instruction to the server. After receiving the control instruction from terminal B, the server forwards the instruction to terminal A. After receiving the instruction from the server, terminal A sends the control instruction to the BLE smart device through the BLE connection. After the BLE smart device executes the control instruction, it generates a response and reports it to terminal A. After receiving the response from the BLE smart device, terminal A reports the response to the server through the TCP connection. Finally, the server pushes the response to terminal B.

[0130] Figure 6 1 is a flow chart of a method for controlling a BLE smart device implemented by a terminal (second terminal) directly connected to the BLE smart device according to another embodiment of the present application. Figure 5 compared to, Figure 6 Steps S601 to S606 in the method are Figure 5 Steps S501 to S506 are similar, except that: Figure 6 The method shown also includes:

[0131] Step S607: When the first terminal is in direct connection with the BLE smart device, a heartbeat signal is sent to the first terminal via the server, so that the first terminal monitors the online status of the second terminal according to the heartbeat signal.

[0132] exist Figure 2 In the illustrated embodiment, after receiving the online notification from terminal A, terminal B starts a heartbeat signal timer, which is used to monitor the reception of the heartbeat signal. If the heartbeat signal is not received within the preset time, terminal B will consider terminal A to be offline. Terminal A regularly sends a heartbeat signal to the server to indicate that it is online. After receiving the heartbeat signal from terminal A, the server forwards the signal to terminal B. After receiving the heartbeat signal, terminal B will reset the heartbeat timer and start the timing again.

[0133] Figure 7 1 is a flow chart of a method for controlling a BLE smart device implemented by a server according to an embodiment of the present application. Figure 7 As shown, the method includes:

[0134] Step S701, establishing a long connection with the first terminal;

[0135] Step S702, receiving a query request from the first terminal, wherein the query request is used to request a query for a second terminal directly connected to the BLE smart device;

[0136] Step S703, sending a query instruction to the second terminal through a long connection with the second terminal, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device;

[0137] Step S704, receiving a query response from the second terminal;

[0138] Step S705, sending the query response to the first terminal through a long connection with the first terminal;

[0139] Step S706, receiving a control instruction for the BLE smart device from the first terminal;

[0140] Step S707: When the second terminal is directly connected to the BLE smart device, the control instruction is sent to the second terminal, so that the second terminal sends the control instruction to the BLE smart device;

[0141] Step S708, receiving a response to the control instruction from the BLE smart device and forwarded via the second terminal; and

[0142] Step S709: Send the response to the first terminal.

[0143] Figure 8 is a flow chart of a method for controlling a BLE smart device implemented by a server according to another embodiment of the present application. Figure 7 compared to, Figure 8 Steps S801 to S809 in the method are Figure 7 Steps S701 to S709 are similar, except that: Figure 8 The method shown also includes:

[0144] Step S810, receiving a heartbeat signal from the second terminal; and

[0145] Step S811: sending the heartbeat signal to the first terminal, so that the first terminal monitors the online status of the second terminal according to the heartbeat signal.

[0146] According to the control method and system of BLE smart devices provided in the present application, a terminal is directly connected to the BLE smart device and the server, and other terminals are forwarded by the server to control the BLE smart device. In this way, multi-terminal control and remote control of the BLE smart device can be achieved without a gateway device, thereby reducing the cost of users using smart devices and improving user experience.

[0147] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0148] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0149] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical connection or other forms.

[0150] See also Fig. 9 , Fig. 9 An electronic device is provided, comprising a processor and a memory. The memory stores computer instructions, and when the computer instructions are executed by the processor, the processor executes the computer instructions to achieve the following Figures 3 to 8 The method and refinement scheme shown.

[0151] It should be understood that the above device embodiments are only illustrative, and the device disclosed in the present invention can also be implemented in other ways. For example, the division of units / modules described in the above embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0152] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present invention may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0153] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not otherwise specified, the processor or chip may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not otherwise specified, the on-chip cache, the off-chip memory, and the memory may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0154] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer electronic device (which can be a personal computer, a server or a network electronic device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0155] The present application also provides a non-transitory computer storage medium storing a computer program. When the computer program is executed by a plurality of processors, the processors execute the following Figures 3 to 8 The method and refinement scheme shown.

[0156] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.

Claims

1. A control method for a BLE smart device, applied to a first terminal, It is characterized in that include: Establish a long connection with the server; Sending a query request to the server to query a second terminal directly connected to the BLE smart device; In response to the presence of a second terminal directly connected to the BLE smart device, sending a control instruction for the BLE smart device to the server; as well as A response to the control instruction from the BLE smart device is received and forwarded via the second terminal and the server.

2. The method according to claim 1, It is characterized in that Also includes: In response to the presence of a second terminal directly connected to the BLE smart device, starting a heartbeat signal timer; Monitoring, by means of the heartbeat signal timer, a heartbeat signal from the second terminal and forwarded via the server; as well as Whether the second terminal is in an online state is determined by monitoring whether the heartbeat signal is received within a preset time.

3. The method according to claim 1 or 2, It is characterized in that The long connection includes a protocol used in a transport layer, and the protocol includes a TCP protocol and / or a UDP protocol.

4. The method according to claim 1 or 2, It is characterized in that The first terminal and the second terminal are located in the same security domain.

5. A control method for a BLE smart device, applied to a second terminal, It is characterized in that include: Receiving a query instruction from the server through a long connection with the server, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device; Sending a query response to the server according to the direct connection status with the BLE smart device; Receiving a control instruction for the BLE smart device from the first terminal and forwarded by the server; Sending the control instruction to the BLE smart device; Receiving a response to the control instruction from the BLE smart device; as well as The response is sent to the server, so that the first terminal obtains the response via the server.

6. The method according to claim 5, It is characterized in that Also includes: When the first terminal is in direct connection with the BLE smart device, a heartbeat signal is sent to the first terminal via the server, so that the first terminal monitors the online status of the second terminal according to the heartbeat signal.

7. A control method for a BLE smart device, applied to a server, It is characterized in that include: Establishing a long connection with the first terminal; Receiving a query request from the first terminal, the query request being used to request a query of a second terminal directly connected to the BLE smart device; Sending a query instruction to the second terminal through a long connection with the second terminal, wherein the query instruction is used to query the connection status between the second terminal and the BLE smart device; receiving a query response from the second terminal; sending the query response to the first terminal through a persistent connection with the first terminal; Receiving a control instruction for the BLE smart device from the first terminal; When the second terminal is directly connected to the BLE smart device, sending the control instruction to the second terminal, so that the second terminal sends the control instruction to the BLE smart device; receiving a response to the control instruction from the BLE smart device and forwarded via the second terminal; and The response is sent to the first terminal.

8. The method according to claim 7, It is characterized in that Also includes: receiving a heartbeat signal from the second terminal; as well as The heartbeat signal is sent to the first terminal, so that the first terminal monitors the online status of the second terminal according to the heartbeat signal.

9. A control system for a BLE smart device. It is characterized in that include: A first terminal, configured to execute the method according to any one of claims 1 to 4; A second terminal, configured to execute the method according to claim 5 or 6; as well as The server is used to execute the method according to claim 7 or 8.

10. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program in the memory.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Data transmission method, device and program product

    CN120050804A