Equipment control method and system in off-line environment based on Bluetooth Mesh protocol

The Mesh network is built through the Bluetooth Mesh protocol and the use of JSON configuration files is solved, and the intelligent control problem in offline environments of domestic equipment is realized, safe, multi-functional, and easy-to-operate control is achieved on domestic operating system devices, reducing hardware costs and maintenance difficulties.

CN120264257APending Publication Date: 2025-07-04KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510492553.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve intelligent, secure and multi-functional device control in offline environments of domestic equipment, and there are problems such as high hardware costs, maintenance difficulties and security guarantee difficulties.

Method used

The Bluetooth Mesh protocol is used to build a Mesh network, pair and monitor the device side through the client, adjust the topological relationship, and execute control instructions using JSON configuration files to achieve intelligent operation of the device.

Benefits of technology

Without the need for an Internet connection, intelligent, secure and multi-functional control of domestic operating system equipment is achieved, reducing control uncertainty, reducing hardware costs and maintenance difficulties, and supporting operational expansion in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120264257A_ABST
    Figure CN120264257A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment control method and system in an offline environment based on a Bluetooth Mesh protocol. The method comprises the following steps that a client side pairs each equipment side and adds the successfully paired equipment sides into a Mesh network; the client monitors the Bluetooth signal strength of all the equipment ends in the Mesh network in real time, the equipment ends with the Bluetooth signal strength not meeting the requirement are offline, and the topological relation of the remaining equipment ends in the Mesh network is adjusted; the client sends the control instruction to the target device end through the Mesh network; and after receiving the control instruction, the target equipment end matches a locally stored JSON configuration file, executes a corresponding operation according to the JSON configuration file, and sends an operation result to the client through the Mesh network. According to the invention, all devices in the Mesh local network are controlled, and the control requirements of intelligence, safety, multiple functions and convenient operation are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to Internet of Things technology, and particularly to a device control method and system in an offline environment based on the Bluetooth Mesh protocol. Background Art

[0002] In recent years, the replacement of domestic devices has been continuously increasing, and more and more domestic devices are in operation. The demand for management and control and intelligent operation in the domestic Linux operating system environment has also increased accordingly. Due to the hardware defects and ecological limitations of domestic devices, especially the extremely high security requirements of personal computers in certain specific scenarios, it is very difficult for a single control method in the market to meet the needs.

[0003] Usually, people manually operate the physical interfaces on the device to achieve the on / off or specified function operations of the device. This method cannot achieve batch operations. Although a circuit design can be used to concentrate a class of devices on one line, the transformation project is very large and the cost is high. Not only can only a single on / off function be achieved, but also a binding relationship may be formed with other machine devices in the same space, with very large limitations. Or a customized remote control device can be used, which requires integrating a proprietary remote control hardware module on the device to be controlled, or developing an independent hardware control module and connecting it together with the device. Its functions need to be implemented through customized hardware, and there are many compatibility problems of the customized hardware on the domestic platform PC operating system, with high hardware customization costs and difficult maintenance. It is also possible to establish a device control platform, integrate specific software modules in the device operating system, and receive service platform instructions and complete control operations in the case of networking. Although this method has small transformation costs, is easy to implement, intelligent in operation, and easy to expand complex control scenarios, the platform construction and maintenance costs are very high, and the device needs to be connected to the network, and it is very difficult to ensure security. At the same time, it cannot solve the control problems in scenarios such as sleep when the network is disconnected. Summary of the Invention

[0004] The technical problem to be solved by the present invention: In view of the above problems of the prior art, a device control method and system in an offline environment based on the Bluetooth Mesh protocol are provided to achieve the control of all devices in the Mesh local network and meet the control requirements of intelligence, security, multi-function, and easy operation.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0006] A device control method in an offline environment based on the Bluetooth Mesh protocol, which is applied to a Mesh network. The Mesh network includes a client with Bluetooth and multiple device ends with Bluetooth. The method includes the following steps:

[0007] The client pairs with each device end and adds the successfully paired device ends to the Mesh network;

