Equipment control method and system, electronic equipment and storage medium
After receiving the networking command, the smart device automatically forms a network according to the signal strength, which solves the problem of limited number of Bluetooth communication connections and improves the user experience.
Patent Information
- Application Number
- CN202410811321.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-30
AI Technical Summary
When existing smart home devices communicate via Bluetooth, the number of connections is limited, and users need to manually disconnect and reconnect, thus affecting the user experience.
After receiving the networking command from the device, determine the signal strength with the non-networked device. If it is the device with the highest node level, it will join the network. If it is not the highest, the signal strength will be sent to the highest device to realize the communication between the devices. automatic networking among them.
Automatic networking between devices is realized, reducing user manual operations and improving user experience.
Smart Images

Figure CN118574196A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a device control method, a device control system, an electronic device and a computer-readable storage medium. Background Art
[0002] With the development of Internet of Things technology, smart devices such as smart home appliances, smart security equipment, smart lights and smart homes have gradually become popular in ordinary families. Various manufacturers have also launched corresponding smart home ecosystems to provide various intelligent products and services. Smart devices in the smart home ecosystem are usually connected by Bluetooth communication. Bluetooth can be divided into classic Bluetooth and low-power Bluetooth. Classic Bluetooth belongs to high-speed data transmission in the Bluetooth domain and is generally used for high-speed communication between audio devices and devices. Low-power Bluetooth is low-power and relatively low-speed, and is generally used in devices that are sensitive to power consumption and have a small amount of data transmission. However, whether it is classic Bluetooth or low-power Bluetooth, it is generally connected in a point-to-point manner, and the number of connections in this way is limited. When it is necessary to control or obtain the status of multiple devices, the user needs to manually disconnect the connected device, find the required device to connect, and then control it after the connection. In this way, the user needs to constantly disconnect or reconnect the device, which greatly affects the user experience. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a device control method, a device control system, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In order to solve the above problem, an embodiment of the present invention discloses a device control method, the method comprising:
[0005] After receiving the networking command, the current slave device determines the signal strength between it and other slave devices that are not networked;
[0006] If the current slave device is the slave device with the highest node level, then according to the signal strength between the slave devices and the other slave devices that are not networked, determine the slave devices of the next node level from the other slave devices that are not networked, and join the network; and after receiving the signal strength between the slave devices of the other node levels and the other slave devices that are not networked, determine the slave devices of the next node level of the slave devices of the other node levels from the other slave devices that are not networked, and join the network;
[0007] If the current slave device is not the slave device with the highest node level, the signal strength between the slave devices that are not networked is sent to the slave device with the highest node level.
[0008] Optionally, the method further comprises:
[0009] If the current slave device receives a networking command sent by the master device, it is determined that the current slave device is the slave device with the highest node level;
[0010] If the current slave device receives a networking command sent by other slave devices in the network, it is determined that the current slave device is not the slave device with the highest node level.
[0011] Optionally, the method further comprises:
[0012] If the current slave device is not the slave device with the highest node level, then obtain the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and update the sub-routing table stored in the current slave device according to the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and send the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the current slave device to the slave device with the highest node level;
[0013] If the current slave device is the slave device with the highest node level, the total routing table stored in the current slave device is updated according to the unique identification codes and node levels of the current slave device and other slave devices in the network.
[0014] Optionally, the method further comprises:
[0015] If the current slave device receives an add device command, the add device command is broadcasted to the network, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not in the network;
[0016] If the current slave device is not the slave device with the highest node level, sending the signal strength between the current slave device and other slave devices that are not networked to the slave device with the highest node level;
[0017] If the current slave device is the slave device with the highest node level, the signal strength between the slave devices and other slave devices not in the network is determined based on all the slave devices, the upper node level slave devices of the other slave devices not in the network are determined, and they are added to the network.
[0018] Optionally, the method further comprises:
[0019] After the networking is completed, if the current slave device receives a delete device command, the delete device command will be forwarded to the slave device corresponding to the delete device command according to the general routing table or the sub-routing table, so that the slave device corresponding to the delete device command is disconnected from the upper-level node slave device and exits the networking.
[0020] Optionally, the device deletion command includes a unique identification code of a device to be deleted; and forwarding the device deletion command to a slave device corresponding to the device deletion command according to the general routing table or the sub-routing table includes:
[0021] If the current slave device is a slave device at the highest node level, broadcasting the delete device command to slave devices at the next node level according to the total routing table stored in the current slave device;
[0022] If the current slave device is not a slave device of the highest node level, determining whether the unique identification code of the device to be deleted is the same as the unique identification code of the current slave device;
[0023] If the unique identification code is the same as the unique identification code of the current slave device, determining that the current slave device is a slave device that needs to be deleted;
[0024] If it is different from the unique identification code of the current slave device, judging whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device according to the sub-routing table stored in the current slave device;
[0025] If the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device, the command to delete the device is forwarded to the upper node-level slave device;
[0026] If the unique identification code of the device to be deleted is a slave device at a lower node level than the current slave device, the device deletion command is broadcast to the slave devices at the next node level.
[0027] Optionally, the method further comprises:
[0028] After the networking is completed, if the current slave device receives a control instruction sent by the control device, it is determined whether the current slave device is the slave device with the highest node level according to the total routing table or the sub-routing table;
[0029] If the current slave device is the slave device with the highest node level, judging whether the slave device with the highest node level corresponds to the unique identification code in the control instruction according to the unique identification code in the control instruction;
[0030] If the slave device with the highest node level corresponds to the unique identification code in the control instruction, the control instruction is executed;
[0031] If the slave device at the highest node level does not correspond to the unique identification code in the control instruction, sending the control instruction to the slave device at the next node level according to the general routing table;
[0032] If the current slave device is not the slave device with the highest node level, the control instruction is forwarded to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
[0033] Optionally, the method further comprises:
[0034] If the current slave device executes the received control instruction, it will forward the execution result to the slave device at the upper node level, so that the slave device with the highest node level will feed back the execution result to the control device; the control instruction is issued by the user through the control device.
[0035] The embodiment of the present invention also discloses a device control system, the system comprising: a master control device and a slave device;
[0036] The master control device is used to send a networking instruction to the slave device;
[0037] The slave device is used to receive the networking command, determine the signal strength between the slave device and other non-networked slave devices, and if the current slave device is the slave device with the highest node level, determine the slave device of the next node level from the other non-networked slave devices according to the signal strength between the slave device and other non-networked slave devices, and join the networking; and after receiving the signal strength between the slave device of other node level and other non-networked slave devices sent by slave devices of other node levels, determine the slave device of the next node level of the slave device of other node level from the other non-networked slave devices, and join the networking; if the current slave device is not the slave device with the highest node level, send the signal strength between the slave device and other non-networked slave devices to the slave device with the highest node level.
[0038] Optionally, the slave device is also used to obtain the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, if the current slave device is not the slave device with the highest node level, and update the sub-routing table stored in the current slave device according to the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and send the unique identification code and node level of the slave device that is connected with the current slave device and has a lower node level than the current slave device, the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the current slave device to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, update the total routing table stored in the current slave device according to the unique identification code and node level of the current slave device and other slave devices in the network.
[0039] Optionally, the master control device is further used to send an add device command to the slave device;
[0040] The slave device is also used to broadcast the add device command to the network, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not networked; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the upper-level node-level slave devices of the other slave devices that are not networked are determined based on the signal strength between them and other slave devices that are not networked determined by all slave devices, and the slave devices are added to the network.
[0041] Optionally, the master control device is further used to send a delete device command to the slave device;
[0042] The slave device is also used to forward the device deletion command to the slave device corresponding to the device deletion command according to the general routing table or the sub-routing table, so that the slave device corresponding to the device deletion command is disconnected from the upper-level node slave device and exits the networking.
[0043] Optionally, the master control device is further used to send a control command to the slave device;
[0044] The slave device is also used to determine whether the current slave device is the slave device with the highest node level according to the general routing table or the sub-routing table; if the current slave device is the slave device with the highest node level, determine whether the slave device with the highest node level corresponds to the unique identification code in the controlled instruction according to the unique identification code in the control instruction; if the slave device with the highest node level corresponds to the unique identification code in the controlled instruction, execute the control instruction; if the slave device with the highest node level does not correspond to the unique identification code in the control instruction, send the control instruction to the slave device of the next node level according to the general routing table; if the current slave device is not the slave device with the highest node level, forward the control instruction to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
[0045] Optionally, the slave device is further configured to determine that the current slave device is the slave device with the highest node level if the current slave device receives a networking command sent by the master device;
[0046] If the current slave device receives a networking command sent by other slave devices in the network, it is determined that the current slave device is not the slave device with the highest node level.
[0047] Optionally, the slave device is also used to broadcast the add device command to the network if the current slave device receives the add device command, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not networked; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the upper-level node-level slave devices of the other slave devices that are not networked are determined based on the signal strength between the current slave device and other slave devices that are not networked, and the slave devices are added to the network.
[0048] Optionally, the delete device command includes a unique identification code of the device to be deleted; the slave device is used to broadcast the delete device command to the slave devices of the next node level according to the total routing table stored in the current slave device if the current slave device is a slave device of the highest node level; if the current slave device is not a slave device of the highest node level, determine whether the unique identification code of the device to be deleted is the same as the unique identification code of the current slave device; if it is the same as the unique identification code of the current slave device, determine that the current slave device is the slave device to be deleted; if it is different from the unique identification code of the current slave device, determine whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device according to the sub-routing table stored in the current slave device; if the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device, forward the delete device command to the slave device of the upper node level; if the unique identification code of the device to be deleted is a slave device of a node level lower than that of the current slave device, broadcast the delete device command to the slave devices of the next node level.
[0049] Optionally, the slave device is further used to forward the execution result to the slave device at the upper node level, so that the slave device with the highest node level feeds back the execution result to the control device; the control instruction is issued by the user through the control device.
[0050] The present invention also discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the device control method as described above when executing the computer program.
[0051] The present invention also discloses 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 described above are implemented.
[0052] The embodiments of the present invention include the following advantages:
[0053] In an embodiment of the present invention, after receiving a networking command, the current slave device determines the signal strength between itself and other non-networked slave devices. If the current slave device is the slave device with the highest node level, then based on the signal strength between itself and other non-networked slave devices, slave devices of the next level of node level are determined from other non-networked slave devices and join the networking. After receiving the signal strength between other node-level slave devices and other non-networked slave devices sent by other node-level slave devices, slave devices of the next level of node level of other node-level slave devices are determined from other non-networked slave devices and join the networking. If the current slave device is not the slave device with the highest node level, the signal strength between itself and other non-networked slave devices is sent to the slave device with the highest node level, so that the slave device completes the networking between all slave devices according to the networking command and the signal strength. Then, the user can use the networking to control the slave device, avoiding the need for the user to manually change the connection status of the slave device due to the limited number of connections, thereby greatly improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a flowchart of a device control method provided by an embodiment of the present invention;
[0055] Figure 2 This is a network structure diagram provided by an embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram of data transmission provided by an embodiment of the present invention;
[0057] Figure 4 is another data transmission schematic diagram provided by an embodiment of the present invention;
[0058] Figure 5 is another data transmission schematic diagram provided by an embodiment of the present invention;
[0059] Figure 6 It is a structural block diagram of a device control system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0061] In the related technology, due to the limited number of Bluetooth communication methods, when a user needs to control multiple devices or obtain the status of multiple devices, the user needs to manually disconnect the connected device, then find the required device to connect, and then control it after connecting. In this way, the user needs to constantly disconnect or reconnect the device, which greatly affects the user experience. In order to solve the above technical problems, the present invention provides a device control method, by which, after receiving a networking command, the current slave device determines the signal strength between the current slave device and other non-networked slave devices; if the current slave device is the slave device with the highest node level, the next-level node-level slave device is determined from the other non-networked slave devices according to the signal strength between the current slave device and other non-networked slave devices, and joins the networking; and after receiving the signal strength between the other node-level slave devices and other non-networked slave devices sent by other node-level slave devices, the next-level node-level slave device of the other node-level slave device is determined from the other non-networked slave devices, and joins the networking; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other non-networked slave devices is sent to the slave device with the highest node level, so that the slave device completes the networking between all slave devices according to the networking command and the signal strength, and then the user can use the networking to control the slave device, avoiding the need for the user to manually change the connection status of the slave device due to the limited number of connections, thereby greatly improving the user experience.
[0062] Reference Figure 1 , shows a flow chart of a device control method provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0063] Step 101: After receiving a networking command, the current slave device determines the signal strength between the current slave device and other slave devices that are not networked.
[0064] In the embodiment of the present invention, when the user needs to control the slave device, the slave device needs to be networked. When networking, the slave device can receive a networking command and execute the networking command. After receiving the networking command, the slave device needs to determine the signal strength between it and other devices that are not networked.
[0065] Specifically, a user sends a networking command to a slave device through a control device, and the control device sends a networking command to the slave device, which may be sent through a first communication mode, wherein the first communication mode may include wireless network communication or Ethernet communication. The slave device that receives the networking command sent by the control device can join the network, and the slave device that receives the networking command sent by the control device is the slave device with the highest node level. The slave device with the highest node level is not only provided with a first communication mode module, but also provided with a second communication mode module, and the second communication mode may include Bluetooth communication. It should be noted that in the present invention, the communication mode between slave devices is the second communication mode, and the slave device is a device in the network and needs to be networked, that is, the communication mode between devices in the network is the second communication mode.
[0066] In one embodiment, if the current slave device receives a networking command sent by the master control device, it is determined that the current slave device is the slave device with the highest node level. If the current slave device receives a networking command sent by other slave devices in the network, it is determined that the current slave device is not the slave device with the highest node level.
[0067] like Figure 2 As shown, a network structure block diagram provided by an embodiment of the present invention is shown. Among them, the first-level slave device is the slave device with the highest node level, and other slave devices are not the slave devices with the highest node level. The first-level slave device is connected to the control device outside the network through a first communication method.
[0068] Step 102, if the current slave device is the slave device with the highest node level, then according to the signal strength between the slave devices and the other slave devices that are not networked, determine the slave devices of the next node level from the other slave devices that are not networked, and join the networking; and after receiving the signal strength between the slave devices of the other node level and the other slave devices that are not networked sent by the slave devices of the other node level, determine the slave devices of the next node level of the slave devices of the other node level from the other slave devices that are not networked, and join the networking.
[0069] In an embodiment of the present invention, if the current device receiving the networking command is a slave device with the highest node level, the slave device with the highest node level can first determine the signal strength between it and other slave devices that are not networked, and determine the slave devices of the next node level from the other slave devices that are not networked. In the present invention, the slave device with the highest node level can determine whether the signal strength between it and other slave devices that are not networked is greater than a preset signal strength. If it is greater than the preset signal strength, the slave device with a signal strength greater than the preset signal strength is determined as a slave device of the next node level and joins the network.
[0070] by Figure 2For example, the slave device at the highest node level is the first-level slave device, and the other slave devices are unnetworked slave devices. After receiving the networking command, the first-level slave device can first determine the signal strength between the first-level slave device and other unnetworked slave devices. When it is determined based on the signal strength that the signal strength with the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 is greater than the preset signal strength, the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 can be determined as slave devices at the next-level node level, and communicated with the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 in the second communication mode, and the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 are added to the network.
[0071] In an embodiment of the present invention, if the current slave device is the slave device with the highest node level, it can also receive the signal strength between slave devices of other node levels and other slave devices that are not networked, and then determine the slave devices of the next level node level of slave devices of other node levels from other slave devices that are not networked, and join the networking.
[0072] Step 103: If the current slave device is not the slave device with the highest node level, the signal strength between the slave devices and the other slave devices that are not networked is sent to the slave device with the highest node level.
[0073] In an embodiment of the present invention, if the current slave device receiving the networking command is not the slave device with the highest node level, then the slave device will send the signal strength between other slave devices that are not networked to the slave device with the highest node level, so that the slave device with the highest node level can determine the slave devices of the next level node level of other node-level slave devices from other devices that are not networked, and join the networking.
[0074] Specifically, Figure 2For example, after the first-level slave device determines that the next-level node-level slave devices of the first-level slave device are the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4, the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 can send networking commands to other slave devices that are not networked. At this time, the other slave devices that are not networked are slave devices other than the first-level slave device, the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4. The second-level slave device 1 can determine the signal strength of other slave devices that are not networked, and send the signal strength of the second-level slave device 1 and other slave devices that are not networked to the first-level slave device. The first-level slave device determines the third-level slave device 1, the third-level slave device 2 and the third-level slave device 3 whose signal strength is greater than the preset signal strength from other slave devices that have not been connected to the network. Then the first-level slave device can determine the third-level slave device 1, the third-level slave device 2 and the third-level slave device 3 as slave devices at the next node level of the second-level slave device 1. The second-level slave device 1 is connected to the third-level slave device 1, the third-level slave device 2 and the third-level slave device 3 in a second communication mode, so that the third-level slave device 1, the third-level slave device 2 and the third-level slave device 3 join the network. In this way, the next-level node-level devices of the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4 are determined and join the network.
[0075] It should be noted that, taking the second-level slave device 2 as an example, if the first-level slave device determines that the signal strength between the second-level slave device 2 and other non-networked slave devices is not greater than the preset signal strength, it is determined that there is no slave device at the next-level node level of the second-level slave device 2, that is, the second-level slave device 2 has no slave device at the next-level node level.
[0076] In the present invention, when networking is performed, the networking methods of all slave devices are the same as the networking method of the secondary slave device 1 described above, and the networking methods of other slave devices will not be described in detail herein.
[0077] In an embodiment of the present invention, when networking is being performed, or when networking is completed, if the current slave device is not the slave device with the highest node level, the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device are obtained, and the sub-routing table stored in the current slave device is updated based on the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, and the unique identification code and node level of the slave device at the upper node level of the current slave device, as well as the unique identification code and node level of the current slave device are sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the total routing table stored in the current slave device is updated based on the unique identification code and node level of the current slave device and other slave devices in the networking.
[0078] In the present invention, all slave devices have a routing table pre-stored in them. If one of the slave devices is determined to be the slave device with the highest node level, the routing table corresponding to the slave device is the overall routing table, and the routing tables in other slave devices are sub-routing tables.
[0079] by Figure 2 For example, the second-level slave device 1 can obtain the unique identification code and node level of the slave device at the upper node level, that is, obtain the unique identification code and node level of the first-level slave device, and the second-level slave device 1 can also obtain the unique identification code and node level of the node that is in communication connection with the second-level slave device 1 and has a lower node level than the second-level slave device 1, that is, the second-level slave device 1 can also obtain the unique identification code and node level of the third-level slave device 1, the third-level slave device 2 and the fourth-level slave device 1, and the second-level slave device 1 updates the sub-routing table stored in the second-level device 1 according to the unique identification code and node level of the first-level slave device, the third-level slave device 1, the third-level slave device 2 and the fourth-level slave device 1. The second-level slave device 1 also sends its own unique identification code and node level, the unique identification code and node level of the first-level slave device, the third-level slave device 1, the third-level slave device 2 and the fourth-level slave device 1 to the first-level slave device, so that the first-level slave device updates the total routing table according to the acquired unique identification code and node level. Alternatively, the second-level slave device 1 may send the updated sub-routing table to the first-level slave device, so that the first-level slave device updates the total routing table according to the received sub-routing table.
[0080] It should be noted that, in the present invention, when a slave device in the network changes, the sub-routing table and the total routing table related to the corresponding link will be updated.
[0081] In an embodiment of the present invention, if the current slave device receives a command to add a device, the command to add a device will be broadcast to the network so that all slave devices in the network can determine the signal strength between them and other slave devices that are not in the network; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not in the network will be sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the upper-level node-level slave devices of other slave devices that are not in the network will be determined based on the signal strength between all slave devices and other slave devices that are not in the network, and the slave devices will be added to the network.
[0082] like Figure 3 As shown, a data transmission diagram provided by an embodiment of the present invention is shown. One way is that the control device sends an add device command to the fourth-level slave device 4 through the second communication method. At this time, the fourth-level slave device 4 will forward the add device command to the first-level slave device step by step upward, such as Figure 3 The dotted line in the figure shows that the first-level slave device will broadcast the device add command to the network, that is, all slave devices in the network. All slave devices in the network determine the signal strength between them and other slave devices that are not in the network. Taking the addition of the fourth-level slave device 3 as an example, all slave devices in the network determine the signal strength between them and the fourth-level slave device 3, and send the signal strength to the first-level slave device. The first-level slave device determines that the signal strength between the fourth-level slave device 3 and the third-level slave device 3 is greater than the preset signal strength. At this time, the fourth-level slave device 3 can be determined as a slave device at the node level below the third-level slave device 3. The third-level slave device 3 is connected to the fourth-level slave device 3 for communication, and the fourth-level slave device 3 is added to the network.
[0083] Another way is that the first-level slave device receives the command to add a device sent by the control device, and directly broadcasts the command to add a device to the network, that is, all slave devices in the network. All slave devices in the network determine the signal strength between them and other slave devices that are not in the network. Taking the addition of a fourth-level slave device 3 as an example, all slave devices in the network determine the signal strength between them and the fourth-level slave device 3, and send the signal strength to the first-level slave device. The first-level slave device determines that the signal strength between the fourth-level slave device 3 and the third-level slave device 3 is greater than the preset signal strength. At this time, the fourth-level slave device 3 can be determined as a slave device at the node level below the third-level slave device 3, and the third-level slave device 3 is communicated with the fourth-level slave device 3 to add the fourth-level slave device 3 to the network.
[0084] In an embodiment of the present invention, after the networking is completed, if the current slave device receives a delete device command, the delete device command will be forwarded to the slave device corresponding to the delete device command according to the general routing table or the sub-routing table, so that the slave device corresponding to the delete device command is disconnected from the upper-level node slave device and exits the networking.
[0085] Specifically, after the current slave device receives the delete device command, if the current slave device is a slave device of the highest node level and the slave device to be deleted is not a slave device of the highest level, the delete device command will be broadcast to the slave devices of the next level node according to the total routing table. After the slave device that is not at the highest node level receives the delete device command, it first determines whether the slave device to be deleted is itself. If not, the delete device command will be sent out according to the sub-routing table.
[0086] In one embodiment, the delete device command includes a unique identification code of the device to be deleted; forwarding the delete device command to the slave device corresponding to the delete device command according to the general routing table or the sub-routing table may include: if the current slave device is a slave device of the highest node level, broadcasting the delete device command to the slave devices of the next node level according to the general routing table stored in the current slave device; if the current slave device is not a slave device of the highest node level, determining whether the unique identification code of the device to be deleted is the same as the unique identification code of the current slave device; if it is the same as the unique identification code of the current slave device, determining that the current slave device is the slave device to be deleted; if it is different from the unique identification code of the current slave device, determining whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device according to the sub-routing table stored in the current slave device; if the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device, forwarding the delete device command to the slave device of the upper node level; if the unique identification code of the device to be deleted is a slave device of a node level lower than the current slave device, broadcasting the delete device command to the slave devices of the next node level.
[0087] like Figure 4 As shown, another data transmission schematic diagram provided by an embodiment of the present invention is shown. One way is that after the first-level slave device receives the command to delete the device, according to the general routing table stored in the first-level device, the command to delete the device is broadcast to the slave devices at the next node level, that is, broadcast to the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4. The second-level slave device 1 determines whether the unique identification code of the device to be deleted is the same as the unique identification code of the second-level slave device 1. If they are the same, it is determined that the current slave device is the slave device to be deleted. If they are different, it is determined according to the sub-routing table stored in the second-level slave device 1 whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the second-level slave device 1. If it does not exist, the second-level slave device 1 forwards the command to delete the device to the first-level slave device. If the second-level slave device 1 determines that the unique identification code of the device to be deleted is a slave device at a node level lower than the second-level slave device 1 according to the sub-routing table, the command to delete the device is broadcast to the slave devices at the next node level, that is, the third-level slave device 1 and the third-level slave device 2. For example: Figure 4The slave device to be deleted is the third-level slave device 2, then the first-level slave device will broadcast the delete device command to the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4, and the second-level slave device 1 will broadcast the delete device command to the third-level slave device 1 and the third-level slave device 2. After receiving the delete device command, the third-level slave device 2 will disconnect the communication connection with the second-level slave device 1, thereby exiting the network.
[0088] Another way is that the control device sends a delete device command to the fourth-level slave device 4 through the second communication method. At this time, the fourth-level slave device 4 will forward the delete device command to the first-level slave device step by step upward, such as Figure 4 The dotted line in the figure shows that the primary slave device broadcasts the delete device command to the secondary slave devices 1, 2, 3 and 4. The secondary slave device 1 broadcasts the delete device command to the tertiary slave devices 1 and 2. After receiving the delete device command, the tertiary slave device 2 disconnects the communication connection with the secondary slave device 1, thereby exiting the network.
[0089] In an embodiment of the present invention, after networking is completed, if the current slave device receives a control instruction sent by the control device, it is determined whether the current slave device is the slave device with the highest node level according to the general routing table or the sub-routing table; if the current slave device is the slave device with the highest node level, it is determined whether the slave device with the highest node level corresponds to the unique identification code in the control instruction according to the unique identification code in the control instruction; if the slave device with the highest node level corresponds to the unique identification code in the control instruction, the control instruction is executed; if the slave device with the highest node level does not correspond to the unique identification code in the control instruction, the control instruction is sent to the slave device of the next node level according to the general routing table; if the current slave device is not the slave device with the highest node level, the control instruction is forwarded to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
[0090] Specifically, after the networking is completed, if the current slave device receives a control command sent by a control instruction, if there is a slave device at the upper node level in the general routing table or sub-routing table stored in the current slave device, it can be determined that the current slave device is not the slave device with the highest node; if there is no slave device at the upper node level in the general routing table or sub-routing table stored in the current slave device, it can be determined that the current slave device is the slave device with the highest node.
[0091] like Figure 5 FIG. 1 is a diagram showing another data transmission schematic diagram provided by an embodiment of the present invention. Figure 5The slave device that needs to be controlled is the fourth-level slave device 1. One way is that after the first-level slave device receives the control instruction, it will broadcast the control instruction to the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4. The second-level slave device 1 will broadcast the control instruction to the third-level slave device 1 and the third-level slave device 2. The third-level slave device 1 will send the control instruction to the fourth-level slave device 1. After the fourth-level slave device 1 receives the control instruction, it will execute the control instruction.
[0092] Another way is that the control device sends a control instruction to the fourth-level slave device 4 through the second communication method. At this time, the fourth-level slave device 4 will forward the control instruction to the first-level slave device step by step upward, such as Figure 5 The dotted line in the figure shows that the first-level slave device broadcasts the control instruction to the second-level slave device 1, the second-level slave device 2, the second-level slave device 3 and the second-level slave device 4. The second-level slave device 1 broadcasts the control instruction to the third-level slave device 1 and the third-level slave device 2. The third-level slave device 1 sends the control instruction to the fourth-level slave device 1. After receiving the control instruction, the fourth-level slave device 1 executes the control instruction.
[0093] It should be noted that the control instruction in the present invention includes a unique identification code of the device to be controlled, and judging whether the current slave device is the slave device to be controlled based on the unique identification code is the same as the judgment method when deleting the slave device, but the execution result is different.
[0094] In an embodiment of the present invention, after the current slave device executes the received control instruction, the execution result is forwarded to the slave device at the upper node level, so that the slave device with the highest node level feeds back the execution result to the control device; the control instruction is issued by the user through the control device.
[0095] After the current slave device receives the control instruction, if the slave device corresponding to the control instruction is the current control instruction, it will execute the control instruction, obtain the execution result, and forward the execution result to the slave device of the upper node level step by step until the control instruction is forwarded to the slave device with the highest node level. The slave device with the highest node level will return the execution result to the control device by the original route.
[0096] In an embodiment of the present invention, after receiving a networking command, the current slave device determines the signal strength between itself and other non-networked slave devices. If the current slave device is the slave device with the highest node level, then based on the signal strength between itself and other non-networked slave devices, slave devices of the next level of node level are determined from other non-networked slave devices and join the networking. After receiving the signal strength between other node-level slave devices and other non-networked slave devices sent by other node-level slave devices, slave devices of the next level of node level of other node-level slave devices are determined from other non-networked slave devices and join the networking. If the current slave device is not the slave device with the highest node level, the signal strength between itself and other non-networked slave devices is sent to the slave device with the highest node level, so that the slave device completes the networking between all slave devices according to the networking command and the signal strength. Then, the user can use the networking to control the slave device, avoiding the need for the user to manually change the connection status of the slave device due to the limited number of connections, thereby greatly improving the user experience.
[0097] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, 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 preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0098] Reference Figure 6 , shows a structural block diagram of a device control system provided by an embodiment of the present invention, the system includes a master device and a slave device. There may be multiple slave devices, such as slave device 1, slave device 2, slave device 3, and slave device n.
[0099] The master control device is used to send a networking instruction to the slave device;
[0100] The slave device is used to receive the networking command, determine the signal strength between the slave device and other non-networked slave devices, and if the current slave device is the slave device with the highest node level, determine the slave device of the next node level from the other non-networked slave devices according to the signal strength between the slave device and other non-networked slave devices, and join the networking; and after receiving the signal strength between the slave device of other node level and other non-networked slave devices sent by slave devices of other node levels, determine the slave device of the next node level of the slave device of other node level from the other non-networked slave devices, and join the networking; if the current slave device is not the slave device with the highest node level, send the signal strength between the slave device and other non-networked slave devices to the slave device with the highest node level.
[0101] In one embodiment, the slave device is also used to obtain the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, if the current slave device is not the slave device with the highest node level, and update the sub-routing table stored in the current slave device according to the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and send the unique identification code and node level of the slave device that is connected with the current slave device and has a lower node level than the current slave device, the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the current slave device to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, update the total routing table stored in the current slave device according to the unique identification code and node level of the current slave device and other slave devices in the network.
[0102] In one embodiment, the master control device is further used to send an add device command to the slave device;
[0103] The slave device is also used to broadcast the add device command to the network, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not networked; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the upper-level node-level slave devices of the other slave devices that are not networked are determined based on the signal strength between them and other slave devices that are not networked determined by all slave devices, and the slave devices are added to the network.
[0104] In one embodiment, the master control device is further used to send a delete device command to the slave device;
[0105] The slave device is also used to forward the device deletion command to the slave device corresponding to the device deletion command according to the general routing table or the sub-routing table, so that the slave device corresponding to the device deletion command is disconnected from the upper-level node slave device and exits the networking.
[0106] In one embodiment, the master control device is further used to send a control command to the slave device;
[0107] The slave device is also used to determine whether the current slave device is the slave device with the highest node level according to the general routing table or the sub-routing table; if the current slave device is the slave device with the highest node level, determine whether the slave device with the highest node level corresponds to the unique identification code in the controlled instruction according to the unique identification code in the control instruction; if the slave device with the highest node level corresponds to the unique identification code in the controlled instruction, execute the control instruction; if the slave device with the highest node level does not correspond to the unique identification code in the control instruction, send the control instruction to the slave device of the next node level according to the general routing table; if the current slave device is not the slave device with the highest node level, forward the control instruction to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
[0108] In one embodiment, the slave device is further used to determine that the current slave device is the slave device with the highest node level if the current slave device receives a networking command sent by the master device;
[0109] If the current slave device receives a networking command sent by other slave devices in the network, it is determined that the current slave device is not the slave device with the highest node level.
[0110] In one embodiment, the slave device is also used to broadcast the add device command to the network if the current slave device receives the add device command, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not networked; if the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the upper-level node-level slave devices of the other slave devices that are not networked are determined based on the signal strength between all slave devices and other slave devices that are not networked, and join the network.
[0111] In one embodiment, the delete device command includes a unique identification code of the device to be deleted; the slave device is used to broadcast the delete device command to the slave devices of the next node level according to the total routing table stored in the current slave device if the current slave device is a slave device of the highest node level; if the current slave device is not a slave device of the highest node level, determine whether the unique identification code of the device to be deleted is the same as the unique identification code of the current slave device; if it is the same as the unique identification code of the current slave device, determine that the current slave device is the slave device to be deleted; if it is different from the unique identification code of the current slave device, determine whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device according to the sub-routing table stored in the current slave device; if the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device, forward the delete device command to the slave device of the upper node level; if the unique identification code of the device to be deleted is a slave device of a node level lower than that of the current slave device, broadcast the delete device command to the slave devices of the next node level.
[0112] In one embodiment, the slave device is also used to forward the execution result to the slave device at the upper node level, so that the slave device with the highest node level feeds back the execution result to the control device; the control instruction is issued by the user through the control device.
[0113] In the embodiment of the present invention, the master control device is used to send a networking instruction to the slave device; the slave device is used to receive the networking command, determine the signal strength between other slave devices that are not networked, and if the current slave device is the slave device with the highest node level, then according to the signal strength between other slave devices that are not networked, determine the slave device of the next level of node level from other slave devices that are not networked, and join the networking; and after receiving the signal strength between other node-level slave devices and other slave devices that are not networked sent by slave devices of other node levels, determine the slave device of the next level of node level of other node-level slave devices from other slave devices that are not networked, and join the networking; if the current slave device is not the slave device with the highest node level, send the signal strength between other slave devices that are not networked to the slave device with the highest node level. Thus, the slave device completes the networking between all slave devices according to the networking command and signal strength, and then the user can use the networking to control the slave device, avoiding the user from manually changing the connection status of the slave device due to the limited number of connections, which greatly improves the user experience.
[0114] An embodiment of the present invention further provides an electronic device, including:
[0115] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned device control method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0116] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned device control method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0118] Those skilled in the art will appreciate that the embodiments of the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present invention may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0119] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0122] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0123] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0124] The above is a detailed introduction to a device control method, a device control system, an electronic device and a computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A device control method, characterized in that: The method comprises: After receiving the networking command, the current slave device determines the signal strength between it and other slave devices that are not networked; If the current slave device is the slave device with the highest node level, then according to the signal strength between the slave devices and the other slave devices that are not networked, determine the slave devices of the next node level from the other slave devices that are not networked, and join the network; and after receiving the signal strength between the slave devices of the other node levels and the other slave devices that are not networked, determine the slave devices of the next node level of the slave devices of the other node levels from the other slave devices that are not networked, and join the network; If the current slave device is not the slave device with the highest node level, the signal strength between the slave devices that are not networked is sent to the slave device with the highest node level.
2. The device control method according to claim 1, characterized in that: The method further comprises: If the current slave device receives a networking command sent by the master device, it is determined that the current slave device is the slave device with the highest node level; If the current slave device receives a networking command sent by other slave devices in the network, it is determined that the current slave device is not the slave device with the highest node level.
3. The device control method according to claim 1, characterized in that: The method further comprises: If the current slave device is not the slave device with the highest node level, then obtain the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and update the sub-routing table stored in the current slave device according to the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and send the unique identification code and node level of the slave device that is communicatively connected to the current slave device and has a lower node level than the current slave device, the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the current slave device to the slave device with the highest node level; If the current slave device is the slave device with the highest node level, the total routing table stored in the current slave device is updated according to the unique identification codes and node levels of the current slave device and other slave devices in the network.
4. The device control method according to claim 1, characterized in that: The method further comprises: If the current slave device receives an add device command, the add device command is broadcasted to the network, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not in the network; If the current slave device is not the slave device with the highest node level, sending the signal strength between the current slave device and other slave devices that are not networked to the slave device with the highest node level; If the current slave device is the slave device with the highest node level, the signal strength between the slave devices and other slave devices not in the network is determined based on all the slave devices, the upper node level slave devices of the other slave devices not in the network are determined, and they are added to the network.
5. The device control method according to claim 3, characterized in that: The method further comprises: After the networking is completed, if the current slave device receives a delete device command, the delete device command will be forwarded to the slave device corresponding to the delete device command according to the general routing table or the sub-routing table, so that the slave device corresponding to the delete device command is disconnected from the upper-level node slave device and exits the networking.
6. The device control method according to claim 5, characterized in that: The device deletion command includes a unique identification code of the device to be deleted; and forwarding the device deletion command to a slave device corresponding to the device deletion command according to the general routing table or the sub-routing table includes: If the current slave device is a slave device at the highest node level, broadcasting the delete device command to slave devices at the next node level according to the total routing table stored in the current slave device; If the current slave device is not a slave device of the highest node level, determining whether the unique identification code of the device to be deleted is the same as the unique identification code of the current slave device; If the unique identification code is the same as the unique identification code of the current slave device, determining that the current slave device is a slave device that needs to be deleted; If it is different from the unique identification code of the current slave device, judging whether the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device according to the sub-routing table stored in the current slave device; If the unique identification code of the device to be deleted does not exist in the sub-routing table of the current slave device, the command to delete the device is forwarded to the upper node-level slave device; If the unique identification code of the device to be deleted is a slave device at a lower node level than the current slave device, the device deletion command is broadcast to the slave devices at the next node level.
7. The device control method according to claim 3, characterized in that: The method further comprises: After the networking is completed, if the current slave device receives a control instruction sent by the control device, it is determined whether the current slave device is the slave device with the highest node level according to the total routing table or the sub-routing table; If the current slave device is the slave device with the highest node level, judging whether the slave device with the highest node level corresponds to the unique identification code in the control instruction according to the unique identification code in the control instruction; If the slave device with the highest node level corresponds to the unique identification code in the control instruction, the control instruction is executed; If the slave device at the highest node level does not correspond to the unique identification code in the control instruction, sending the control instruction to the slave device at the next node level according to the general routing table; If the current slave device is not the slave device with the highest node level, the control instruction is forwarded to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
8. The device control method according to claim 3, characterized in that: The method further comprises: If the current slave device executes the received control instruction, it will forward the execution result to the slave device at the upper node level, so that the slave device with the highest node level will feed back the execution result to the control device; the control instruction is issued by the user through the control device.
9. A device control system, characterized in that: The system comprises: a master device and a slave device; The master control device is used to send a networking instruction to the slave device; The slave device is used to receive the networking command, determine the signal strength between the slave device and other non-networked slave devices, and if the current slave device is the slave device with the highest node level, determine the slave device of the next node level from the other non-networked slave devices according to the signal strength between the slave device and other non-networked slave devices, and join the networking; and after receiving the signal strength between the slave device of other node level and other non-networked slave devices sent by slave devices of other node levels, determine the slave device of the next node level of the slave device of other node level from the other non-networked slave devices, and join the networking; if the current slave device is not the slave device with the highest node level, send the signal strength between the slave device and other non-networked slave devices to the slave device with the highest node level.
10. The device control system according to claim 9, characterized in that: The slave device is also used for obtaining the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, if the current slave device is not the slave device with the highest node level, and updating the sub-routing table stored in the current slave device according to the unique identification code and node level of the slave device that is communicatively connected with the current slave device and has a lower node level than the current slave device, as well as the unique identification code and node level of the slave device at the upper node level of the current slave device, and sending the unique identification code and node level of the slave device that is connected with the current slave device and has a lower node level than the current slave device, the unique identification code and node level of the slave device at the upper node level of the current slave device, and the unique identification code and node level of the current slave device to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, updating the total routing table stored in the current slave device according to the unique identification code and node level of the current slave device and other slave devices in the network.
11. The device control system according to claim 9, characterized in that: The master control device is further used to send an add device command to the slave device; The slave device is further used to broadcast the add device command to the network, so that all slave devices in the network can determine the signal strength between them and other slave devices that are not in the network; If the current slave device is not the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is sent to the slave device with the highest node level; if the current slave device is the slave device with the highest node level, the signal strength between the current slave device and other slave devices that are not networked is determined based on all the slave devices, the upper-level node-level slave devices of the other slave devices that are not networked are determined, and they are added to the network.
12. The device control system according to claim 10, characterized in that: The master control device is further used to send a delete device command to the slave device; The slave device is also used to forward the device deletion command to the slave device corresponding to the device deletion command according to the general routing table or the sub-routing table, so that the slave device corresponding to the device deletion command is disconnected from the upper-level node slave device and exits the networking.
13. The device control system according to claim 10, characterized in that: The master control device is further used to send a control command to the slave device; The slave device is further used to determine whether the current slave device is the slave device with the highest node level according to the general routing table or the sub-routing table; if the current slave device is the slave device with the highest node level, determine whether the slave device with the highest node level corresponds to the unique identification code in the controlled instruction according to the unique identification code in the control instruction; if the slave device with the highest node level corresponds to the unique identification code in the controlled instruction, execute the control instruction; if the slave device with the highest node level does not correspond to the unique identification code in the control instruction, send the control instruction to the slave device at the next node level according to the general routing table; If the current slave device is not the slave device with the highest node level, the control instruction is forwarded to the slave device with the highest node level according to the node level, so that the slave device with the highest node level broadcasts to the slave device corresponding to the unique identification code in the control instruction.
14. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the device control method according to any one of claims 1 to 8 are implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device control method according to any one of claims 1 to 8 are implemented.
