Network processing method, network processing system, electronic device and storage medium
The network processing method in smart home systems automatically selects a proxy node from slave nodes to maintain network connectivity and functionality when the central node fails, addressing communication disruptions and enhancing efficiency.
Patent Information
- Application Number
- CN202111536661.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In smart home networks with a single coordinator gateway, failure of the gateway leads to communication disruption and loss of automatic linkage between devices, as the entire network loses connectivity with the external network.
A network processing method that selects a proxy node from multiple slave nodes to assume the data transmission function of the central node when its status is abnormal, based on device authority information, ensuring continuous network operation.
Ensures uninterrupted data transmission and maintains network quality and user experience by automatically switching to a proxy node when the central node fails, reducing network congestion and enhancing communication efficiency.
Smart Images

Figure CN114157559B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and in particular to a network processing method, a network processing system, an electronic device and a computer storage medium. Background Art
[0002] With the continuous development of the smart home industry, the concept of whole-house intelligence has been deeply rooted in people's minds, and the types and number of smart home devices in users' homes are constantly increasing. At present, most smart home product technologies are based on wireless, low-speed, low-power Mesh networks. For example, the Zigbee local area network and the external network can be connected through the coordinator gateway, so that the devices in the home can be controlled and monitored remotely. However, since there is usually only one coordinator gateway in a local area network, if the coordinator gateway fails, there will be the following problems in actual use: the devices in the entire local area network cannot communicate with the external network, and the automatic linkage function between devices fails. Summary of the invention
[0003] In order to solve the existing technical problems, the present application provides a network processing method, a network system, an electronic device and a storage medium.
[0004] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a network processing method, including:
[0006] Get the network status of the central node in the current network;
[0007] If the current network state of the central node is abnormal, a proxy node for acting as a proxy for the central node is selected from the multiple slave nodes based on the device authority information corresponding to the multiple slave nodes in the current network;
[0008] The proxy information is broadcasted in the current network by the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0009] In a second aspect, an embodiment of the present application provides a network processing system, the network processing system comprising a central node and a plurality of slave nodes; wherein:
[0010] The central node and / or the slave node are configured as follows:
[0011] Get the network status of the central node in the current network;
[0012] If the current network state of the central node is abnormal, based on the device authority information corresponding to the multiple slave nodes in the current network, electing a proxy node for acting as the proxy for the central node from the multiple slave nodes; and
[0013] The proxy information is broadcasted in the current network by the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0014] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0015] Periodically obtain the heartbeat packet data sent by the central node in the current network;
[0016] Determine the network status of the central node according to the interval duration of receiving the heartbeat packet data;
[0017] If the heartbeat packet data is not obtained within the interval time, it is determined that the current network status of the central node is abnormal.
[0018] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0019] Periodically obtain the data transmission speed of the data transmitted by the central node in the current network;
[0020] Determining the network status of the central node according to the data transmission speed of the central node and the target transmission demand under the current network;
[0021] If the data transmission speed does not meet the target transmission requirement, it is determined that the current network status of the central node is abnormal.
[0022] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0023] Synchronously reporting corresponding device authority information in the current network through each of the slave nodes;
[0024] Each of the slave nodes elects a proxy node for acting as a proxy for the central node from a plurality of the slave nodes based on the target election strategy and the device authority information of each slave node.
[0025] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0026] Broadcasting the proxy information of the proxy node in the current network according to a preset period;
[0027] After each slave node in the current network receives the proxy information broadcast by the proxy node, each slave node updates the message data to be sent to the central node to be sent to the proxy node based on the proxy information, so as to execute the data transmission function of the central node in the current network through the proxy node.
[0028] In some embodiments, the central node 1 and / or the slave node 2 are further configured as:
[0029] If the network status of the central node returns to normal, the proxy node broadcasts proxy cancellation information in the current network to instruct the central node to perform a data transmission function in the current network.
[0030] In some embodiments, the central node 1 and / or the slave node 2 are further configured as:
[0031] Receiving, through the proxy node, message data reported by the scene triggering device in the current network;
[0032] If the message data meets the triggering condition of the automation scenario, the proxy node sends the corresponding target action instruction to the action execution device under the automation scenario according to the configuration data of the automation scenario to instruct the action execution device to execute the target action.
[0033] In a third aspect, an embodiment of the present application provides a network processing device, including:
[0034] The acquisition module is used to obtain the network status of the central node in the current network;
[0035] An election module, configured to elect a proxy node for acting as the proxy for the central node from a plurality of slave nodes based on device authority information corresponding to a plurality of slave nodes in the current network if the current network state of the central node is abnormal;
[0036] The broadcast module is used to broadcast the proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0037] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the network processing method described in any embodiment of the present application is implemented.
[0038] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a controller, the network processing method described in any embodiment of the present application is implemented.
[0039] The network processing method, network processing system, electronic device and storage medium provided by the above embodiments of the present application obtain the network status of the central node in the current network; if the current network status of the central node is abnormal, based on the device authority information corresponding to the multiple slave nodes in the current network, a proxy node for acting as the proxy for the central node is selected from the multiple slave nodes; the proxy information is broadcast in the current network by the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network. In this way, when the network status of the central node in the network is abnormal, a proxy node for acting as the proxy for the central node is automatically selected from the multiple slave nodes to ensure that data transmission is not interrupted, thereby improving network quality or communication efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an application environment applicable to an embodiment of the present application;
[0041] Figure 2 This is a flowchart of a network processing method in an embodiment of the present application;
[0042] Figure 3 This is a flowchart of a network processing method in another embodiment of the present application;
[0043] Figure 4 Schematic diagram of message data transmission in one embodiment of the present application Figure 1 ;
[0044] Figure 5 This is another example of message data transmission in this application. Figure 1 ;
[0045] Figure 6 This is a schematic diagram of the structure of a network processing device in an embodiment of the present application;
[0046] Figure 7 It is a schematic diagram of the structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solution of the present application is further elaborated in detail below in conjunction with the accompanying drawings and specific embodiments of the specification.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the implementation of this application. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0049] In the description of the present application, it should be understood that the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating positions or positional relationships, are based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as a limitation on the present application. In the description of the present application, unless otherwise specified, "multiple" means two or more.
[0050] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0051] See also Figure 1 , Figure 1 The network processing method provided in the embodiment of the present application can be applied to the following: Figure 1 In the network processing system shown, the network processing system includes a central node 1 and a plurality of slave nodes 2 .
[0052] Among them, the central node 1 can be used to create a wireless mesh network, and the slave node 2 can be used to join the wireless mesh network. The central node 1 can be specifically a coordinator node, etc., and the second device 2 can be specifically a gateway node, such as a router gateway node, etc., which is not limited in the embodiments of the present application. When the central node 1 or the slave node 2 has an abnormality in the network status of the central node 1, based on the device authority information corresponding to the multiple slave nodes 2 under the current network, a proxy node for acting as the agent for the central node 1 is selected from the multiple slave nodes 2, and the proxy information is broadcasted in the current network through the proxy node to indicate that the data transmission function of the central node 1 is executed by the proxy node in the current network to ensure that data transmission is not interrupted.
[0053] Optionally, the wireless mesh network is a ZigBee wireless mesh network, and the central node 1 and the slave node 2 can communicate via a ZigBee link. It is understood that the above application environment is only an exemplary description made to facilitate understanding of the following embodiments, and does not constitute any limitation on the application environment in which the embodiments of the present application can actually be implemented.
[0054] In order to facilitate understanding of the network processing method provided in the embodiments of the present application, the nouns or concepts that appear or are mentioned in the embodiments of the present application are first explained.
[0055] The current network includes multiple network nodes, and the network nodes include a central node and multiple slave nodes; wherein the central node may specifically be a coordinator node, and the slave node may specifically be a gateway node.
[0056] The current network refers to a network in which various devices and / or various nodes currently communicate with each other, for example, the current network may be a ZigBee wireless mesh network, etc.; the current network may be created by a central node.
[0057] A central node refers to a node device that has a coordinator function in the network and a function of communicating with the external network. Specifically, it can also be a node device that can be used to execute automation scene functions. For example, a central node may include a coordinator, a router, a gateway, and other node devices.
[0058] A slave node refers to a node that has a coordinator function and forwards messages in the network. Specifically, it can be a node that has an automated scene proxy execution function in the network. For example, a central node can also include node devices such as a coordinator, a router, a gateway, a camera with a gateway function, and other intelligent devices with a coordination function.
[0059] An agent node is a node device that temporarily acts as a central node in the network and has the function of a coordinator and the ability to communicate with the external network.
[0060] The proxy information refers to the proxy information broadcasted by the proxy node in the network, and specifically may be the proxy broadcast information indicating that the proxy node acts as a central node.
[0061] See also Figure 2 , a network processing method provided by an embodiment of the present application, which can be applied to Figure 1 The network nodes shown are Figure 1 The central node 1 and / or the slave node 2 in the embodiment may be a coordinator node and / or a gateway node. The network processing method includes but is not limited to S101, S103 and S105, which are specifically described as follows:
[0062] S101, obtaining the network status of the central node in the current network.
[0063] The purpose of the network node obtaining the network status of the central node in the current network is to detect whether the current network status of the central node is normal or abnormal. In this embodiment, one or more methods can be used to obtain the network status of the central node in the current network. For example, the network node can detect whether the interval length of the central node sending heartbeat packet data or the data transmission speed of the transmission data meets the corresponding requirements, so as to obtain the network status of the central node in the current network based on the detection result.
[0064] S103, if the current network state of the central node is abnormal, based on the device authority information corresponding to the multiple slave nodes in the current network, a proxy node for acting as a proxy for the central node is selected from the multiple slave nodes.
[0065] It is understandable that when the current network status of the central node is abnormal, it means that the current central node is invalid, that is, it cannot perform the data transmission function normally, which will cause the devices in the wireless mesh network to be unable to communicate with the external network through the central node, and the devices cannot be automatically linked, etc. At this time, the network node can select a proxy node from multiple slave nodes to act as the central node based on the device permission information corresponding to multiple slave nodes under the current network.
[0066] The device authority information includes but is not limited to priority, weight, data version, address information, etc. It should be noted that the abnormality of the current network status of the central node may be caused by the central node itself or external factors that cause the central node's network to be disconnected.
[0067] S105: Broadcast proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0068] It can be understood that after the network node selects a proxy node to act as the central node from multiple slave nodes, the proxy node can broadcast proxy information in the current network to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0069] The proxy information may include the name of the proxy node and the version of the automation scene data, MAC address, contention weight, etc. It should be noted that since the online or offline status of the slave nodes in the current network is dynamic, broadcasting the proxy information only once in the current network may cause some slave nodes to be unable to obtain the proxy information in time. Therefore, the network node broadcasts the proxy information in the current network through the proxy node, which may be broadcasting the proxy information in the current network through the proxy node at regular intervals, so as to ensure that all slave nodes in the current network are able to obtain the proxy information as much as possible, thereby further improving the network quality or communication efficiency.
[0070] In the above embodiment of the present application, the network node obtains the network status of the central node in the current network. If the current network status of the central node is abnormal, based on the device authority information corresponding to the multiple slave nodes in the current network, a proxy node for acting as the central node is selected from the multiple slave nodes, and the proxy information is broadcast in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network. When the network status of the central node in the network is abnormal, a proxy node for acting as the central node is automatically selected from the multiple slave nodes to ensure that data transmission is not interrupted, thereby improving network quality or communication efficiency and user experience.
[0071] In some embodiments, obtaining the network status of the central node in the current network includes:
[0072] Periodically obtain the heartbeat packet data sent by the central node in the current network;
[0073] Determine the network status of the central node according to the interval duration of receiving the heartbeat packet data;
[0074] If the heartbeat packet data is not obtained within the interval time, it is determined that the current network status of the central node is abnormal.
[0075] It is understandable that in order to regularly notify the other party of its own status, the central node and each slave node can send heartbeat packet data to each other. For example, the central node can send heartbeat packet data to each slave node at preset time intervals, and after the slave node receives the heartbeat packet data sent by the central node, it should reply the same heartbeat packet data to the central node, or the slave node can send heartbeat packet data to the central node at preset time intervals.
[0076] After the central node receives the heartbeat packet data sent by the slave node, it should reply the same heartbeat packet data to the slave node. If the slave node does not receive the heartbeat packet data within the interval time, it means that the current network status of the central node is abnormal. The interval time can be set according to the actual situation, for example, it can be set to 20 seconds, 40 seconds, etc. In this way, the network status of the central node is detected based on the acquisition status of the heartbeat packet data, which is convenient to operate and further improves the network quality or communication efficiency.
[0077] In some embodiments, obtaining the network status of the central node in the current network includes:
[0078] Periodically obtain the data transmission speed of the data transmitted by the central node in the current network;
[0079] Determining the network status of the central node according to the data transmission speed of the central node and the target transmission demand under the current network;
[0080] If the data transmission speed does not meet the target transmission requirement, it is determined that the current network status of the central node is abnormal.
[0081] The data transmission speed may be the amount of data transmitted per unit time, specifically, the average data transmission speed within a preset time, etc. Under normal network conditions, the data transmission speed of the central node should meet the target transmission requirements of the current network.
[0082] For example, the data transmission speed of the central node should be greater than or equal to the preset transmission speed threshold. If the network node detects that the data transmission speed of the data transmitted by the central node in the current network does not meet the target transmission requirement, it means that the data transmission of the central node is slow or even no data may be transmitted at this time, and it is determined that the current network status of the central node is abnormal. In this way, the network status of the central node is detected based on the data transmission speed of the central node, which is convenient to operate and further improves the network quality or communication efficiency.
[0083] In some embodiments, the selecting a proxy node for acting as a proxy for the central node from the plurality of slave nodes based on the device authority information corresponding to the plurality of slave nodes in the current network includes:
[0084] Synchronously reporting corresponding device authority information in the current network through each of the slave nodes;
[0085] Each of the slave nodes elects a proxy node for acting as a proxy for the central node from a plurality of the slave nodes based on the target election strategy and the device authority information of each slave node.
[0086] It is understandable that, depending on the device authority information, the target election strategy is also different, such as election in priority order, election in device weight, etc. In some embodiments, the target election strategy includes at least one of election in priority order corresponding to the authority information of each slave node, election in device weight of each slave node, election in data version of target data in each slave node, and election in priority order corresponding to address information of each slave node.
[0087] The authority information may be management authority, sharing authority, etc., and the target data may be pre-configured data, etc. Taking the target election strategy including election according to the priority order corresponding to the authority information of each slave node as an example, assuming that for slave nodes a, b and c, if the authority information of the slave nodes is in the order of b, c, a from high to low priority, then the slave node b can be elected as the proxy node for the proxy center node; or, if the device weights of the slave nodes are in the order of a, c, b from large to small, then the slave node a can be elected as the proxy node for the proxy center node; or, if the data versions of the target data of the slave nodes are in the order of c, b, a from high to low priority, then the slave node c can be elected as the proxy node for the proxy center node; or, if the address information of the slave nodes is in the order of c, a, b from high to low priority, then the slave node c can be elected as the proxy node for the proxy center node. In this way, the proxy node used to act as the proxy central node is elected according to the device authority information of each slave node, which is convenient and flexible to operate, and further improves the network quality or communication efficiency.
[0088] It should be noted that when the network node detects that the current network status of the central node is abnormal, it can notify each slave node to synchronously report the corresponding device permission information in the current network. Alternatively, when each slave node joins the current network, it can also report the corresponding device permission information to the current network.
[0089] In some embodiments, broadcasting proxy information in the current network by the proxy node to instruct the proxy node to perform the data transmission function of the central node in the current network, includes:
[0090] Broadcasting the proxy information of the proxy node in the current network according to a preset period;
[0091] After each slave node in the current network receives the proxy information broadcast by the proxy node, each slave node updates the message data to be sent to the central node to be sent to the proxy node based on the proxy information, so as to execute the data transmission function of the central node in the current network through the proxy node.
[0092] It can be understood that since the devices in the current network are online or offline dynamically, in order to enable all devices in the current network to know the proxy information, the proxy node can broadcast its own proxy information in the current network according to a preset period.
[0093] For example, the proxy node broadcasts its own proxy information in the current network every 10 seconds. After each slave node in the current network receives the proxy information broadcast by the proxy node, it can be learned from the proxy information that the proxy node currently performs the data transmission function of the central node in the current network. Based on the proxy information, the message data to be sent to the central node is updated to be sent to the proxy node, so that the proxy node performs the data transmission function of the central node in the current network. For example, assuming that slave node a needs to send a message data A to slave node b, after slave node a receives the proxy information broadcasted by slave node c as a proxy node, based on the proxy information, the message data A is first sent to slave node c, and then the slave node c forwards the message data A to slave node b. In this way, the proxy node broadcasts its own proxy information in the current network according to the preset period to ensure that each slave node can obtain the proxy information in time, and accurately send the message data based on the proxy information, further improving the network quality or communication efficiency.
[0094] In some embodiments, the network processing method further includes:
[0095] If the network status of the central node returns to normal, the proxy node broadcasts proxy cancellation information in the current network to instruct the central node to perform a data transmission function in the current network.
[0096] It can be understood that when the network node detects that the network status of the central node has returned to normal, it means that the central node can continue to perform the data transmission function in the current network at this time, and then the proxy node broadcasts the proxy cancellation information in the current network to inform each slave node to perform the data transmission function in the current network through the central node in the future. Continuing to refer to the above example, it is assumed that slave node a needs to send a message data B to slave node b, and after slave node a receives the proxy cancellation information broadcasted by slave node c as a proxy node, based on the proxy cancellation information, the message data B will be sent to the central node first, and then the central node will forward the message data B to slave node b. It should be noted that after the network node detects that the network status of the central node has returned to normal, it can control the proxy node to return to an ordinary slave node. In this way, when the network status of the central node returns to normal, the data transmission function continues to be performed in the current network through the central node, which is flexible in operation and improves the convenience of data transmission.
[0097] In some embodiments, the central node and each of the slave nodes store configuration data of an automation scenario; the automation scenario includes a scenario triggering device and a corresponding triggering condition, and an action executing device and a corresponding target action;
[0098] After broadcasting proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network, the method further includes:
[0099] Receiving, through the proxy node, message data reported by the scene triggering device in the current network;
[0100] If the message data meets the triggering condition of the automation scenario, the proxy node sends the corresponding target action instruction to the action execution device under the automation scenario according to the configuration data of the automation scenario to instruct the action execution device to execute the target action.
[0101] It can be understood that users can configure automation scenarios through management applications in smart terminals or the cloud according to their needs, generate configuration data for automation scenarios, and send the configuration data for automation scenarios to the central node, which then sends the configuration data for automation scenarios to each slave node.
[0102] After receiving the configuration data of the automation scene sent by the central node, each slave node stores the configuration data of the automation scene accordingly. The scene trigger device in the current network can collect the corresponding data in real time or irregularly, and report it to the proxy node in the form of a message based on the proxy information. The network node receives the message data reported by the scene trigger device in the current network through the proxy node.
[0103] If the network node detects that the message data meets the triggering condition of the automation scene, the proxy node sends the corresponding target action instruction to the action execution device under the automation scene according to the configuration data of the automation scene to instruct the action execution device to execute the target action.
[0104] For example, assuming that the scene triggering device includes a wireless human sensor and a light sensor, the action execution device includes a light-controlled switch, the triggering conditions include human movement and the light value is less than the preset light threshold, and the target action includes turning on the light. When the network node receives the first message data sent by the wireless human sensor for detecting whether there is human movement and the second message data sent by the light sensor including the light value through the proxy node, if human movement is detected according to the first message data and the light value is less than the preset light threshold according to the second message data, it means that the triggering conditions of the automation scene are met, and then the light-on instruction is sent to the light-controlled switch through the proxy node to indicate that the light-controlled switch performs the light-on operation. In this way, the scene triggering device effectively reduces network congestion and improves communication reliability by sending message data to the proxy node separately instead of sending it through broadcast messages.
[0105] In order to have a more comprehensive understanding of the network processing method provided by this application, please refer to Figure 3 The network processing method is exemplarily described below with an optional specific example, the method comprising:
[0106] S201, the cloud sends the configuration data of the automation scenario to the coordinator gateway and the router gateway.
[0107] Among them, the first gateway that joins and registers to the cloud backend through the mobile phone's management application and creates the network at the same time is called a coordinator gateway, while other gateways join the network as sub-device nodes and are called router gateways.
[0108] Among them, the coordinator gateway can be unique in the entire network, and its main functions include: 1) creating a network, including generating network ID, network key, network channel and other information; 2) whether to allow other devices to join this network; 3) device key management, device security authentication, etc.; 4) automation scene execution function; 5) distribution and synchronization of automation scene data; 6) communication with the cloud or external network.
[0109] There can be multiple router gateways in a network, and their main functions include: 1) forwarding messages to increase the communication distance between nodes in the network; 2) after the coordinator gateway is offline, compete to elect the only proxy coordinator gateway; 3) automation scene proxy execution function: 4) synchronize automation scene data with the coordinator gateway; 5) communicate with the cloud or external network. Here, users configure automation scenes through the mobile phone management application or cloud background and save them in the cloud, which are sent to the coordinator gateway through the cloud and distributed to the router gateways in the network.
[0110] S203, after the coordinator gateway goes offline, the router gateways in the network will recommend a unique proxy coordinator gateway according to the priority strategy.
[0111] Here, the overall priority strategy is that the coordinator gateway has the highest priority, followed by the user configuration weight, the automation scene data version size, and the MAC size is the lowest.
[0112] S205, the proxy coordinator gateway regularly broadcasts its own proxy information, and other sub-device nodes in the network redirect and send message reports to the elected proxy coordinator gateway.
[0113] Here, since the devices in the network are online and offline dynamically, offline devices and devices with poor communication may not be notified at one time. Therefore, the proxy coordinator gateway needs to broadcast its own proxy information regularly.
[0114] S207, after the coordinator gateway is back online, the elected proxy coordinator gateway falls back to a common router gateway, and the coordinator gateway becomes the gateway for executing the automation scenario service again.
[0115] Here, after the coordinator gateway is back online, the elected proxy coordinator gateway will fall back to a normal router gateway and tell other sub-devices to send subsequent messages to the coordinator gateway. Since the coordinator gateway has the highest priority, it will become the gateway to execute the automation scene service again.
[0116] See also Figure 4 When the coordinator gateway 1 is online normally, when the battery-powered device 4 needs to report message data to the router gateway 6, the battery-powered device 4 first sends the message data to the coordinator gateway 1. After receiving the message data, the coordinator gateway 1 sends the message data to the router gateway 6 through the router gateway 3. Figure 5 When the coordinator gateway 1 is offline, when the battery-powered device 4 needs to report message data to the router gateway 6, if the router gateway 3 is elected as the proxy coordinator gateway, the battery-powered device 4 first sends the message data to the proxy coordinator gateway, that is, the router gateway 3. After receiving the message data, the router gateway 3 sends the message data to the router gateway 6.
[0117] In the above-mentioned embodiments of the present application, in a wireless, low-power Mesh network, after the coordinator gateway itself fails, a mechanism is used based on the competition of the router gateway to become the proxy coordinator gateway, so that the automated scene control of the smart home devices can still be maximized, and the communication with the external network is not affected, thereby improving the user experience; secondly, when the coordinator gateway is switched offline and online and the router gateway competes for election, the energy consumption of terminal devices such as battery-powered wireless sensors is repeatedly considered. Therefore, there is no need to perform additional operations on such terminal devices, thereby extending the battery life of the wireless sensor and reducing the frequency and maintenance cost of battery replacement for users; thirdly, no broadcast messages are used when routing and forwarding messages on the routing device, thereby reducing network congestion, reducing network latency, and improving communication reliability.
[0118] The present application also provides an application scenario, that is, the above network processing method can be specifically applied to a smart home scenario. The application of the above network processing method in this application scenario can be as follows:
[0119] Assume that in a smart home scenario, the corresponding smart home network system includes a coordinator gateway node, multiple router gateway nodes, wireless human sensors and light sensors set in the living room and corridor, and light control switches that control the lights set in the living room and corridor respectively. Among them, the coordinator gateway node can be the central node in the smart home network system, and the multiple router gateway nodes can be the central nodes in the smart home network system. The wireless human sensors, light sensors, light control switches and lights can be smart devices in the smart home network system.
[0120] Among them, the wireless human body sensor, light sensor and light control switch are respectively communicated with the corresponding router gateway nodes. The user can send configuration data of the scene of automatically turning on the light when someone moves and the light is less than the preset light threshold to the coordinator gateway node and the router gateway node through the cloud server.
[0121] When each router gateway node detects that the coordinator gateway node fails, it can broadcast its own priority information in the current network, and compare its own priority with the priority of other router gateway nodes according to the priority information sent by other router gateway nodes. If it is higher, it is determined to be a proxy coordinator gateway node, and then broadcasts proxy information including the name of the proxy coordinator gateway node and the version of the automation scene data, MAC address, etc. in the current network.
[0122] The wireless human body sensor and light sensor can send their respective detection message data to the proxy coordinator gateway node through the corresponding router gateway node. If it is determined based on the detection message data that there is human movement in the living room and the light value is less than the preset light threshold, the proxy coordinator gateway node sends a light-on instruction to turn on the light in the living room to the light-controlled switch, so as to instruct the light-controlled switch to perform the operation of turning on the light in the living room. In this way, when there is an abnormality in the network status of the coordinator gateway node under the network, a proxy node for the proxy coordinator gateway node is automatically selected from multiple router gateway nodes to ensure that data transmission in the smart home network system is not interrupted, and the execution of the automation scene in the smart home system is not affected, thereby improving the network quality and communication efficiency, and enhancing the user experience.
[0123] See also Figure 6 On the other hand, the present application further provides a network processing device, including:
[0124] The acquisition module 10 is used to acquire the network status of the central node in the current network;
[0125] The election module 11 is used to elect a proxy node for acting as the central node from a plurality of slave nodes based on device authority information corresponding to a plurality of slave nodes in the current network if the current network state of the central node is abnormal;
[0126] The broadcast module 12 is used to broadcast proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0127] In some embodiments, the acquisition module 10 is specifically used to:
[0128] Periodically obtain the heartbeat packet data sent by the central node in the current network;
[0129] Determine the network status of the central node according to the interval duration of receiving the heartbeat packet data;
[0130] If the heartbeat packet data is not obtained within the interval time, it is determined that the current network status of the central node is abnormal.
[0131] In some embodiments, the acquisition module 10 is specifically used to:
[0132] Periodically obtain the data transmission speed of the data transmitted by the central node in the current network;
[0133] Determining the network status of the central node according to the data transmission speed of the central node and the target transmission demand under the current network;
[0134] If the data transmission speed does not meet the target transmission requirement, it is determined that the current network status of the central node is abnormal.
[0135] In some embodiments, the election module 11 is specifically used to:
[0136] Synchronously reporting corresponding device authority information in the current network through each of the slave nodes;
[0137] Each of the slave nodes elects a proxy node for acting as a proxy for the central node from a plurality of the slave nodes based on the target election strategy and the device authority information of each slave node.
[0138] In some embodiments, the broadcast module 12 is specifically used to:
[0139] Broadcasting the proxy information of the proxy node in the current network according to a preset period;
[0140] After each slave node in the current network receives the proxy information broadcast by the proxy node, each slave node updates the message data to be sent to the central node to be sent to the proxy node based on the proxy information, so as to execute the data transmission function of the central node in the current network through the proxy node.
[0141] In some embodiments, the broadcast module 12 is further used to:
[0142] If the network status of the central node returns to normal, the proxy node broadcasts proxy cancellation information in the current network to instruct the central node to perform a data transmission function in the current network.
[0143] In some embodiments, the network processing device further includes a receiving module 13 and a sending module 14, wherein:
[0144] The receiving module 13 is used to receive the message data reported by the scene triggering device in the current network through the proxy node;
[0145] The sending module 14 is used to send the corresponding target action instruction to the action execution device under the automation scenario through the proxy node according to the configuration data of the automation scenario if the message data meets the triggering condition of the automation scenario, so as to instruct the action execution device to execute the target action.
[0146] It should be noted that: the network processing device provided in the above embodiment only uses the division of the above program modules as an example to illustrate the process of implementing network processing. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the method steps described above. In addition, the network processing device provided in the above embodiment and the network processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0147] See also Figure 1 On the other hand, the present application also provides a network processing system, the network processing system includes a central node 1 and a plurality of slave nodes 2; wherein,
[0148] The central node 1 and / or the slave node 2 are configured as follows:
[0149] Get the network status of the central node in the current network;
[0150] If the current network state of the central node is abnormal, based on the device authority information corresponding to the multiple slave nodes in the current network, electing a proxy node for acting as the proxy for the central node from the multiple slave nodes; and
[0151] The proxy information is broadcasted in the current network by the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network.
[0152] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0153] Periodically obtain the heartbeat packet data sent by the central node in the current network;
[0154] Determine the network status of the central node according to the interval duration of receiving the heartbeat packet data;
[0155] If the heartbeat packet data is not obtained within the interval time, it is determined that the current network status of the central node is abnormal.
[0156] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0157] Periodically obtain the data transmission speed of the data transmitted by the central node in the current network;
[0158] Determining the network status of the central node according to the data transmission speed of the central node and the target transmission demand under the current network;
[0159] If the data transmission speed does not meet the target transmission requirement, it is determined that the current network status of the central node is abnormal.
[0160] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0161] Synchronously reporting corresponding device authority information in the current network through each of the slave nodes;
[0162] Each of the slave nodes elects a proxy node for acting as a proxy for the central node from a plurality of the slave nodes based on the target election strategy and the device authority information of each slave node.
[0163] In some embodiments, the central node 1 and / or the slave node 2 are specifically configured as:
[0164] Broadcasting the proxy information of the proxy node in the current network according to a preset period;
[0165] After each slave node in the current network receives the proxy information broadcast by the proxy node, each slave node updates the message data to be sent to the central node to be sent to the proxy node based on the proxy information, so as to execute the data transmission function of the central node in the current network through the proxy node.
[0166] In some embodiments, the central node 1 and / or the slave node 2 are further configured as:
[0167] If the network status of the central node returns to normal, the proxy node broadcasts proxy cancellation information in the current network to instruct the central node to perform a data transmission function in the current network.
[0168] In some embodiments, the central node 1 and / or the slave node 2 are further configured as:
[0169] Receiving, through the proxy node, message data reported by the scene triggering device in the current network;
[0170] If the message data meets the triggering condition of the automation scenario, the proxy node sends the corresponding target action instruction to the action execution device under the automation scenario according to the configuration data of the automation scenario to instruct the action execution device to execute the target action.
[0171] On the other hand, please refer to Figure 7 , also provides an electronic device, including a processor 211 and a memory 212, wherein the memory 212 stores a computer program that can be executed by the processor, and when the computer program is executed by the processor 211, it implements the network processing method provided in any embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0172] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned network processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk, etc.
[0173] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A network processing method, characterized in that: include: Obtaining the network status of the central node in the current network, wherein the central node includes a coordinator gateway; If the current network state of the central node is abnormal, a proxy node for acting as a proxy for the central node is selected from the multiple slave nodes based on the device authority information corresponding to the multiple slave nodes under the current network, and the slave nodes include router gateways; The central node and each of the slave nodes store configuration data of the automation scene; the automation scene includes a scene triggering device and a corresponding triggering condition, an action executing device and a corresponding target action; Broadcasting proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network; Receiving, through the proxy node, message data reported by the scene triggering device in the current network; If the message data meets the triggering condition of the automation scenario, the proxy node sends the corresponding target action instruction to the action execution device under the automation scenario according to the configuration data of the automation scenario to instruct the action execution device to execute the target action.
2. The network processing method according to claim 1, characterized in that: The obtaining of the network status of the central node in the current network includes: Periodically obtain the heartbeat packet data sent by the central node in the current network; Determine the network status of the central node according to the interval duration of receiving the heartbeat packet data; If the heartbeat packet data is not obtained within the interval time, it is determined that the current network status of the central node is abnormal.
3. The network processing method according to claim 1, characterized in that: The obtaining of the network status of the central node in the current network includes: Periodically obtain the data transmission speed of the data transmitted by the central node in the current network; Determining the network status of the central node according to the data transmission speed of the central node and the target transmission demand under the current network; If the data transmission speed does not meet the target transmission requirement, it is determined that the current network status of the central node is abnormal.
4. The network processing method according to claim 1, characterized in that: The step of selecting a proxy node for acting as a proxy for the central node from the multiple slave nodes based on the device authority information corresponding to the multiple slave nodes in the current network includes: Synchronously reporting corresponding device authority information in the current network through each of the slave nodes; Each of the slave nodes elects a proxy node for acting as a proxy for the central node from a plurality of the slave nodes based on the target election strategy and the device authority information of each slave node.
5. The network processing method according to claim 4, characterized in that: The target election strategy includes at least one of election according to the priority order corresponding to the authority information of each slave node, election according to the device weight of each slave node, election according to the data version of the target data in each slave node, and election according to the priority order corresponding to the address information of each slave node.
6. The network processing method according to any one of claims 1 to 5, characterized in that: The broadcasting of the proxy information in the current network by the proxy node to instruct the proxy node to perform the data transmission function of the central node in the current network, includes: Broadcasting the proxy information of the proxy node in the current network according to a preset period; After each slave node in the current network receives the proxy information broadcast by the proxy node, each slave node updates the message data to be sent to the central node to be sent to the proxy node based on the proxy information, so as to execute the data transmission function of the central node in the current network through the proxy node.
7. The network processing method according to any one of claims 1 to 5, characterized in that: Also includes: If the network status of the central node returns to normal, the proxy node broadcasts proxy cancellation information in the current network to instruct the central node to perform a data transmission function in the current network.
8. A network processing system, characterized in that: The network processing system includes a central node and a plurality of slave nodes, wherein the central node includes a coordinator gateway, and the slave nodes include a router gateway; wherein, The central node and / or the slave node are configured as follows: Get the network status of the central node in the current network; If the current network state of the central node is abnormal, a proxy node for acting as the proxy for the central node is selected from the multiple slave nodes based on the device authority information corresponding to the multiple slave nodes under the current network, wherein the central node and each of the slave nodes store configuration data of the automation scene; the automation scene includes a scene triggering device and a corresponding triggering condition, and an action executing device and a corresponding target action; Broadcasting proxy information in the current network through the proxy node to indicate that the data transmission function of the central node is performed by the proxy node in the current network; Receiving, through the proxy node, message data reported by the scene triggering device in the current network; If the message data meets the triggering condition of the automation scenario, the proxy node sends the corresponding target action instruction to the action execution device under the automation scenario according to the configuration data of the automation scenario to instruct the action execution device to execute the target action.
9. A network processing device, characterized in that: include: An acquisition module, used to acquire the network status of a central node in the current network, wherein the central node includes a coordinator gateway; An election module, configured to elect a proxy node for acting as the proxy for the central node from a plurality of slave nodes based on device authority information corresponding to a plurality of slave nodes in the current network if the current network state of the central node is abnormal, wherein the slave nodes include router gateways; The central node and each of the slave nodes store configuration data of the automation scene; the automation scene includes a scene triggering device and a corresponding triggering condition, an action executing device and a corresponding target action; A broadcast module, configured to broadcast proxy information in the current network through the proxy node, so as to indicate that the data transmission function of the central node is performed by the proxy node in the current network; A receiving module, used for receiving, through the proxy node, message data reported by the scene triggering device in the current network; The sending module is used to send the corresponding target action instruction to the action execution device under the automation scenario through the proxy node according to the configuration data of the automation scenario if the message data meets the triggering condition of the automation scenario, so as to instruct the action execution device to execute the target action.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the network processing method according to any one of claims 1 to 7 is implemented.
11. 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 the controller, the network processing method according to any one of claims 1 to 7 is implemented.