[0008] The client monitors the Bluetooth signal strength of all device terminals in the Mesh network in real time, disconnects the device terminals with insufficient Bluetooth signal strength, and adjusts the topological relationship of the remaining device terminals in the Mesh network;

[0009] The client sends control instructions to the target device terminal through the Mesh network;

[0010] After receiving the control instructions, the target device terminal matches the locally stored JSON configuration file and performs corresponding operations according to the JSON configuration file, and sends the operation results to the client through the Mesh network.

[0011] Further, when pairing each device terminal, it includes:

[0012] The device terminal broadcasts the Bluetooth pairing packet;

[0013] The client searches for and obtains the pairing packet, and parses the pairing packet to find the specified networking flag;

[0014] If the specified networking flag is not found, the corresponding pairing packet is discarded. If the specified networking flag is found, the pairing of the device terminal is completed according to the address information in the pairing packet, and the pairing result is returned to the corresponding device terminal.

[0015] Further, when the client monitors the Bluetooth signal strength of all device terminals in the Mesh network in real time and disconnects the device terminals with insufficient Bluetooth signal strength, it includes

[0016] Obtain the Bluetooth signal strength of all device terminals in the Mesh network at preset time intervals, and compare the Bluetooth signal strength of all device terminals with a preset signal threshold;

[0017] If there is a device terminal whose Bluetooth signal strength is less than the signal threshold within a specified time period, or there is a device terminal whose difference between the maximum and minimum Bluetooth signal strengths within a specified time period is greater than a specified difference, mark the device terminal as an offline device terminal.

[0018] Further, after disconnecting the device terminals with insufficient Bluetooth signal strength, it also includes: if the offline device terminal is not the device terminal to be controlled, send a sleep control instruction to the offline device terminal.

[0019] Further, when adjusting the topological relationship of the remaining device terminals in the Mesh network, specifically, obtain the Bluetooth signal strength data of the remaining device terminals, calculate the position information of the remaining device terminals according to the arrival time and arrival angle of the Bluetooth signal strength data, update the positions of the corresponding nodes in the Mesh network topology diagram according to the position information of the remaining device terminals, and use an optimization algorithm to update the connection relationship of the nodes in the Mesh network topology diagram.

[0020] Further, the JSON configuration file specifically includes one or more of control scripts, configuration files, and resources under different control scenarios.

[0021] Further, it also includes the steps of adding a new control scenario, including:

[0022] Add a custom control scenario on the client side, and connect the storage device side containing the control script and / or configuration file and / or resources corresponding to the custom control scenario to the target device side;

[0023] The client side sends the loading path of the control script and / or configuration file and / or resources to the target device side;

[0024] The target device side loads and configures the control script and / or configuration file and / or resources corresponding to the custom control scenario from the storage device side according to the loading path, and then sends the configuration result information to the client side;

[0025] If the client side receives the information of successful configuration, it sends the control instructions corresponding to the custom control scenario to the target device side through the Mesh network for testing.

[0026] The present invention also proposes a device control system in an offline environment based on the Bluetooth Mesh protocol, including a client side with Bluetooth and multiple device sides with Bluetooth, wherein:

[0027] The client side is used to pair each device side and add the successfully paired device sides to the Mesh network; it is also used to monitor the Bluetooth signal strength of all device sides in the Mesh network in real time, offline the device sides with insufficient Bluetooth signal strength, and adjust the topological relationship of the remaining device sides in the Mesh network; it is also used to send control instructions to the target device side through the Mesh network;

[0028] The device side is used to match the locally stored JSON configuration file and execute corresponding operations according to the JSON configuration file after receiving the control instructions, and send the operation results to the client side through the Mesh network.

[0029] The present invention also proposes a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it realizes the steps of any one of the device control methods in an offline environment based on the Bluetooth Mesh protocol.

[0030] The present invention also proposes a computer program product, including a computer program, and when the computer program is executed by a processor, it realizes the steps of any one of the device control methods in an offline environment based on the Bluetooth Mesh protocol.

[0031] Compared with the prior art, the advantages of the present invention are as follows:

[0032] 1. The present invention forms a Bluetooth Mesh network without accessing the Internet, physically ensuring secure isolation.

