Equipment interaction method and device, equipment, storage medium and computer program product
By directly receiving and issuing instructions from user terminals in the local network, the problem of inefficient device interaction in distributed networks is solved, and faster intelligent device response is achieved.
Patent Information
- Application Number
- CN202410880660.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-01-07
AI Technical Summary
In distributed networks, device interaction is inefficient and requires transit through the cloud, resulting in long delay and response time.
By directly receiving instructions from user terminals in the local network and issuing them to smart devices, the cloud transit steps are reduced, and instructions are propagated using local network links to improve response speed.
Real-time interaction between users and smart devices is realized, network delay is reduced, and the response speed and interaction efficiency of smart devices are improved.
Smart Images

Figure CN119276911A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a device interaction method, apparatus, device, storage medium and computer program product. Background Art
[0002] In the current distributed network, users control smart devices by transferring data to the cloud through applications, and then the cloud sends commands to the devices for control; the data generated by smart devices is first reported to the cloud, and then the cloud processes the data and transmits the processing results to the application, or the application obtains the data reported by the smart device from the cloud.
[0003] It can be seen that in the current distributed network, the data of the control device or the receiving device needs to be transferred through the cloud, and the efficiency of device interaction is low. Summary of the invention
[0004] In view of this, the present application provides a device interaction method, apparatus, device, storage medium and computer program product to solve the problem of low efficiency of device interaction in the prior art. In order to achieve one or part or all of the above purposes or other purposes, the present application proposes a device interaction method, apparatus, device and storage medium.
[0005] First aspect:
[0006] The present application provides a device interaction method, including:
[0007] The current node receives a target instruction sent by a user terminal through a target network link; the target network link is a network link that directly connects the user terminal to a local network where the current node is located;
[0008] The target instruction is sent to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction.
[0009] In a second aspect, the present application provides a device interaction method, comprising:
[0010] Acquire a target network topology structure, wherein the target network topology structure includes a target network link directly connecting a hub node and a user terminal;
[0011] The target instruction is sent to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
[0012] The third aspect:
[0013] The present application provides a device interaction apparatus, comprising:
[0014] A receiving module, configured for the current node to receive a target instruction sent by a user terminal through a target network link; the target network link is a network link that directly connects the user terminal to a local network where the current node is located;
[0015] The sending module is used to send the target instruction to the corresponding smart device through the local network between the current node and each smart device, so as to instruct the corresponding smart device to execute the target instruction.
[0016] In some embodiments of the present application, the sending module includes:
[0017] A first determining unit, configured to determine whether a target smart device corresponding to the target instruction belongs to a smart device in a local network;
[0018] The sending unit is used to send a control message to the target smart device according to the target instruction if the target smart device belongs to the local network, so as to instruct the target smart device to execute the target instruction.
[0019] In some embodiments of the present application, the sending unit is further configured to:
[0020] If data reported by the smart device in the local network is received, the reported data is transmitted to the user terminal via the target network link, so that the data reported by the smart device is received by the user terminal in real time.
[0021] In some embodiments of the present application, a determination module is also included, which is used to: if the central node of the local area network to which the current node belongs meets the preset conditions, determine the leading node among the central nodes based on the node information of each central node in the same local area network.
[0022] In some embodiments of the present application, the determining module includes:
[0023] An acquisition unit, configured to acquire node information of each central node in the local area network to which the current node belongs if the central node of the local area network meets a preset condition;
[0024] A second determining unit, configured to determine the network access type and node processing capability corresponding to each hub node according to the node information of each hub node;
[0025] The third determining unit is used to determine the leading node among the hub nodes based on the network access type and node processing capability corresponding to the hub nodes.
[0026] In some embodiments of the present application, the third determination unit is further specifically used to: if the leading node is abnormal, determine the leading node among the central nodes based on the node information of other central nodes in the local area network where the leading node is located.
[0027] In some embodiments of the present application, the sending module is also specifically used to: if the current node identifies that the trigger condition of the preset control scheme is met based on the data reported by the smart device, a target instruction for the smart device is generated based on the preset control scheme, and the target instruction is sent to the smart device to instruct the smart device to execute the target instruction.
[0028] Fourth aspect:
[0029] The present application provides a device interaction apparatus, comprising:
[0030] An acquisition module, used to acquire a target network topology structure, wherein the target network topology structure includes a target network link directly connecting a hub node and a user terminal;
[0031] The sending module is used to send the target instruction to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
[0032] In some embodiments of the present application, the sending module is further used to:
[0033] Determine whether the target smart device belongs to the local network;
[0034] If the target smart device belongs to the local network, receiving the data reported by the target smart device from the hub node via the network link;
[0035] If the target smart device does not belong to the local network, the data reported by the target smart device is received from the cloud.
[0036] In some embodiments of the present application, the sending module is further specifically used for: if the leading node is changed, connecting to the changed leading node through the central node so that the user terminal can communicate with other smart devices.
[0037] Fifth aspect:
[0038] The present application provides an electronic device, comprising at least one memory and at least one processor, wherein the memory stores a computer program, and when the processor executes the computer program, steps in device interaction of each embodiment of the present application are implemented.
[0039] Sixth aspect:
[0040] The present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the device interaction of each embodiment of the present application are implemented.
[0041] Seventh aspect:
[0042] The present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, the steps in the device interaction method of each embodiment of the present application are implemented.
[0043] The embodiments of the present application have the following beneficial effects:
[0044] When users interact with smart devices through user terminals, they can issue instructions directly through the local network, reducing the steps of transferring through the cloud. In addition, since the instructions are transmitted within the local network, network latency is reduced, making the smart device respond more quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] in:
[0047] Figure 1 An application environment diagram of the device interaction method provided in an embodiment of the present application;
[0048] Figure 2 A hardware structure block diagram of a network node device provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a flow chart of a device interaction method provided in an embodiment of the present application;
[0050] Figure 4 Another schematic diagram of a flow chart of a device interaction method provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a scenario of a device interaction method provided in an embodiment of the present application;
[0052] Figure 6 A communication signaling diagram between a leader node and a hub node in a device interaction method provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of another process of the device interaction method provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the structure of a device interaction apparatus provided in an embodiment of the present application;
[0055] Fig. 9 Another structural schematic diagram of the device interaction apparatus provided in an embodiment of the present application;
[0056] Fig.10 Another structural schematic diagram of the device interaction apparatus provided in an embodiment of the present application;
[0057] Fig.11 An internal structure diagram of a computer device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] The device interaction method provided in this application can be applied to Figure 1 In the application environment shown. Figure 1 A device interaction system is provided, which includes a smart device 100, a network node device 200 communicatively connected to the smart device 100, a router 300, a server 400, and a terminal 500.
[0060] The smart device 100 accesses the network node device 200 in the device interaction system, and communicates with the network node device 200 through its own configured communication module, and is then controlled by the network node device 200. The network node device 200 may be a gateway or a hub node. The gateway can receive signals or data from the smart device and forward this information to the user terminal or cloud server. It can also receive control instructions and convey them to the smart device. The hub node assumes additional responsibilities in the distributed network, such as coordinating communications in the network, managing network topology, etc. The hub node may be designated as a leader node, responsible for managing other hub nodes and smart devices in the local area network. In one embodiment, the smart device 100 accesses the network node device 200 through a local area network path or a wide area network path, and is thus deployed in the network node device 200. Among them, the local area network may include ZIGBEE or Bluetooth, and the wide area network may include 2G / 3G / 4G / 5G / WIFI, etc.
[0061] The network node device 200 establishes a network connection with the terminal 500 or the server 400 through the router 300. In one embodiment, the network node device 200 and the terminal 500 can establish a network connection through a local area network or a wide area network path. The network 200 is connected to interact with the terminal 500, so that the user can control the smart home device connected to the network node device to perform corresponding actions with the help of the terminal 500 or the smart device 100.
[0062] The terminal 500 may be a smart phone, a laptop, a personal computer, a tablet computer, a smart control panel or other smart devices that can be connected to a network, which is not limited here. The server may be implemented as an independent server or a server cluster composed of multiple servers.
[0063] Figure 2 This is a hardware structure diagram of the network node device provided in the embodiment of the present application. This network node device is suitable for Figure 1 The implementation environment shown.
[0064] It should be noted that the network node device is only an example adapted to the present application and cannot be considered to provide any limitation on the scope of use of the present application. The network node device cannot be interpreted as requiring dependence on or having Figure 2 One or more components of the exemplary network node device 200 shown in FIG.
[0065] The hardware structure of the network node device 200 may vary greatly due to differences in configuration or performance, such as Figure 2As shown, the network node device 200 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU, Central Processing Units) 270. Among them, the power supply 210 is used to provide working voltage for each hardware device on the network node device 200. The interface 230 includes at least one wired or wireless network interface 231, at least one serial-to-parallel conversion interface 233, at least one input and output interface 235 and at least one USB interface 237, etc., for communicating with external devices. The memory 250 is used as a carrier for resource storage, and the resources stored thereon include an operating system 251, an application 253 or data 255, etc. The application 253 is a computer program that completes at least one specific task based on the operating system 251. The central processing unit 270 may include one or more processors, and is configured to communicate with the memory 250 through a bus, and is used to calculate and process the massive data 255 in the memory 250.
[0066] In addition, the present application can also be implemented through hardware circuits or hardware circuits combined with software instructions. Therefore, the implementation of the present application is not limited to any specific hardware circuits, software, or a combination of the two.
[0067] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0068] The present application provides a device interaction method, including: a current node receives a target instruction sent by a user terminal through a target network link; and sends the target instruction to the corresponding smart device through a local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction.
[0069] See also Figure 3 A device interaction method is provided, and the method is applied to an electronic device as an example for explanation. The electronic device may be Figure 1 The network node device 200 in the embodiment specifically comprises the following steps:
[0070] S101. The current node receives a target instruction sent by a user terminal through a target network link.
[0071] Among them, the current node can be a type of network node device, which is a device that can independently send and receive data in the network. Network node devices are the basis for building a network, and realize the function of information communication by connecting various servers, PCs, application terminals, etc. Network node devices can be workstations, personal computers, servers, printers, routers, switches, gateways, etc. They all have independent network addresses and have the function of transmitting or receiving data.
[0072] As you can understand, a network link usually refers to a communication path connecting two or more network nodes in a computer network. It can be physical, such as a wired connection through twisted pair, optical fiber or coaxial cable; it can also be logical, such as a wireless connection through wireless signals. The role of a network link is to transmit data so that different network devices can communicate. During the data transmission process, the quality and characteristics of the network link have a direct impact on the network performance. The selection and configuration of network links need to consider many factors, including transmission rate, reliability, cost and environmental requirements.
[0073] Among them, the target network link can be a network link that directly connects the user terminal to the local network where the current node is located. The target network link allows the user terminal to communicate directly with the smart device without transiting through the cloud server. The current node can be a physical device such as a router or network node device, or it can be a logical functional unit that is responsible for handling communications and data forwarding in the network.
[0074] For example, a user opens a smart home app on a smartphone, selects a smart light bulb at home, and sends a command to turn off the light bulb. The smart home app establishes a direct network link with the smart gateway (current node) through the home's Wi-Fi network. The app sends a target command to turn off the smart light bulb to the smart gateway through this target network link. As the current node, the smart gateway receives the target command from the app. It can be seen that in an embodiment of the present application, the target network link allows the user's commands to be quickly and directly transmitted to the smart device, thereby reducing communication delays and improving the response speed of the system.
[0075] In some embodiments of the present application, the current node may be responsible for receiving control instructions from the user terminal and forwarding these instructions to the corresponding smart device; of course, the current node may also be used to manage the smart devices connected to it, including status monitoring, instruction issuance and data collection of the smart devices. The target instruction refers to the instruction sent by the user to the current node through the user terminal, such as the instruction to control the smart device, the instruction to change the configuration and the instruction to query the data, etc. Specifically, it may be the instruction to turn on or off the smart light bulb, the instruction to adjust the temperature of the smart thermostat, and the instruction to start or stop the smart security system.
[0076] In some embodiments of the present application, the current node may be a hub node. In a distributed network, certain nodes may be designated as hub nodes, which assume additional responsibilities, such as coordinating communications in the network, managing network topology, etc.
[0077] S102. Send the target instruction to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction.
[0078] The local network is a private network system limited to a specific geographical area (such as a home, a building, or a small office environment). In the embodiment of the present application, the local network can be a network environment that supports direct communication between multiple smart devices and user control terminals (such as smart phones, tablet computers, or central control panels), which can be a wireless network (such as Wifi or Zigbee) or a wired network.
[0079] After receiving the target instructions sent by the user terminal, the current node passes these instructions to the smart device. After receiving the target instructions, the smart device will perform corresponding operations according to the content of the instructions, such as turning on and off lights, adjusting temperature, etc. In some embodiments of the present application, the current node can not only issue instructions, but also monitor the execution status of the smart device to ensure that the instructions are executed correctly.
[0080] For example, specifically, a user wants to turn off the smart light bulb in the living room. Specifically, he can use the smart home application (user terminal) on the smartphone to turn off the smart light bulb in the living room. The node connected to the smartphone (current node) receives the shutdown instruction through the home Wi-Fi network (target network link) and forwards the shutdown instruction to the smart light bulb (smart device). After receiving the shutdown instruction, the smart light bulb executes the instruction, that is, turns off the light bulb.
[0081] In this embodiment, when the user interacts with the smart device through the user terminal, instructions can be issued directly through the local network, reducing the step of transferring through the cloud. In addition, since the instructions are transmitted within the local network, network delays are reduced, making the smart device respond more quickly.
[0082] In some embodiments of the present application, the step of “sending the target instruction to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction” may specifically include:
[0083] Determine whether the target smart device corresponding to the target instruction belongs to the smart device in the local network;
[0084] If the target smart device belongs to the local network, a control message is sent to the target smart device according to the target instruction to instruct the target smart device to execute the target instruction.
[0085] Among them, the control message is a data format containing instructions for executing specific operations. In the embodiment of the present application, the control message refers to the instruction data packet sent by the user end and forwarded to the smart device through the current node (such as a smart gateway or a hub node). The control message is the communication basis for realizing device control and status management. For example, in the smart home scenario, the control message can be used to guide the smart device to execute the user's instructions.
[0086] For example, a user can send a target instruction to the current node through a user terminal. After receiving the target instruction, the current node first needs to determine which smart device the instruction is for. Then, the current node checks whether the target smart device is connected to the local network. If the target smart device belongs to the local network, the current node will directly send a control message to the target smart device through the local network. The control message contains all the information required to execute the target instruction, such as operation type, parameters, etc. After receiving the control message, the target smart device performs the corresponding operation according to the content of the message, such as turning on and off the light, adjusting the volume, etc.
[0087] Specifically, the user selects a smart light bulb through the smart home application and sends a command: "Turn off the light bulb." After receiving the command, the current node first confirms that the "smart light bulb" is a device in the local area network. After confirmation, the current node will generate a control message, indicating the device to be turned off and the specific operation. The current node sends the control message to the smart light bulb through the home local area network. After receiving the control message, the smart light bulb executes the turn-off operation.
[0088] It can be seen that when the user interacts with the smart device through the user terminal, the current node determines whether the target smart device corresponding to the target instruction belongs to the smart device in the local network. If the target smart device belongs to the local network, the instruction can be directly issued through the local network, reducing the step of transiting through the cloud. In addition, since the instruction is transmitted within the local network, the network delay is reduced, making the smart device respond more quickly.
[0089] In some embodiments of the present application, the device interaction method may further include:
[0090] If data reported by a smart device in the local network is received, the reported data is transmitted to the user terminal via the target network link, so that the data reported by the smart device is received by the user terminal in real time.
[0091] The data reported by the smart device may include device status, data collected by sensors, device working hours, etc. In actual scenarios, the smart device can report its device status, data collected by sensors, device working hours, etc. to the local node. If the local node receives the data reported by the smart device in the local network, it will transmit the reported data to the user terminal through the target network link, so that the user terminal can receive the data reported by the smart device in real time.
[0092] When smart devices are working, data reporting is a key function that allows the system center or user terminal to monitor the device status, environmental conditions and other relevant information in real time. Therefore, it is understandable that when smart devices are working, they will collect data and need to report this data to the user terminal or system center.
[0093] For example, smart devices can regularly report their status and collected data at preset time intervals; when a smart device detects a specific event or condition, such as a motion sensor detecting motion, the device will immediately report the event information; when a smart device detects a change in device status, such as a smart light bulb switching from on to off, the device will report the change; when a battery-powered device is low on power, the smart device will report the battery status, indicating that it needs to be replaced or recharged; a user terminal or system center can send a request to request the device to immediately report its current status or specific data. When a smart device detects an error or abnormal status, such as overheating or failure, it will report relevant information for diagnosis and maintenance. The user sends a query request through the user terminal, and the smart device responds and reports the current status or data.
[0094] Specifically, the smart device sends the collected data to the current node through the local network (such as Wi-Fi, Zigbee, etc.). The current node transmits the data to the user terminal through the target network link, so that the user terminal can receive the data reported by the smart device in real time, so that the user can instantly understand the status of the smart device or obtain the latest information.
[0095] In some embodiments of the present application, the device interaction method may further include:
[0096] If the central node of the local area network to which the current node belongs meets the preset conditions, the leading node is determined among the central nodes based on the node information of each central node in the same local area network.
[0097] Among them, the hub node can refer to the key node in the network, which has more connections than other nodes and plays a vital role in the communication efficiency and stability of the network. These nodes are often located in the "core" or "center" of the network and play the role of information transmission and relay in the network. For example, in a backbone network, the hub node may be a major switching center or data center, responsible for handling a large amount of data traffic and routing decisions.
[0098] It can be understood that the hub node is a core component in a smart home or smart device network. The hub node is responsible for managing and coordinating smart devices in the network, including device discovery, registration, control and monitoring. As the central point of communication in the network, the hub node processes instructions from the user end (such as APP or central control screen) and forwards them to the corresponding smart device. The hub node is also responsible for routing data between devices to ensure that information is correctly transmitted in the network.
[0099] A leader node refers to one or more hub nodes with specific roles and responsibilities that are elected through dynamic negotiation in a distributed hub network. In the case of multiple hub nodes, these nodes will select a node with stronger processing power as the leader node through certain election logic and standards. The leader node usually has higher processing power, which may include stronger computing performance, richer hardware resources or more stable network connections.
[0100] The preset conditions may specifically include after the hub node is connected to the network, a new hub node is connected to the network, and the current leader node is abnormal, that is, after the hub node is connected to the network, a new hub node is connected to the network or the current leader node is abnormal, the leader node is determined in each hub node according to the node information of each hub node in the same local area network. It can be understood that a local area network (LAN) is a computer network whose coverage is usually limited to a relatively small geographical area, such as a home, office, school or small business, connecting multiple devices.
[0101] The process of updating the leader node can be specifically as follows:
[0102] First, collect and update the latest information of all hub nodes in the same LAN, and evaluate all hub nodes based on node information (such as processing power, network connection type, and hardware resources, etc.). Finally, based on the evaluation results, select the hub node that best meets the requirements as the new leader node.
[0103] It should be noted that this process is usually dynamic, meaning that the role of the leader node can be transferred according to changes in network conditions and node status. After the new leader node is determined, the leader node will communicate and synchronize with other hub nodes and smart devices in the LAN to ensure unified management and control of the network.
[0104] In this embodiment, by dynamically electing a leader node, it is ensured that when a current leader node fails, the network can be quickly restored and continue to operate, thereby reducing the risk of system interruption.
[0105] In some embodiments of the present application, the above method also includes: if it is identified that a new smart device is connected to the current node, the device information of the connected smart device is synchronized to other hub nodes through the local network.
[0106] When a new smart device is connected to the local network, the current node can recognize this change. Specifically, the current node synchronizes the relevant information of the newly connected smart device (such as device type, model, status, etc.) to other hub nodes through the local network.
[0107] After receiving the new device information, other hub nodes update their own device lists and network topology to ensure that the device information of the entire system remains up to date. The new smart device is integrated into the entire smart system, and users can operate and monitor the new device through the user terminal.
[0108] In some embodiments of the present application, the step of “if the hub node of the local area network to which the current node belongs meets the preset conditions, determining the leader node among the hub nodes according to the node information of each hub node in the same local area network” may specifically include:
[0109] If the central node of the local area network to which the current node belongs meets the preset conditions, the node information of each central node in the same local area network is obtained;
[0110] Determine the network access type and node processing capacity corresponding to each hub node based on the node information of each hub node;
[0111] Based on the network access type and node processing capability corresponding to each hub node, a leading node is determined in each hub node.
[0112] Among them, node information refers to the detailed data and status of each node in the distributed central network, which may include node identification, network address, processing capacity, network access type, etc.
[0113] Among them, the node ID is the unique identifier of each node in the network, which is used to distinguish different nodes; the network address of the node is used for network communication and device identification; the processing power of the node (also known as computing power), including hardware resources such as CPU performance and memory size; the network access type refers to the way the node is connected to the network, such as wired Ethernet, Wi-Fi, Zigbee, Bluetooth, etc.
[0114] If the hub node of the local area network to which the current node belongs meets the preset conditions, the current node can collect relevant information of all hub nodes in the same local area network. This includes the hardware configuration, software status, network connection details, etc. of each node. Then, evaluate the network access type of each hub node. For example, wired connections are usually more stable than wireless connections, which may affect the election priority of the node; at the same time, estimate the processing power of each node, including hardware resources such as CPU performance and memory size, as well as possible software optimization and updates. Finally, based on the network access type and processing power of each hub node, a comprehensive evaluation is performed to determine which node is most suitable to serve as the leader node.
[0115] For example, a smart home network has three hub nodes A, B, and C. Each node has different hardware configurations and network access types, as follows:
[0116] Node A: Wired network connection, high-performance processor, and large-capacity memory.
[0117] Node B: wireless network connection, medium-performance processor, medium-capacity memory.
[0118] Node C: Wired network connection, medium-performance processor, and small memory capacity.
[0119] Based on the above information, Node A can be selected as the leader node because it has a wired network connection and the highest processing power, making it the best fit for handling management and communication tasks in the network.
[0120] In this embodiment, by selecting a central node that meets the corresponding conditions as the leading node based on the network access type and node processing capacity of each central node, the most suitable central node to serve as the leading node is selected, which can effectively improve the stability of the network and the response speed of the device.
[0121] In some embodiments of the present application, the device interaction method may further include:
[0122] If the leading node is abnormal, the leading node is determined among the central nodes based on the node information of other central nodes in the local area network where the leading node is located.
[0123] Among them, leadership node abnormalities may include the following situations:
[0124] Hardware failure: A hardware component of the leader node (such as processor, memory, network interface card, etc.) fails.
[0125] Software error: An error occurs in the software or operating system running on the leader node, resulting in malfunction or service interruption.
[0126] Network connection problem: The leader node cannot connect to the local area network or communication with other hub nodes is blocked.
[0127] Power problem: The leader node fails to function properly due to unstable or interrupted power supply.
[0128] Performance degradation: Due to overload or other reasons, the processing power of the leader node is temporarily reduced and cannot meet the system demand.
[0129] The current node can detect this anomaly through the Multicast DNS (MDNS) and start the re-election process. For example, when an anomaly is detected (such as communication failure, heartbeat timeout, etc.), the re-election process is immediately triggered. After the nodes in the system receive the signal that the leader node is abnormal, the election process is started. Then, each hub node is evaluated according to the preset node election conditions to determine whether to enter the node election process.
[0130] Specifically, the node election conditions may include: there must be sufficient computing resources to handle communication and data management tasks in the network, there must be a stable and reliable network connection (such as wired connections are generally considered to be more reliable than wireless connections), the node must be online and able to respond to network requests and communications in a timely manner, the node must support the communication protocols used by the network, such as MQTT, CoAP, HTTP, etc., and the node's current load is low and there are sufficient resources to assume additional leadership responsibilities. Nodes entering the node election vote and negotiate with each other, and can select the most suitable node as the new leader node based on at least one of its own processing power, network connection stability, hardware resources, and other factors.
[0131] The newly elected leader node broadcasts its status to the entire network, notifying all the central nodes that the leader node has been changed. The new leader node synchronizes the status with other nodes in the network to ensure data consistency when taking over control. The nodes in the network update their communication and control logic and operate through the new leader node.
[0132] Each hub node participates in the election of a new leader node based on its performance indicators and network status. Eventually, a hub node with the highest processing power and the most stable network connection is selected as the new leader node, which immediately begins to manage all smart devices in the network and ensures the execution of user control commands and the update of device status. Through this mechanism, it can flexibly respond to abnormal situations of the leader node and ensure the stable operation and efficient management of the entire network.
[0133] It should be noted that in the smart home system, users may set one or more control schemes, which automatically perform operations based on specific trigger conditions. Therefore, when the current node identifies the trigger conditions that meet the preset control scheme based on the data reported by the smart device, it generates corresponding target instructions to instruct the smart device to execute the target instructions.
[0134] In this embodiment, through the above solution, in the intelligent control scenario, the reliance on manual operation is reduced, saving the user's time and energy.
[0135] In some embodiments of the present application, the device interaction method may further include:
[0136] If the current node identifies the trigger conditions that meet the preset control scheme based on the data reported by the smart device, it generates a target instruction for the smart device based on the preset control scheme and sends the target instruction to the smart device to instruct the smart device to execute the target instruction.
[0137] Among them, the control scheme is a series of automated instructions customized by the user according to personal preferences and needs, which is used to trigger corresponding equipment operations under specific conditions. The trigger condition is a key component of the preset control scheme, which defines when and under what circumstances the automated operation should be performed.
[0138] For example, specifically, in a smart home system, there is a smart temperature sensor and a smart thermostat. The user sets a preset control scheme to automatically turn on the heater when the indoor temperature is below 20°C. The smart temperature sensor continuously monitors the indoor temperature and reports the data to the current node in real time. When the temperature sensor detects that the indoor temperature is below 20°C, it reports this data. After receiving the data, the current node identifies the trigger conditions that meet the preset control scheme. Subsequently, the current node generates an instruction to turn on the heater (i.e., the target instruction). Then, the current node sends the target instruction to the smart thermostat. After receiving the target instruction, the smart thermostat automatically turns on the heating function to increase the indoor temperature.
[0139] Through this automated process, the system can automatically adjust the home environment according to environmental changes and preset conditions without human intervention, improving comfort and convenience.
[0140] In the smart home scenario, trigger conditions enable the smart home system to flexibly respond to various situations and achieve true automation and intelligence. Users can set a variety of trigger conditions according to actual needs to make the home environment more comfortable, safe and energy-saving. The smart home system can respond to environmental changes and user needs in real time to achieve highly automated and intelligent home management.
[0141] The above is the device interaction process provided in the embodiment of the present application.
[0142] From the above, it can be seen that the embodiment of the present application provides a device interaction method. After the current node receives the target instruction sent by the user terminal through the target network link, the target instruction is sent to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction. Therefore, when the user interacts with the smart device through the user terminal, the instruction can be directly sent through the local network, reducing the step of transiting through the cloud. In addition, since the instruction is transmitted within the local network, the network delay is reduced, making the response of the smart device more rapid.
[0143] See also Figure 4 A device interaction method is provided, and the method is applied to an electronic device as an example for explanation. The electronic device may be Figure 1 The terminal in the embodiment specifically comprises the following steps:
[0144] S201. Obtain a target network topology structure.
[0145] Among them, the target network topology structure refers to the physical or logical layout of a network, which describes how the various components in the network are connected and communicated with each other. The target network topology structure includes target network links that directly connect the hub nodes to the user terminals.
[0146] For example, a user can initiate a request through a specific application or interface on a user terminal (such as a smart phone, tablet computer, or computer) to obtain the current network topology information. The user terminal establishes communication with one or more central nodes in the system (such as smart network node devices or smart home centers) through a local area network. After receiving the network topology data, the user terminal displays it to the user.
[0147] In some embodiments of the present application, the network topology may change as devices are added, removed or their status changes. The user terminal may periodically request updates or receive real-time update notifications from the hub node.
[0148] S202. Send the target instruction to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
[0149] Among them, after the user issues a control instruction through the user terminal, the user terminal sends the target instruction to the central node through the target network link. This link can be a wireless (such as Wi-Fi, Zigbee, Bluetooth, etc.) or a wired connection. After the central node receives the target instruction from the user terminal, it forwards the received target instruction to the corresponding smart device. After the smart device receives the target instruction issued by the central node, it performs the corresponding operation. This may include turning on and off lights, adjusting the temperature, starting the security system, etc. For example, the user turns off the smart light in the living room through the smart home application (user terminal). After the user opens the smart home application, selects the smart light in the living room, and sends a shutdown instruction (target instruction). The smart home application sends the shutdown instruction to the smart network node device (central node) through the home Wi-Fi network (target network link). After the smart network node device receives the shutdown instruction, it forwards the instruction to the smart light (smart device) in the living room through the home network. The smart light receives the shutdown instruction and performs the shutdown operation.
[0150] In some embodiments of the present application, the smart light feeds back the result of the shutdown operation to the smart network node device, and the smart network node device sends the result back to the smart home application, and the application displays the status of the smart light being turned off. In the above manner, when the user interacts with the smart device through the user terminal, the instruction can be directly issued through the local network, reducing the steps of transferring through the cloud, and because the instruction is transmitted within the local network, the network delay is reduced, making the response of the smart device faster.
[0151] In some embodiments of the present application, the device interaction method may further include:
[0152] Determine whether the target smart device belongs to the local network;
[0153] If the target smart device belongs to the local network, the data reported by the target smart device is received from the central node through the network link;
[0154] If the target smart device does not belong to the local network, the data reported by the target smart device is received from the cloud.
[0155] After sending the target command to the hub node through the target network link, the hub node first needs to determine whether the target smart device is connected to the local network. Based on the network location of the smart device, the hub node decides whether to receive the data reported by the device through the local network or the cloud. If the smart device is in the local network, the hub node receives data directly from the smart device. If the smart device is not in the local network, the hub node receives data through the cloud service.
[0156] In a local network, data transmission is more direct and fast, while in a non-local network, cloud services provide the flexibility of remote access and data synchronization.
[0157] In some cases, you may need to change the leader node, for example, if the current leader node fails, its performance no longer meets requirements, or the network structure changes.
[0158] After detecting that the leader node has changed, the central node is updated: the central nodes (non-leader nodes) in the system need to update their information to re-elect a new leader node. The central node establishes a communication connection with the new leader node in order to forward instructions from the user terminal and receive status updates from the smart device. The user terminal is also synchronized to the new leader node to ensure that the user can continue to control the smart devices in the network. The new leader node takes over the communication responsibilities, and the user terminal communicates with the smart device through the new leader node. As a result, users and other devices will hardly feel the process of leader node change, thereby achieving a seamless user experience, and timely updating of the leader node can prevent network communication interruptions and enhance the stability of the entire system.
[0159] The above is the device interaction process provided in the embodiment of the present application.
[0160] From the above, it can be seen that the embodiment of the present application provides a device interaction method. After obtaining the target network topology structure, the target instruction is sent to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction. Therefore, when the user interacts with the smart device through the user terminal, the instruction can be directly issued through the local network, reducing the step of transiting through the cloud. In addition, since the instruction is transmitted within the local network, the network delay is reduced, making the response of the smart device faster.
[0161] In order to further understand the device interaction solution of this application, the following multi-device interaction scenario is used as an example for further explanation. Figure 5 The present application provides a device interaction system, including smart device (such as zigbee device) 1, smart device (such as zigbee device) 2, smart device (such as zigbee device) 3, smart device (such as zigbee device) 4, gateway (central node / leader node) 1, gateway (central node) 2, gateway 3, gateway 4, router, user terminal (such as APP end) and cloud.
[0162] Among them, the user terminal can be directly connected to the network link of the leader node 1 in the distributed central network, which is dynamically negotiated by all nodes in the network. For example, when the user terminal wants to control the zigbee device 3, the user terminal finds that the zigbee device 3 is in the central network topology, and the user terminal directly communicates with the leader node 1, and the leader node 1 sends the control message to the zigbee device 3. Because it is a local area network communication, the delay of the entire control process will be greatly reduced.
[0163] For example, when Zigbee device 2 reports data, the user terminal finds that Zigbee device 2 is in the central network topology, then the user terminal disconnects from the cloud, directly receives data from Zigbee device 2 from leader node 1 and updates the display interface.
[0164] Since the gateway 4 and the zigbee device 4 are not in the central network topology, the user terminal directly controls the device and obtains data through the cloud transfer solution.
[0165] Among them, Gateway 3 is a common gateway node, which randomly finds a hub gateway in the hub network to connect to. Hub Node 1 and Hub Node 2 are hub nodes, because they also have gateway functions, so they are also gateway nodes. The leader node election occurs between hub nodes, and the election event occurs only after the hub nodes establish connections with each other.
[0166] The prerequisite for "electing a node with stronger processing capabilities to act as the leader node" is that there are two or more hub nodes that have established communication connections in advance. If there is only one hub node in the entire network, it is the leader node by default.
[0167] If a new ordinary gateway (a gateway without a hub function) is connected to a hub node, the hub node will detect the new gateway connection and report its own topology to the cloud. The cloud will then aggregate and update the topology to all hub nodes, regardless of whether they are leading nodes.
[0168] When the user terminal communicates with the central leadership node, the user terminal discovers the leadership node in the local area network through the MDNS protocol.
[0169] The process of discovering the leader node can be as follows:
[0170] The leader node is a node that is elected through arbitration and negotiation among several hub nodes in the same LAN through the MDNS protocol. The specific logic of the election is as follows:
[0171] Nodes with stronger processing capabilities are elected to serve as leader nodes. For example, nodes connected through wired networks have greater processing capabilities than nodes connected through wireless networks, nodes with more abundant hardware resources have greater processing capabilities than nodes with limited hardware resources, and so on.
[0172] Finally, a node with the highest comprehensive score is elected to act as the leader.
[0173] The leader node is the entry point for user terminal nodes to communicate with Zigbee devices, gateways, Bluetooth devices, security cameras, doorbells and other smart home devices. If a leader node suddenly goes down, other hub nodes in the LAN will continue to negotiate and elect a new node to act as the leader.
[0174] After the leader node is discovered, the communication process between the user terminal and the leader node can be as follows: Figure 6 As shown, the specific details can be as follows:
[0175] First, the user terminal performs a checkin operation on the leader node, that is, the user terminal and the leader node perform handshake pairing and encrypted communication operations. After receiving the information sent by the user terminal, the leader node feeds back a response message to the user terminal, that is, the checkin_done operation.
[0176] Then, the user terminal initiates a keepalive operation to the leader node, that is, the user terminal performs a heartbeat keepalive operation with the leader node. After receiving the heartbeat detection information sent by the user terminal, the leader node sends feedback information to the user terminal, that is, a keepalive_done operation.
[0177] Furthermore, the user terminal initiates a read operation to the leader node, that is, an operation to read the properties of the device in the central network topology. After receiving the request sent by the user terminal, the leader node feeds back corresponding information to the user terminal, that is, a read_done operation.
[0178] The user terminal can also initiate a write operation to the leader node, that is, a control operation or data reading operation on the device in the central network topology. After receiving the request sent by the user terminal, the leader node feeds back the corresponding information to the user terminal, that is, the write_done operation.
[0179] Secondly, the user terminal can also initiate a fetch operation to the leader node, that is, an operation to query the historical data of the devices in the central network topology. After receiving the request sent by the user terminal, the leader node feeds back the corresponding information to the user terminal, that is, the fetch_done operation.
[0180] In addition, the user terminal can also initiate a scene operation to the leader node, that is, an operation to perform scene control on the devices in the central network topology. After receiving the request sent by the user terminal, the leader node feeds back the corresponding information to the user terminal, that is, the scene_done operation.
[0181] in:
[0182] 1. Checkin operation: Checkin usually means that before a new session connection is established, the APP sends a check request to the central leader node to ensure that the identity and permissions of the APP are valid and whether the leader node can respond to the APP request normally. This check request usually includes some verification information, such as username and password or other security tokens.
[0183] 2. The purpose of the Checkin operation is to ensure the security and validity of the session connection. By performing the Checkin operation, the server (leader node) can verify the identity and permissions of the client (app) to prevent unauthorized access or attacks, and avoid the waste of server resources caused by invalid requests.
[0184] 3. Keepalive operation: The purpose of keepalive is to send some special detection messages to detect whether the connection is still active when there is no data transmission for a long time. It can maintain the validity of the network connection between the APP and the hub and prevent the connection from being interrupted or closed due to long-term idleness.
[0185] 4. Read operation: When you want to view the Figure 2 When the status of the zigbee device 2 is shown in the figure, if the device is a smart switch, the relay status of the switch needs to be read in the app. At this time, it is necessary to use the read operation to read the relay switch status of the zigbee device 2 from the central leader node. The central node then reads from the gateway 3 through the protocol in the local area network and returns the result to the app.
[0186] 5. Write operation: Same as above, when you need to control in the app Figure 2 When the state of the zigbee device 2 shown in the figure is displayed, if the device is a smart switch, the relay state of the switch needs to be controlled in the app. At this time, the relay switch state of the zigbee device 2 needs to be written to the central leader node through the Write operation. The central node then writes the switch state of the relay to the gateway 3 through the protocol in the local area network, and the gateway converts the control command into the zigbee protocol and sends it to the zigbee device 2, and then returns the control result to the app through the central leader.
[0187] 6. Fetch operation: When you need to view the Figure 2When the device switch log of the zigbee device 2 shown in the figure is recorded, the app queries the leader hub for historical log records through the fetch operation (when the device has a switch change, the status will be reported to the hub network, and each node in the hub network is responsible for storing the historical operation records of the device). The leader hub summarizes the log records saved by all nodes in the local area network and returns them to the app for display.
[0188] Scene operation: Scene operation is to execute a specified scene. For example, the app sets a home scene: "Open Figure 2 As shown in the figure, turn on Zigbee device 2 and Zigbee device 3. Setting this scene will generate a unique scene ID: such as 1245223. When you need to trigger this scene, the app will send the scene ID: 1245223 to the leader hub through the scene message. After receiving the command, the leader hub will directly execute the scene (send the corresponding command to the device and gateway).
[0189] In practical applications, such as Figure 7 As shown, when the user opens the client (such as APP, web control panel, etc.), the client obtains the topology of the entire central network from the cloud. The client sends a broadcast message (containing a special field to identify whether direct connection is supported). When there is an available central node in the central network topology, the central leader node returns a message to the client. When the devices in the entire central network are subsequently controlled and the data reported by the devices is updated, they will communicate directly with the central leader node and no longer be transferred through the cloud (wide area network). When there is no available central node in the central network topology (such as the client and the device are not in the same LAN, or the LAN devices are not directly interoperable), no central leader node returns a message to the client. At this time, the client connects to the cloud (wide area network) and sends control commands to the devices in the central network and updates the data reported by the devices through the cloud. Devices under the central network also update data to the cloud by default.
[0190] Through this design, the smart home system can flexibly adapt to different network environments and user needs, ensuring that users can effectively manage and control smart devices at home whether they are at home or away.
[0191] See also Figure 8 , Figure 8 This is a schematic diagram of the structure of a device interaction apparatus provided in an embodiment of the present application. The device interaction apparatus includes a receiving module 301 and a sending module 302. Specifically, it can be as follows:
[0192] The receiving module 301 is used for the current node to receive a target instruction sent by a user terminal through a target network link.
[0193] The target network link is a network link that directly connects the user terminal to the local network where the current node is located.
[0194] The sending module 302 is used to send the target instruction to the corresponding smart device through the local network between the current node and each smart device, so as to instruct the corresponding smart device to execute the target instruction.
[0195] In some embodiments of the present application, the sending module 302 may specifically include:
[0196] A first determination unit, configured to determine whether a target smart device corresponding to a target instruction belongs to a smart device in a local network;
[0197] The sending unit is used to send a control message to the target smart device according to the target instruction if the target smart device belongs to the local network, so as to instruct the target smart device to execute the target instruction.
[0198] In some embodiments of the present application, the sending module 302 may further include:
[0199] an uploading unit, configured to transmit the reported data to the user terminal via a target network link if the data reported by the smart device in the local network is received, so that the user terminal receives the data reported by the smart device in real time;
[0200] The synchronization unit is used to synchronize the device information of the connected smart device to other central nodes through the local network if it is recognized that a new smart device is connected to the current node.
[0201] In some embodiments of this application, please refer to Fig. 9 The device interaction apparatus of the present application may further include a determination module 303, which may be used to: if the central node of the local area network to which the current node belongs meets the preset conditions, determine the leading node in each central node based on the node information of each central node in the same local area network.
[0202] In some embodiments of the present application, the determination module 303 may specifically include:
[0203] An acquisition unit, configured to acquire node information of each central node in the local area network to which the current node belongs if the central node of the local area network meets a preset condition;
[0204] A second determining unit, configured to determine the network access type and node processing capability corresponding to each hub node according to the node information of each hub node;
[0205] The third determination unit is used to determine the leading node among the central nodes based on the network access type and node processing capability corresponding to each central node.
[0206] In some embodiments of the present application, the third determination unit is further specifically used to: if the leading node is abnormal, determine the leading node among the central nodes based on the node information of other central nodes in the local area network where the leading node is located.
[0207] In some embodiments of the present application, the sending module 302 can also be specifically used for: if the current node identifies that the trigger condition of the preset control scheme is met based on the data reported by the smart device, a target instruction for the smart device is generated based on the preset control scheme, and the target instruction is sent to the smart device to instruct the smart device to execute the target instruction.
[0208] As can be seen from the above, an embodiment of the present application provides a device interaction apparatus, wherein the receiving module 301 is used for the current node to receive the target instruction sent by the user terminal through the target network link, and the sending module 302 is used to send the target instruction to the corresponding smart device through the local network between the current node and each smart device, so as to instruct the corresponding smart device to execute the target instruction. Therefore, when the user interacts with the smart device through the user terminal, the instruction can be directly sent through the local network, reducing the step of transiting through the cloud. In addition, since the instruction is transmitted within the local network, the network delay is reduced, making the response of the smart device faster.
[0209] See also Fig.10 , Fig.10 This is a schematic diagram of the structure of a device interaction apparatus provided in an embodiment of the present application. The device interaction apparatus includes an acquisition module 401 and a sending module 402. Specifically, it can be as follows:
[0210] The acquisition module 401 is used to acquire the target network topology.
[0211] The target network topology structure includes a target network link that directly connects the hub node to the user terminal.
[0212] The sending module 402 is used to send the target instruction to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
[0213] In some embodiments of the present application, the sending module 402 may also be used to:
[0214] Determine whether the target smart device belongs to the local network;
[0215] If the target smart device belongs to the local network, receiving data reported by the target smart device from the hub node via the network link;
[0216] If the target smart device does not belong to the local network, the data reported by the target smart device is received from the cloud.
[0217] In some embodiments of the present application, the sending module 402 may also be specifically used for: if the leading node is changed, connecting to the changed leading node through the central node so that the user terminal can communicate with other smart devices.
[0218] From the above, it can be seen that the embodiment of the present application provides a device interaction apparatus. After the acquisition module 401 acquires the target network topology structure, the sending module 402 sends the target instruction to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction. Therefore, when the user interacts with the smart device through the user terminal, the instruction can be directly issued through the local network, reducing the step of transiting through the cloud. In addition, since the instruction is transmitted within the local network, the network delay is reduced, making the response of the smart device faster.
[0219] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an intention recognition method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or it can be a computer device.
[0220] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0221] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0222] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0223] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0224] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0225] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0226] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A device interaction method, characterized in that: include: The current node receives a target instruction sent by a user terminal through a target network link; the target network link is a network link that directly connects the user terminal to a local network where the current node is located; The target instruction is sent to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction.
2. The device interaction method according to claim 1, characterized in that: The sending the target instruction to the corresponding smart device through the local network between the current node and each smart device to instruct the corresponding smart device to execute the target instruction includes: Determine whether the target smart device corresponding to the target instruction belongs to the smart device in the local network; If the target smart device belongs to the local network, a control message is sent to the target smart device according to the target instruction to instruct the target smart device to execute the target instruction.
3. The device interaction method according to claim 2, characterized in that: Also includes: If data reported by the smart device in the local network is received, the reported data is transmitted to the user terminal via the target network link, so that the data reported by the smart device is received by the user terminal in real time.
4. The device interaction method according to claim 1, characterized in that: Also includes: If the central node of the local area network to which the current node belongs meets the preset conditions, the leading node is determined among the central nodes based on the node information of each central node in the same local area network.
5. The device interaction method according to claim 4, characterized in that: If the central node of the local area network to which the current node belongs meets the preset conditions, a leading node is determined among the central nodes according to the node information of the central nodes in the same local area network, including: If the central node of the local area network to which the current node belongs meets the preset conditions, the node information of each central node in the same local area network is obtained; Determine the network access type and node processing capacity corresponding to each hub node according to the node information of each hub node; Based on the network access type and node processing capability corresponding to each of the central nodes, a leading node is determined among the central nodes.
6. The device interaction method according to claim 4, characterized in that: Also includes: If the leading node is abnormal, the leading node is determined among the central nodes based on the node information of other central nodes in the local area network where the leading node is located.
7. The device interaction method according to claim 4, characterized in that: Also includes: If the current node identifies that the trigger conditions of the preset control scheme are met based on the data reported by the smart device, a target instruction for the smart device is generated based on the preset control scheme, and the target instruction is sent to the smart device to instruct the smart device to execute the target instruction.
8. A device interaction method, characterized in that: include: Acquire a target network topology structure, wherein the target network topology structure includes a target network link directly connecting a hub node and a user terminal; The target instruction is sent to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
9. The device interaction method according to claim 8, characterized in that: Also includes: Determine whether the target smart device belongs to the local network; If the target smart device belongs to the local network, receiving the data reported by the target smart device from the hub node via the network link; If the target smart device does not belong to the local network, the data reported by the target smart device is received from the cloud.
10. The device interaction method according to claim 8, characterized in that: Also includes: If the leading node is changed, the central node is connected to the changed leading node so that the user terminal can communicate with other smart devices.
11. A device interaction apparatus, characterized in that: include: A receiving module, used for the current node to receive a target instruction sent by a user terminal through a target network link; The target network link is a network link that directly connects the user terminal to the local network where the current node is located; The sending module is used to send the target instruction to the corresponding smart device through the local network between the current node and each smart device, so as to instruct the corresponding smart device to execute the target instruction.
12. A device interaction apparatus, characterized in that: include: An acquisition module, used to acquire a target network topology structure, wherein the target network topology structure includes a target network link directly connecting a hub node and a user terminal; The sending module is used to send the target instruction to the central node through the target network link to instruct the central node to send the target instruction to the corresponding smart device to instruct the corresponding smart device to execute the target instruction.
13. An electronic device comprising at least one memory and at least one processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.