[0033] 2. After the Bluetooth Mesh network is formed by the present invention, through further calculation and analysis of the Bluetooth signals of the devices, the devices with weak signals are managed. The devices with weak signals are directly taken offline without the need for response operations, avoiding confusion caused by intermittent online and offline, and reducing control uncertainty.

[0034] 3. The present invention separates the execution instructions on the device from the resources required by the instructions through the method of JSON file configuration. The JSON files such as scripts, configurations, and resources corresponding to operations in different scenarios are deployed on the device side, and are not directly bound or embedded into the program itself. To expand the control scenario, only the execution scripts, configurations, and resources need to be combined, without relying on program upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flowchart of the method according to an embodiment of the present invention.

[0036] Figure 2 It is a Mesh network topology diagram in an embodiment of the present invention.

[0037] Figure 3 It is a design schematic diagram in an embodiment of the present invention.

[0038] Figure 4 It is a flowchart of adding a device side to a Mesh network in an embodiment of the present invention.

[0039] Figure 5 It is a device side list view of a Mesh network in an embodiment of the present invention.

[0040] Figure 6 It is a flowchart of adjusting the status of a device side in an embodiment of the present invention.

[0041] Figure 7 It is a device side list view of a Mesh network after adjusting the status of a device side in an embodiment of the present invention.

[0042] Figure 8 It is a flowchart of a device side executing specific operations according to a client control instruction in an embodiment of the present invention.

[0043] Figure 9 It is a flowchart of adding a new control scenario in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The present invention will be further described below in conjunction with the accompanying drawings of the specification and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.

[0045] Before introducing the specific embodiments of the present invention, relevant concepts or terms will be explained first.

[0046] Mesh protocol: The Bluetooth Mesh protocol is a communication protocol that enables Bluetooth devices to communicate over a network within a relatively large range. It is based on the Bluetooth Low Energy (BLE) standard and is designed specifically for scenarios that require a wide coverage area and device interconnection. Bluetooth Mesh is very suitable for use in smart homes, industrial automation, and other scenarios that require multi-device communication.

[0047] Embodiment 1

[0048] There are many interconnected paths between the nodes of the Mesh topology network. This layout can enhance the reliability of the network and the redundancy of data transmission. It allows the areas covered by the network to be interconnected through multiple wireless access points, enhancing signal and connection stability. The whole machines of domestic operating systems generally come with Bluetooth modules, and in recent years, they have been iteratively supporting the latest Bluetooth protocols, and generally have good support for the Bluetooth Mesh protocol. Then, integrating a Bluetooth module that supports the Mesh protocol in the whole machine device has the basic networking ability.

[0049] Based on this, this embodiment proposes a device control method in an offline environment based on the Bluetooth Mesh protocol, which is applied to a Mesh network. The Mesh network includes a client with Bluetooth and multiple device ends with Bluetooth. In this embodiment, the device end uses a personal computer (PC) installed with a domestic Linux operating system, so as to realize the control of the device under the domestic operating system through the client program control interface in an offline situation. As Figure 1 shown, the method of this embodiment includes the following steps:

[0050] S1) The client pairs with each device end and adds the successfully paired device ends to the Mesh network;

[0051] S2) The client monitors the Bluetooth signal strength of all device ends in the Mesh network in real time, takes offline the device ends whose Bluetooth signal strength does not meet the requirements, and adjusts the topology relationship of the remaining device ends in the Mesh network;

[0052] S3) The client sends the control instruction to the target device end through the Mesh network. After receiving the control instruction, the target device end matches the locally stored JSON configuration file and executes the corresponding operation according to the JSON configuration file, and sends the operation result to the client through the Mesh network.

[0053] Through the above steps, the N connected device terminals can be used as nodes to form Figure 2 the Mesh network shown in the figure, which is convenient for batch operations on domestic operating system devices. For example, in environments where devices are concentrated, such as laboratories and teaching settings, it is convenient for administrators to perform operations such as device initialization, power on / off, and background replacement. It is also convenient for intelligent operations on domestic operating system devices. For example, during the pre-installation test of the entire machine or the operating system test, it is easy to expand and implement the capabilities of the operating system, such as multi-dimensional operations in complex scenarios like LTP testing, S3S4 testing, local updates, and rapid vulnerability repair. It enhances the security of operations on domestic operating system devices. For example, in intranet production environments and highly secure environments, there is no need for Internet access, and external attacks are physically shielded. Further, if permission control is implemented on the operating application, the reliability of operations can be ensured. The control instructions are separated from the resources. Through configuration association, it is further convenient for users to independently complete personalized batch deployment through the client program without relying on technical personnel.

[0054] Such as Figure 3 As shown in the figure, in this embodiment, on the domestic Linux operating system, based on the Bluetooth Mesh protocol, a communication protocol module MeshConnect is developed. The device terminals can be discovered and connected by the client to maintain Mesh networking. The communication protocol module MeshConnect can integrate the device terminals in the space into a Mesh network through specific networking flags; each device terminal has an independent ID (such as the MAC address), enabling it to be accurately scheduled and controlled in different scenarios; there is obvious interference among multiple Bluetooth devices in the same space, so a function for calculating and analyzing Bluetooth signals in the network is added (in the actual deployed device environment, the relationship between the signal strength and the instruction execution efficiency under different numbers of devices is collected. The Bluetooth signal parameters include parameters such as RSSI, LQI, BER, and throughput. By making a linear match with the current device signal data), a signal coefficient for successful control is set, and the online status of the devices in the network is judged by reference or the weak signal devices are actively put into sleep to reduce interference and maintain precise control. The code example is as follows:

[0055]

[0056] In this embodiment, a control program ControlProxy is designed at the system layer of a domestic Linux operating system to provide operation capabilities that can only be completed at the system layer. The control system program ControlProxy, such as a security control whitelist, process monitoring and startup, and upgrade, is provided. At the same time, common operations such as restart, wallpaper replacement, brightness adjustment, and volume adjustment are uniformly encapsulated, facilitating application program calls and function expansion. Therefore, the control system program ControlProxy implemented at the operating system layer has more operation permissions and can have more operation capabilities and centralized management capabilities than traditional control programs. In addition, the execution instructions of the control system program ControlProxy and the resources required by the instructions are not directly bound or embedded in the program itself, but are separated by the method of JSON file configuration. The scripts for executing instructions and resources such as pictures, files, and data required for execution are stored in a specific directory. That is, control scripts, JSON files, and resources can be directly written at the control site and imported into the corresponding directory, and then the program is restarted to quickly complete the deployment. It can not only realize the expansion of functions through the operation and maintenance method without updating the program, but also further judge the completeness of the function through the matching of instructions and resources, and update the operation interface to prompt the user.

[0057] In this embodiment, on a domestic Linux operating system, a device-side application program MeshSetting is developed to trigger networking, message prompting, and at the same time parse and forward control instructions, etc.

[0058] Secondly, the developed application program is installed on clients with Bluetooth such as mobile phones, tablets, and PCs, provides a UI interface, has basic functions such as accessing the network, discovering devices, managing devices, and sending instructions, as well as settings and operations for scenario functions such as batch control and connection operations, and at the same time performs scenario deployment through the client.

[0059] The following combines the above functional modules to elaborate on each step in detail.

[0060] As Figure 4 shown, in step S1 of this embodiment, when pairing each device-side, it includes:

[0061] S11) Keep the device-side of the domestic Linux operating system powered on, the system running normally, the Bluetooth device turned on, open the settings interface of the device-side application program MeshSetting, and enter the pairing mode;

[0062] S12) The communication protocol module MeshConnect of the device-side sets the Bluetooth to enter the pairing mode;

[0063] S13) The communication protocol module MeshConnect of the device-side broadcasts the pairing packet of the Bluetooth;

[0064] S14) Open the client application. The device list is empty in the initial state. Create a Mesh network space (the Bluetooth coverage range), keep the Bluetooth function of the client enabled, initiate a search. The client searches for and obtains the pairing package, and after parsing the pairing package, looks for the specified networking flag;

[0065] S15) If the client application does not find the specified networking flag, discard the corresponding pairing package. If it finds the specified networking flag, it identifies the domestic Linux operating system device end with the specific networking flag under the Mesh network;

[0066] S16) The client application completes the pairing with the device end according to the address information in the pairing package. For example, it makes a prompt: The device Bluetooth MAC AA:BB:CC:DD:FF is found. Do you want to add it to the network? Confirm to add;

[0067] S17) The client application returns the pairing result to the communication protocol module MeshConnect of the corresponding device end according to the address information. After receiving the pairing result, the communication protocol module MeshConnect sends it to the device end application MeshSetting. After receiving the pairing result, the device end application MeshSetting makes a corresponding display. For example, it prompts "Has joined the xx network" on the domestic Linux operating system device end interface.

[0068] By executing the above steps multiple times, the addition of other device ends in the Mesh environment is completed in sequence, and the device list as shown in Figure 5 is obtained.

[0069] After completing the addition of the device ends in the Mesh environment, according to the attributes of the PC to be controlled and the operation client, the device ends that join the Mesh network can be selected as relay nodes, low-power nodes, friend nodes, and proxy nodes to access the Mesh network, and a 1:N topology network is established. However, for long-distance devices or when there are a large number of Bluetooth devices, in order to improve the user experience and avoid the situation where an instruction is issued but there is actually no response. In this embodiment, through step S2, the device end status is adjusted before establishing the topology network, as shown in Figure 6 and includes the following steps:

[0070] S21) The communication protocol module MeshConnect of each device end maintains a Bluetooth heartbeat and continuously updates the status of the device end. Specifically, it obtains the Bluetooth signal information of the corresponding device end at a preset time interval. In this embodiment, the Bluetooth signal information includes information such as Received Signal Strength Indication (RSSI), Signal-to-Noise Ratio (SNR), and Channel State Information (CSI);

[0071] S22) The communication protocol module MeshConnect of each device terminal screens the Received Signal Strength Indication (RSSI) in the Bluetooth signal information and sends it as the Bluetooth signal strength to the client application;

[0072] S23) The client application enables the signal observation function. Each device displays the signal strength in levels 1, 2, 3, and 4. The adjustment mode is enabled, and the weak signal reference value is selected. The Bluetooth signal strengths of all device terminals are compared with the preset signal threshold. If the device signal continuously remains in a weak range or is extremely unstable, it is set as an offline device to ensure the accurate control of the currently online devices. For example, if there is a device terminal whose Bluetooth signal strength is less than the signal threshold within a specified time period, or if there is a device terminal whose difference between the maximum and minimum Bluetooth signal strengths within a specified time period is greater than the specified difference, the device terminal is marked as an offline device terminal. Finally, the status of each device terminal as shown in Figure 7 is obtained;

[0073] S24) If the offline device terminal is not the device terminal to be controlled, a sleep control instruction is sent to the communication protocol module MeshConnect of the offline device terminal.

[0074] Since the Bluetooth signal strength of the offline device terminal is weak, there may be a situation where the control instruction cannot be received when directly sending a sleep control instruction to the communication protocol module MeshConnect of the offline device terminal. Therefore, in step S22 of this embodiment, after the communication protocol module MeshConnect of each device terminal sends the Bluetooth signal strength to the client application, it waits for the instruction of the client application. In step S24 of this embodiment, the client application also sends an online instruction to the non-offline device terminal. If the communication protocol module MeshConnect receives the online instruction within the specified time, it remains online. If it receives a sleep control instruction within the specified time, it forwards the control instruction to the device application MeshSetting for sleep operation. If the instruction reception times out, a sleep control instruction is generated and sent to the device application MeshSetting for sleep operation.

[0075] In step S2 of this embodiment, for the remaining device terminals, the operator can allocate relay nodes, low-power nodes, friend nodes, and proxy nodes among them according to actual needs. Different types of nodes undertake different work tasks, and the topological relationship of the Mesh network needs to be adjusted according to the work of these nodes. When adjusting the topological relationship of the remaining device terminals in the Mesh network, specifically, the client application obtains the Bluetooth signal strength data sent by the communication protocol module MeshConnect of the remaining device terminals, calculates the position information of the remaining device terminals according to the arrival time and arrival angle of the Bluetooth signal strength data, updates the positions of the corresponding nodes in the Mesh network topology map according to the position information of the remaining device terminals, and then combines the roles of each node to calculate the weight of the edge according to the position information of the node and the Bluetooth signal strength data. For example, the stronger the signal, the lower the weight, indicating lower communication cost or higher priority. Relay nodes usually undertake data forwarding tasks, and the weights of the connections to these nodes may be lower to ensure efficient data transmission. Due to energy limitations, the weights of the connections to low-power nodes may be higher to reduce their communication burden. The weights between friend nodes may be lower to support the communication of low-power nodes. Proxy nodes are responsible for communicating with the external network, and the weight setting may consider the necessity and efficiency of the external connection. The farther the distance, the higher the weight, indicating that the signal attenuation may be more and the communication cost increases. Select the edges with lower weights as the best communication paths between nodes. Finally, based on the best communication paths between the obtained nodes, optimize the topological relationship of the nodes in the Mesh network to adjust the connection relationship between the nodes. The optimization of the node topological relationship can use the minimum spanning tree and Delaunay triangulation to optimize the device connection to ensure the connectivity and efficiency of the network. The relevant optimization algorithms are well-known to those skilled in the art, and this embodiment does not involve improvements in specific processes and will not be elaborated here.

[0076] Step S3 of this embodiment is specifically as Figure 8 shown and includes the following steps:

[0077] S31) Open the client application and enter the Mesh network space, where the device terminal list in the current network environment can be seen;

[0078] S32) View the current status of the device terminals through the client application, including offline or online;

[0079] S33) Select an online device or a batch of devices to be controlled as the target device terminals through the client application, add an operation such as restarting or muting as a scenario, and enter the control page;

[0080] S34) Initiate corresponding control commands to the communication protocol module MeshConnect of the target device through the client application. Specifically, the client application sends the message of the control command, which includes the source address, destination address, and plaintext or ciphertext data of the control command, to the communication protocol module MeshConnect of the target device through each node in the Mesh network constructed and optimized in steps S1 and S2. During this process, after the communication protocol module MeshConnect of each node receives the message from the previous node, it sends it to the corresponding device-side application program MeshSetting for parsing. If the destination address is inconsistent with the address of the device side, the device-side application program MeshSetting sends the message to the next node through the communication protocol module MeshConnect according to the node role of the device side to which it belongs until the communication protocol module MeshConnect of the target device receives the message;

[0081] S35) The communication protocol module MeshConnect of the target device waits for and receives the message of the control instruction;

[0082] S36) The communication protocol module MeshConnect of the target device returns the message of the instruction reception result through each node in the Mesh network. The message includes the source address, destination address, and plaintext or ciphertext data of the instruction reception result. During this process, after the communication protocol module MeshConnect of each node receives the message from the previous node, it sends it to the corresponding device-side application program MeshSetting for parsing. If the destination address is inconsistent with the address of the device side, the device-side application program MeshSetting sends the message to the next node through the communication protocol module MeshConnect according to the node role of the device side to which it belongs until the communication protocol module MeshConnect of the target device receives the message;

[0083] S37) The communication protocol module MeshConnect of the target device sends the message of the control instruction to the corresponding device-side application program MeshSetting for parsing. If the control instruction in the message is ciphertext data, the device-side application program MeshSetting also decrypts the ciphertext data into plaintext data;

[0084] S38) The device-side application program MeshSetting of the target device sends the control instruction to the corresponding central control system program ControlProxy. The central control system program ControlProxy obtains the control script, configuration file, and JSON configuration file of the resources corresponding to the control instruction by searching locally, and then executes the search result to execute the instruction, such as performing operations like restarting, testing scripts, and changing wallpapers;

[0085] S39) The central control system program ControlProxy on the target device side returns the execution result to the device-side application MeshSetting;

[0086] S310) The device-side application MeshSetting displays the execution result on the interface, such as online / offline / restarting / system upgrading, and at the same time sends the execution result to the client application through the Mesh network via the communication protocol module MeshConnect;

[0087] S311) The client application obtains the execution result of the target control device and updates the display on the interface, such as online / offline / restarting / system upgrading.

[0088] The method of this embodiment further includes the step of adding a control scenario. When adding a control scenario, relevant resources are prepared, and complex scenarios with strong operation relevance and high resource requirements, such as upgrades and updating local wallpapers when switching between different devices, are deployed through the client and the device side. Ordinary operations do not require configuration and are supported by default, such as Figure 9 as shown, including the following steps:

[0089] S101) Through the client application, add a custom control scenario on the client, such as wallpaper update;

[0090] S102) Connect the storage device (such as a USB flash drive) containing the control script and / or configuration file and / or resources corresponding to the custom control scenario to the target device side;

[0091] S103) By operating the deployment interface of the client application, add the control script, configuration file, and resources respectively. The client sends the loading paths of the control script and / or configuration file and / or resources to the target device side. Specifically, the client application can send the loading paths of the control script and / or configuration file and / or resources to the communication protocol module MeshConnect of the target device side through the Mesh network. If the Bluetooth signal strength of the target device side is sufficient, the client application can also send the loading path to the target device side in a Bluetooth direct connection manner;

[0092] S104) The target device side loads and configures the control script and / or configuration file and / or resources corresponding to the custom control scenario from the storage device side according to the loading path;

[0093] S105) The target device sends configuration result information to the client application. Specifically, the communication protocol module MeshConnect of the target device can send the configuration result information to the client application through the Mesh network, or when the Bluetooth signal strength of the target device is sufficient, the target device can send the configuration result information to the client application in a direct Bluetooth connection manner;

[0094] S106) If the client application receives the information indicating successful configuration, through operating the test interface of the client application, the control instructions corresponding to the custom control scenario are sent to the communication protocol module MeshConnect of the target device through the Mesh network for testing. If the execution effect meets the expectation, the new control scenario is successfully configured. If it does not meet the expectation or the configuration fails, relevant steps can be checked and re-operated.

[0095] Embodiment 2

[0096] This embodiment proposes a device control system in an offline environment based on the Bluetooth Mesh protocol, including a client with Bluetooth and multiple device ends with Bluetooth, where:

[0097] The client is used to pair each device end and add the successfully paired device ends to the Mesh network; it is also used to monitor the Bluetooth signal strength of all device ends in the Mesh network in real time, offline the device ends with insufficient Bluetooth signal strength, and adjust the topological relationship of the remaining device ends in the Mesh network; it is also used to send control instructions to the target device end through the Mesh network;

[0098] The device end is used to match the locally stored JSON configuration file after receiving the control instruction and perform corresponding operations according to the JSON configuration file, and send the operation result to the client through the Mesh network.

[0099] Embodiment 3

[0100] This embodiment proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the device control method in an offline environment based on the Bluetooth Mesh protocol described in Embodiment 1 are implemented.

[0101] Embodiment 4

[0102] This embodiment proposes a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the device control method in an offline environment based on the Bluetooth Mesh protocol described in Embodiment 1 are implemented.

[0103] In summary, the present invention proposes a device control method and system in an offline environment based on the Bluetooth Mesh protocol, which forms a Bluetooth Mesh network with a group of devices equipped with domestic operating systems to achieve the control of domestic desktop devices on a domestic client.

[0104] The present invention further calculates and analyzes the Bluetooth signals of devices, performs offline settings on weak signal devices, reduces control uncertainty, and provides a clearer device view.

[0105] The present invention uses the system layer as the core capability support, reserves operating system capabilities for the control program encapsulation, such as system capabilities like security control whitelists, process monitoring and startup, and realizes the control scenarios independently in the application layer, facilitating the implementation of intelligent control, batch control, complex scenario control, etc.

[0106] The present invention separates the execution instructions on the device from the resources required by the instructions through the method of JSON file configuration, without directly binding or embedding them into the program itself. To expand the control scenarios, only the execution scripts, configurations, and resources need to be combined, without relying on program upgrades.

[0107] The present invention realizes control based on the capabilities of domestic operating systems and has no special dependencies or special capability supports in terms of the hardware capabilities of Bluetooth modules. Compared with traditional control methods for other Mesh devices, it is more convenient for maintenance and function expansion.

[0108] The above are only the preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art of this technology, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.

Claims

1. A device control method in an offline environment based on the Bluetooth Mesh protocol, characterized in that, Applied to a Mesh network, the Mesh network includes a client with Bluetooth and multiple device ends with Bluetooth. The method includes the following steps: The client pairs with each device end and adds the successfully paired device ends to the Mesh network; The client monitors the Bluetooth signal strength of all device ends in the Mesh network in real time, takes offline the device ends whose Bluetooth signal strength does not meet the requirements, and adjusts the topological relationship of the remaining device ends in the Mesh network; The client sends a control instruction to the target device end through the Mesh network; After receiving the control instruction, the target device end matches the locally stored JSON configuration file and executes the corresponding operation according to the JSON configuration file, and sends the operation result to the client through the Mesh network.

2. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 1, wherein When pairing with each device end, it includes: The device end broadcasts the Bluetooth pairing packet; The client searches for and obtains the pairing packet, and parses the pairing packet to find the specified networking flag; If the specified networking flag is not found, the corresponding pairing packet is discarded. If the specified networking flag is found, the device end is paired according to the address information in the pairing packet, and the pairing result is returned to the corresponding device end.

3. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 1, characterized in that When the client monitors the Bluetooth signal strength of all device ends in the Mesh network in real time and takes offline the device ends whose Bluetooth signal strength does not meet the requirements, it includes Obtaining the Bluetooth signal strength of all device ends in the Mesh network at a preset time interval, and comparing the Bluetooth signal strength of all device ends with a preset signal threshold; If there is a device end whose Bluetooth signal strength is less than the signal threshold within a specified time period, or there is a device end whose difference between the maximum and minimum Bluetooth signal strengths within a specified time period is greater than a specified difference, the device end is marked as an offline device end.

4. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 3, characterized in that, After taking offline the device ends whose Bluetooth signal strength does not meet the requirements, it further includes: if the offline device end is not the device end to be controlled, sending a sleep control instruction to the offline device end.

5. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 1, characterized in that When adjusting the topological relationship of the remaining device ends in the Mesh network, specifically, obtaining the Bluetooth signal strength data of the remaining device ends, calculating the position information of the remaining device ends according to the arrival time and arrival angle of the Bluetooth signal strength data, updating the positions of the corresponding nodes in the Mesh network topology diagram according to the position information of the remaining device ends, and using an optimization algorithm to update the connection relationship of the nodes in the Mesh network topology diagram.

6. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 1, characterized in that, The JSON configuration file specifically includes one or more of control scripts, configuration files, and resources under different control scenarios.

7. The device control method in an offline environment based on the Bluetooth Mesh protocol according to claim 1, wherein It further includes the step of adding a new control scenario, including: Adding a custom control scenario on the client, and connecting the storage device end containing the control script and / or configuration file and / or resources corresponding to the custom control scenario to the target device end; The client sends the loading path of the control script and / or configuration file and / or resources to the target device end; The target device end loads and configures the control script and / or configuration file and / or resources corresponding to the custom control scenario from the storage device end according to the loading path, and then sends the configuration result information to the client. If the client receives the information of successful configuration, it will send the control instructions corresponding to the customized control scenario to the target device end through the Mesh network for testing.

8. A device control system in an offline environment based on the Bluetooth Mesh protocol, characterized in that, It includes a client with Bluetooth and multiple device ends with Bluetooth, where: The client is used to pair each device end and add the successfully paired device ends to the Mesh network; it is also used to monitor the Bluetooth signal strength of all device ends in the Mesh network in real time, take offline the device ends whose Bluetooth signal strength does not meet the requirements, and adjust the topological relationship of the remaining device ends in the Mesh network; it is also used to send control instructions to the target device end through the Mesh network; The device end is used to match the locally stored JSON configuration file and execute corresponding operations according to the JSON configuration file after receiving the control instructions, and send the operation results to the client through the Mesh network.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the device control method in an offline environment based on the Bluetooth Mesh protocol according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the device control method in an offline environment based on the Bluetooth Mesh protocol according to any one of claims 1 to 7.