CN109617731A - Adaptive gateway role configuration method and device under a kind of multi-gateway environment - Google Patents

Adaptive gateway role configuration method and device under a kind of multi-gateway environment Download PDF

Info

Publication number
CN109617731A
CN109617731A CN201811574925.1A CN201811574925A CN109617731A CN 109617731 A CN109617731 A CN 109617731A CN 201811574925 A CN201811574925 A CN 201811574925A CN 109617731 A CN109617731 A CN 109617731A
Authority
CN
China
Prior art keywords
gateway
role
primary
equipment
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811574925.1A
Other languages
Chinese (zh)
Inventor
于卫
杨夫星
张洪进
刘明月
刘永霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Hisense Smart Home System Ltd By Share Ltd
Original Assignee
Qingdao Hisense Smart Home System Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Smart Home System Ltd By Share Ltd filed Critical Qingdao Hisense Smart Home System Ltd By Share Ltd
Priority to CN201811574925.1A priority Critical patent/CN109617731A/en
Publication of CN109617731A publication Critical patent/CN109617731A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the present application shows gateway role configuration method and device adaptive under a kind of multi-gateway environment, in technical solution shown in the embodiment of the present application, it include multiple gateways in smart home system, the gateway role state of one of gateway is primary gateway, it is connect with Cloud Server, for being interacted with Cloud Server.The gateway role state of other gateways is to connect respectively with the gateway that gateway role state is primary gateway, from gateway to be interacted as the gateway of primary gateway with Cloud Server by gateway role state.In this application, each gateway in smart home system always carries out the configuration of gateway role according to control method provided by the present application.In entire configuration process, it is not necessarily to manual intervention, can determine that the principal and subordinate of each gateway is arranged according to the corresponding status information election of gateway each in local area network, simplify operation, improve the accuracy rate and success rate of configuration.

Description

Adaptive gateway role configuration method and device under a kind of multi-gateway environment
Technical field
The present invention relates to Smart Home technical field, in particular to adaptive gateway role is matched under a kind of multi-gateway environment Set method and device.
Background technique
In recent years, smart home technology rapidly develops, the various smart homes such as intelligent air condition, intelligent door and window, intelligent sound Equipment also becomes more diverse, and the Cloud Server of these equipment and access gateway, offer data service has collectively constituted smart home System.In this system, it will usually there is multiple equipment to be connected by gateway with Cloud Server, however, since equipment executes Communication standard or agreement may disunity or incompatible so that single gateway allocation plan has been unable to satisfy the use of large number of equipment Environment, therefore derive multiple gateway configuration system.
Multiple gateway configuration system generally includes a Cloud Server, and, multiple gateways, wherein the role of gateway is matched It is set to " one master and multiple slaves " mode, that is, needs to select one of those in whole gateways for primary gateway, the gateway and Cloud Server It is connected, provides service for other gateways, other gateways are configured as from gateway role.Fig. 1 is a typical multiple gateway System, wherein the configuration process of gateway role are as follows: a gateway A is manually rule of thumb selected, by the net of gateway A It closes role and is configured to primary gateway, by gateway B in local area network, and, the role of gateway C is configured to from gateway.Then, Successively in gateway B, and, the address information of typing gateway A in gateway C is established gateway A and is set with gateway Standby connection between B, gateway C.Finally, providing service from gateway A to gateway B, gateway C.
Obviously, the method for human configuration gateway, efficiency and accuracy rate are all lower.
Summary of the invention
Based on above-mentioned technical problem, goal of the invention of the invention is to provide the gateway angle under a kind of multiple gateway facility environment Color configuration method and device.
The embodiment of the present application first aspect shows gateway role configuration method adaptive under a kind of multi-gateway environment, described Method includes:
Broadcast reception thread in local area network is established, the status information of itself is broadcasted;Reception replies message;According to the reply Message arrangement itself gateway role disposes the connection between gateway according to gateway role.
The embodiment of the present application second aspect shows gateway role configuration device adaptive under a kind of multi-gateway environment, described Device includes:
Status information broadcast module, for broadcasting itself status information;
Message reception module, for establishing broadcast reception thread in local area network, reception is replied message;
Role's configuration module, configures itself gateway role for replying message according to, disposes net according to gateway role Close the connection of equipment room.
The embodiment of the present application third aspect shows a kind of electronic equipment, comprising:
Processor, and, memory;
Memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to come any one of perform claim requirement 1 to 7 institute via the execution executable instruction The method stated.
The embodiment of the present application fourth aspect shows a kind of computer readable storage medium, is stored thereon with computer program institute State the method realized shown in the embodiment of the present application when computer program is executed by processor.
It from the above technical scheme, in the above-mentioned technical solutions, include multiple gateways in smart home system, In a gateway gateway role state be primary gateway, connect with Cloud Server, for being interacted with Cloud Server, and The gateway role state of other gateways is to connect from gateway, and respectively with gateway role state for the gateway of primary gateway It connects, to be interacted as the gateway of primary gateway with Cloud Server by gateway role state.
In this application, each gateway in smart home system always according to control method provided by the present application into The configuration of row gateway role is not necessarily to manual intervention, according to the corresponding shape of gateway each in local area network during entire configuration The election of state information determines principal and subordinate's setting of each gateway, simplifies operation, improves configuration accuracy rate and success rate.
Detailed description of the invention
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, below will be to institute in embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is the application scenario diagram of a typical multiple gateway equipment configuration scheme;
Fig. 2 be the embodiment of the present application shown in smart home system in multiple gateway equipment configuration scheme application scenario diagram;
Fig. 3 is the process that the embodiment of the present application shows gateway role configuration method adaptive under a kind of multi-gateway environment Figure;
Fig. 4 is gateway role configuration method adaptive under a kind of multi-gateway environment shown according to an exemplary embodiment Flow chart;
Fig. 5 is the flow chart of the gateway role conversion of gateway shown according to an exemplary embodiment;
Fig. 6 is gateway role configuration device adaptive under a kind of multi-gateway environment shown according to an exemplary embodiment Structural block diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Whole description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 2 is the schematic diagram of implementation environment of the present invention.As shown in Figure 1, the implementation environment is in an Internet of Things Smart home system, the smart home system include Cloud Server 100, gateway 200, mobile terminal 300 and smart machine 400。
Wherein, the communication module and gateway 200 that smart machine 400 is configured by itself establish wireless or wired network Network connection, and then realize through the communication between this network connection and gateway 200.
The communication module of smart machine 400 itself configuration includes but is not limited to ZigBee communication module, Bluetooth mould Any one or a few in block, WiFi communication module is correspondingly established between smart machine 400 and gateway 200 Internetwork connection mode includes any one or a few in ZigBee, Bluetooth or WiFi.Smart machine 400 can be The equipment such as intelligent air condition, intelligent bulbs, intelligent door and window, intelligent sound, quantity are at least one, smart home shown in Fig. 2 Include 2 smart machines 400 in system, is not limited herein.
Wired or wireless network connection is pre-established between mobile terminal 300 and gateway 200, it is mobile whole to realize Interaction between end 300 and gateway 200.Mobile terminal 300 can be smart phone, tablet computer, laptop, meter Calculation machine or other any electronic equipments for client operation, are not limited herein.
The quantity of gateway 200 is multiple, includes 3 gateways 200 in smart home system shown in Fig. 2, This implementation environment is not defined this.Gateway role state of one of gateway 200 in smart home system It for primary gateway, is connect between Cloud Server 100 by wide area network, to interact with Cloud Server 100, other gateways are set The standby 200 gateway role state in smart home system be from gateway, these gateways 200 by local area network respectively with net It closes the gateway 200 that role state is primary gateway to connect, to interact with the gateway 200 for serving as role server.
Wherein, gateway 200 can be it is any can respectively with smart machine 400, Cloud Server 100 and mobile terminal The electronic equipment of wireless or cable network connection is established between 300.
In smart home system shown in Fig. 2, gateway role state is to pass through gateway angle from the gateway 200 of gateway Color state is that the gateway 200 of primary gateway is interacted with Cloud Server 100.For example, gateway role state is primary gateway 200 response gateway role state of gateway is the request issued from the gateway 200 of gateway, will be by gateway role state The information such as the intelligent scene configured from the state of the mobile terminal 300 of the gateway 200 of gateway transmission, mobile terminal 300 It is uploaded to Cloud Server 100, and, it is to be taken from the request that the gateway 200 of gateway issues from cloud according to gateway role state Business device 100 obtains the information such as registration information, the configuration parameter of mobile terminal 300, and the information obtained from Cloud Server 100 is sent out Sending to respective gateway role state is from the gateway 200 of gateway.
Therefore, in this implementation environment, gateway role state is the gateway 200 of primary gateway in smart home system Play highly important system backbone effect.
Fig. 3 is a kind of hardware block diagram of gateway 200 shown according to an exemplary embodiment.It needs to illustrate It is that the gateway 200 is one and adapts to example of the invention, must not believe that there is provided to use scope of the invention Any restrictions.The gateway 200 can not be construed to need to rely on or must have illustrative shown in Fig. 3 One or more component in gateway 200.
The hardware configuration of the gateway 200 can generate biggish difference due to the difference of configuration or performance, such as Fig. 3 institute Show, gateway 200 includes: power supply 210, interface 220, at least a memory 230 and an at least central processing unit 240 (CPU, Central Processing Units).
Wherein, power supply is used to provide operating voltage for each hardware device in gateway.
Interface 220 includes an at least wired or wireless network interface 221, at least a string and translation interface 222, at least one defeated Enter output and connect 223 mouthfuls and at least USB interface 224 etc., is used for and external device communication.
The carrier that memory is stored as resource can be read-only memory, random access memory, disk or CD etc., The resource stored thereon includes operating system 233, application program 232 or data 231 etc., and storage mode can be of short duration deposit It stores up or permanently stores.Wherein, operating system is used to manage and control each hardware device in gateway 200 and applies journey Sequence can be Windows ServerTM, Mac OS to realize calculating and processing of the central processing unit to mass data XTM, UnixTM, LinuxTM, FreeBSDTM, FreeRTOS etc..Application program is to be based on completing at least one on operating system The computer program of item particular job comprising an at least module (being not shown in Fig. 3), each module can separately include To the series of computation machine readable instruction of gateway 200.Data can be stored in photo, picture in disk etc..
Central processing unit may include the processor of one or more or more, and be set as logical by bus and memory Letter, for the mass data in operation and processing memory.
As described in detail above, it is applicable in gateway 200 of the invention and will be read in memory by central processing unit and deposited The form of the series of computation machine readable instruction of storage completes the control method of multiple gateway equipment in smart home system.
In addition, also can equally realize the present invention by hardware circuit or hardware circuit combination software instruction, therefore, realize The present invention is not limited to the combinations of any specific hardware circuit, software and the two.
Fig. 1 is a typical multiple gateway system, wherein the configuration process of gateway role are as follows: manually rule of thumb select The gateway role of gateway A is configured primary gateway by one gateway A, by gateway B in local area network, and, gateway The role of equipment C is configured to from gateway.Then, successively in gateway B, and, typing gateway A in gateway C Address information establishes the connection between gateway A and gateway B, gateway C.Finally, from gateway A to gateway Equipment B, gateway C provide service.
In recent years, increasing with smart home device quantity, a large amount of a large amount of gateways of gateway access to LAN Access to LAN, artificial selected main gateway device, the adaptability of selected main gateway device are difficult to ensure.Successively from gateway A series of processes such as address information of typing main gateway device are complicated for operation in equipment, meanwhile, in manual entry address information In the process, the accuracy rate of typing address information is difficult to ensure.
The embodiment of the present application shows gateway role configuration adaptive under a kind of multi-gateway environment to solve the above-mentioned problems Method, method are suitable for gateway 200 shown in Fig. 3.As shown in figure 4, the gateway role configuration side under the multi-gateway environment Method may include steps of:
S310 establishes broadcast reception thread in local area network, broadcasts the status information of itself;
Each gateway in smart home system shown in the embodiment of the present application can obtain each gateway in local area network The status information of equipment;Therefore, other gateways in local area network are also received while the status information of gateway itself Status information.Smart home system starting, gateway to be connected establish UDP receiving thread, receive the udp broadcast information on network; It establishes UDP and sends thread, be notified to the status information of this gateway into local area network, which is also used for inquiry with the presence or absence of net simultaneously Close the gateway that role state is primary gateway.
The process that each gateway being deployed in local area network in smart home system carries out role negotiation is, from local area network The gateway that a gateway role state is primary gateway is negotiated in interior each gateway, the gateway is according to primary gateway angle Color configures itself gateway;And other gateways then configure itself gateway according to from gateway role.Role negotiation interaction message is Based on the status information of each gateway broadcast, the status information can include: the network-induced delay of each gateway, each net Close the device type of equipment, the signal quality of each gateway, the MAC Address of each gateway, the current net of each gateway Pass character types, the gateway surplus resources of each gateway, and, one or more of IP address of each gateway shape State information.
Therefore, gateway initially sets up broadcast reception thread in local area network, sets for receiving other gateways in local area network Standby status information.It also needs respective above-mentioned status information being transmitted to other gateways simultaneously, so that smart home system In each gateway can obtain the status informations of other whole gateways, carried out according to above-mentioned status information subsequent Gateway role negotiate, and, the configuration of gateway role.
S320 reception replies message;
Gateway is after the status information for broadcasting itself, and there may be following three kinds for gateway role configuration in local area network Situation, corresponding each case correspond to one kind and reply message:
A. the gateway for closing that role state is primary gateway is had existed in local area network.In the case, role state is closed It is replied message for the gateway broadcast of primary gateway, closes the gateway broadcast that role state is primary gateway and reply message as major network The address information of pass configures itself gateway according to from gateway role at this point, other gateways stop inquiring at once, based on master The address information of gateway initiates the connection request to the gateway that role state is primary gateway is closed, and completes connection.
B. there is no the gateways that pass role state is primary gateway in local area network, but closing role states there are other is nothing The gateway of role's gateway.In the case, each gateway is pushed away using the status information collected when inquiring in local area network The gateway i.e. primary gateway of state optimization is selected, and broadcasts the address information for replying message informing primary gateway, each gateway Message arrangement itself gateway role is replied according to receiving, the connection between gateway is disposed according to gateway role.
It in one embodiment, include: gateway to be connected in local area network when connecting gateway electrifying startup, And gateway role state is the gateway of no role's gateway.
Gateway to be connected obtains the state letter of gateway of the gateway role state for no role's gateway in local area network After breath, according to the status information of its own, and, the status information in received local area network without role's gateway forms status information List, the status information comprising gateways whole in local area network in the state information list.
Gateway role state is that other gateway role states are acerous in the gateway acquisition local area network of no role's gateway The status information of the gateway of color gateway, and, after the status information for connecting gateway, believed according to the state of its own Breath, in local area network other gateway role states for the gateway of no role's gateway status information, and, gateway to be connected is set Standby status information forms state information list, the state letter comprising gateways whole in local area network in the state information list Breath.
In the present embodiment, gateway to be connected can get the status information of whole gateways in local area network, So that it elects the gateway of state optimization using inquiry state information list.Gateway role state for no role's gateway net The status information of whole gateways in local area network can be got by closing equipment, so that it is pushed away using inquiry state information list Select the gateway of state optimization.As it can be seen that the technical solution shown in the embodiment of the present application, each gateway is using asking in local area network State information list is asked to elect state optimization gateway, the gateway broadcast for electing state optimization gateway at first, which is replied, to disappear Breath, remaining gateway configure itself gateway role according to described reply message, are disposed between gateway according to gateway role Connection.
During practical application, each gateway is all in accordance with the gateway status in described reply message in local area network Information elects in the local area network suitable for the intended gateway equipment of server as primary gateway, broadcasts primary gateway address letter Breath, and, itself gateway is configured according to from gateway role according to the primary gateway address information in described reply message.Correspondingly, The selection of primary gateway if a gateway takes the lead in completing, by replying message the address information for responding immediately to primary gateway, other nets It closes equipment to stop choosing at once, into from gateway mode, initiates the connection request to primary gateway, complete connection procedure.
C. both there is no the gateway that role state is primary gateway is closed in local area network, also there is no other to close role state For the gateway of no role's gateway, then enters primary gateway mode and work, in the case, reply message as sky.
S330 is replied message according to configures itself gateway role, disposes the company between gateway according to gateway role It connects.
Specifically, gateway role configuration process are as follows: judge whether to receive and reply message, disappear if not receiving reply Breath, configuring itself gateway role state is primary gateway;Otherwise, according to itself gateway role of the type configuration replied message.
It replies message, is proved in corresponding local area network if not receiving, that is, primary gateway is not present, other nothings are also not present Role's gateway, it is primary gateway that gateway, which configures itself gateway role state,.
In a kind of embodiment, probably due to the loss of the information of broadcast causes gateway to broadcast itself status information Afterwards, it can not receive and reply message, the identification of mistake, which receives, replies message reply as sky.
In order to solve the above-mentioned technical problem, in the technical solution shown in the embodiment of the present application, if gateway broadcasts itself Status information after, be not received by and reply message in preset time, then the gateway continues to inquire, carry out three After secondary inquiry, configuring itself gateway role state is primary gateway;Wherein, above-mentioned preset time can be 5 seconds for interval, at interval of The status information for broadcasting itself for 5 seconds, is once inquired, carry out three times inquire after, into choose primary gateway mode work, Specific preset time can be set according to actual demand, herein with no restrictions.
In the present embodiment, each gateway avoids the information of broadcast by way of repeatedly broadcasting oneself state information Loss the problem of appearance.
In another embodiment, probably due to the delay of network, loses after causing gateway to broadcast the status information of itself, It can not receive and reply message, there is no the gateways that gateway role state is primary gateway in misattribution local area network.
In order to solve the above-mentioned technical problem, in the technical solution shown in the embodiment of the present application, if gateway broadcasts itself Status information after, be not received by and reply message in preset time, then the gateway continues to inquire, carry out three After secondary inquiry, configuring itself gateway role state is primary gateway;Wherein, above-mentioned preset time can be 5 seconds for interval, at interval of The status information for broadcasting itself for 5 seconds, is once inquired, after the time-out inquired three times, into selection primary gateway mode Work, specific preset time can set according to actual demand, herein with no restrictions.
In the present embodiment, each gateway is by way of extending the waiting time, to solve the problems, such as network delay.
If replying message not for sky, prove in corresponding local area network, there are the gateways that gateway role state is primary gateway Equipment, or, gateway of the gateway role state for no role's gateway, at this time, it may be necessary to certainly according to the type configuration replied message Body gateway role.Wherein, according to itself gateway role of the type configuration replied message specifically:
(1) type replied message is determined;
Wherein, the type replied message includes: address message and status information;The type and local area network Intranet replied message The configuration for closing role is related.It is specific: if having existed the gateway that gateway role state is primary gateway in local area network, accordingly The type replied message be address message;If there is no the gateways that gateway role state is primary gateway in local area network, but There are other gateway role states for the gateway of no role's gateway, and the type replied message accordingly is status information.
(2) if replying message is address message, according to the address information in described reply message, according to from gateway role Configure itself gateway;
(3) it if replying message is status information, according to the gateway status information in described reply message, elects described Primary gateway address information is broadcasted as primary gateway suitable for the intended gateway equipment of server in local area network, and, according to described Primary gateway address information in replying message configures itself gateway according to from gateway role.
It is status information that gateway reception, which replies message, then proves that it is major network that gateway role state is not present in local area network The gateway of pass, but be the gateway of no role's gateway there are other gateway role states, it is replied message accordingly as office Interior each gateway role state is netted as the status information of the gateway of no role's gateway in domain.The shape of interior each gateway is netted according to domain State information elects the gateway of state optimization as primary gateway, specifically, determining to the corresponding status information of each gateway Plan priority divides, and the gateway of state optimization is as primary gateway.
In one embodiment, it is cable gateway device type or wireless network that status information, which includes: a. gateway Device Type, Close device type;B. signal quality is high or signal quality is low;It c. whether is that the address server d.MAC is small or MAC Address is big.Accordingly , wherein set priority is successively are as follows: whether gateway Device Type, the signal quality of gateway, gateway are clothes The MAC Address of business device, gateway.
Each gateway role state for no role's gateway gateway, and, gateway to be connected is according to each net It closes the corresponding status information decision priority of equipment and chooses corresponding with priority kind from whole status informations of acquisition respectively The status information of class is judged step by step, until obtaining the intended gateway equipment met suitable for server.
It is worth noting that, status information decision priority splitting scheme is not limited to the technical side shown in above-described embodiment Case, it is all to pass through selection type corresponding with priority in whole status informations of acquisition during practical application Status information judged step by step, until obtain meet intended gateway equipment suitable for server status information decision it is excellent First grade splitting scheme gathers in the protection scope of the technical solution shown in the embodiment of the present application, here, since length is limited just not It introduces one by one.
After primary gateway determines, in local area network other gateways can reply message in primary gateway address information inquire Primary gateway, to be interacted after the gateway is converted to role server with the gateway.
As it can be seen that including multiple gateways, one of gateway in smart home system in the above-mentioned technical solutions Gateway role state be primary gateway, connect with Cloud Server, for being interacted with Cloud Server, and other gateways Gateway role state is to connect from gateway, and respectively with the gateway that gateway role state is primary gateway, to pass through gateway angle Color state is that the gateway of primary gateway is interacted with Cloud Server.
In this application, each gateway in smart home system always according to control method provided by the present application into The configuration of row gateway role is not necessarily to manual intervention, according to the corresponding shape of gateway each in local area network during entire configuration The election of state information determines principal and subordinate's setting of each gateway, simplifies operation, improves configuration accuracy rate and success rate.
It is selectable, the basis reply message in gateway status information, elect and be suitable for clothes in the local area network Business device intended gateway equipment include: as the step of primary gateway
In status information, the gateway free memory of each gateway is extracted, and, the gateway free memory of itself, Generate gateway free memory collection;
It is concentrated in the gateway free memory, the gateway for electing maximum gateway free memory is as major network It closes.
The gateway surplus resources of gateway, mainly free memory, the most gateway of free memory are selected first Lifting is primary gateway;Primary criterion of the surplus resources of gateway as primary gateway, primary gateway provide service for other gateways and need Want more memory headrooms and computing resource.The gateway for electing maximum gateway free memory is to be applicable in as primary gateway In the configuration of resource in local area network.
Using the gateway for generating maximum residual memory as primary gateway, can effectively avoid due to accessing in local area network The quantity of the gateway of primary gateway is accessed far beyond the maximum load of the primary gateway server, leads to the primary gateway service The problem of operating system of device crashes.
Further, the gateway for electing maximum gateway free memory, which is as the step of primary gateway, includes:
The gateway free memory collection is traversed, the gateway for filtering out the maximum gateway free memory of generation is standby as first Select gateway;
Judge whether the quantity of the first candidate gateway equipment is greater than or equal to 1;
If being equal to 1, determine that the first candidate gateway equipment is primary gateway;
If it is greater than 1, in status information, the network delay data of the first candidate gateway equipment are extracted, generate net Network delayed data collection;
In network delay data set, the first candidate gateway equipment of most short network delay data is elected as major network It closes.
Gateway power on after first from cloud synchronization time, send test data packet then to obtain gateway to server Network delay, in this, as the criterion of Network status where gateway, the time the short then more may to be used as primary gateway.
It is selectable, it is described in network delay data set, elect the first alternative net of most short network delay data Equipment, which is closed, as the step of primary gateway includes:
Traverses network delayed data collection filters out the first candidate gateway equipment of corresponding most short network delay data as the Two candidate gateway equipment;
Judge whether the quantity of the second candidate gateway equipment is greater than or equal to 1;
If being equal to 1, determine that the second candidate gateway equipment is primary gateway;
If it is greater than 1, in status information, the device type data of the second candidate gateway equipment are extracted, generation is set Standby categorical data collection;
According to the preset ordering rule of cable gateway device type, wireless gateway device type, wifi equipment type, by institute The device type data descending arrangement in device type data set is stated, election sorts the second most preceding candidate gateway equipment as master Gateway.
Free memory, and, in the identical situation of two priority parameters of network delay, then with cable gateway, wireless network Pass, wifi equipment are discrimination standard, and the computing resource of cable gateway is most abundant, also the most stable with believing, therefore first with wired Gateway is as primary gateway;Radio network gateway, which is compared for wifi equipment, also more memory source, in fact wifi equipment Come as client using no normal direction other equipment provide service, therefore radio network gateway is then used as the second candidate of primary gateway.
In entire smart home system, primary gateway serves as the system backbone role in smart home system.If primary gateway It disconnects, entire smart home system can face the risk of paralysis due to maincenter out of hand.
In order to solve to solve above-mentioned technical problem, the technical solution shown in the embodiment of the present application is further comprising the steps of, tool Body please continue to refer to Fig. 4:
Whether primary gateway disconnects in S340 real-time monitoring local area network;
Specifically judge that the process whether gateway role state disconnects for the gateway of major network, gateway role state are from net Gateway and gateway role state be major network gateway when disconnecting, gateway role state is to set from the gateway of net The standby gateway for attempting to be again coupled to that the gateway role state is major network, if it fails to connect, then proving gateway in local area network Role state is that the gateway of major network disconnects;If successful connection, gateway if, keeps itself gateway role state to be From gateway.
Technical solution gateway role state shown in the embodiment of the present application be from the gateway of net using heartbeat mechanism come It monitors and whether is disconnected with gateway role state for the gateway of major network, specifically, if gateway role state is major network Gateway is to send message from the gateway of net not to gateway role state in preset time, then can conclude that gateway role State is that the gateway of major network disconnects.
By taking smart home system shown in Fig. 2 as an example, the gateway role state of gateway A is primary gateway, gateway B Gateway role state with gateway C is from gateway.If gateway B and/or gateway C is detected and gateway Connection between A disconnects, and can not establish connection with gateway A again, then it represents that gateway A is disconnected.
There are many reason of causing in local area network primary gateway to disconnect, for example, if local area network is inscribed the gateway into primary gateway and sets For standby quantity far beyond the maximum load of the primary gateway server, the operating system that will lead to the primary gateway server is dead Machine or the hardware facility of the primary gateway server occur damaging etc., can lead to primary gateway and disconnect, this place is not right This is defined.
If disconnected, S350 obtains gateway status information in local area network, elects and is suitable for server in the local area network Intended gateway equipment as primary gateway, broadcast primary gateway address information, and, according to the primary gateway in described reply message Location information configures itself gateway according to from gateway role.
It is specific referring to Fig. 5, gateway role state be monitored from the gateway of gateway gateway role state be from After the gateway of gateway disconnects, by the role state of itself by being converted to no role's gateway from gateway, such as in Fig. 2 institute The gateway role of gateway B and gateway C are converted to no role's gateway by the smart home system shown.At this point, then not right Gateway A is dealt with, and gateway A is removed local area network.In one embodiment, gateway A can also be tieed up Again access to LAN after repairing, but when accessing again, the gateway role state of the gateway is no role's gateway, according to subsequent Content described in embodiment is handled, this place does not repeat them here.
If gateway role state is to monitor that gateway role state is to set from the gateway of gateway from the gateway of gateway After disconnecting, gateway role state is the gateway of primary gateway, attempts to configure itself gateway according to primary gateway role, should Gateway is continuously attempted to configure the failure of itself gateway according to primary gateway role three times, then the gateway role state is primary gateway The gateway role state of gateway is converted to no role's gateway, correspondingly, in local area network, pass role's shape of other gateways State is from the gateway of gateway to be converted to no role's gateway, is again introduced into gateway and gets inside the character that one is playing voting pattern.
In a further exemplary embodiment, in the process of running, there is also turn off from gateway and major network for smart home system The problem of opening connection.At this point, it is actively primary gateway to gateway role state that gateway role state, which is from the gateway of gateway, Gateway initiates the connection, specifically, being major network when gateway role state is from the gateway and gateway role state of gateway When the separated network connection of the gateway of pass, gateway role state is the gateway from gateway according to default connection type It re-establishes and connect with the gateway that gateway role state is primary gateway.Wherein, above-mentioned default connection type can be every It every 5 seconds, is continuously attached three times, is also possible to other connection types, this place is without limiting.
Gateway role state is that the gateway of major network uses heartbeat mechanism to monitor with gateway role state as from net Whether gateway disconnects, specifically, if gateway role state be from the gateway of net in preset time not to net It closes the gateway that role state is major network and sends message, then can conclude that gateway role state is to disconnect connecting from the gateway of net It connects.
If gateway role state, which is from the gateway of gateway, with gateway role state to be three times continuously primary gateway Gateway between be successfully established network connection, then the gateway role state be from the gateway of gateway keep client angle Color is constant.
Match referring to Fig. 6, the embodiment of the present application second aspect shows gateway role adaptive under a kind of multi-gateway environment Device is set, described device includes:
Status information broadcast module broadcasts the status information of itself;
Message reception module, for establishing broadcast reception thread in local area network, reception is replied message;
Role's configuration module, configures itself gateway role for replying message according to, disposes net according to gateway role Close the connection of equipment room.
The embodiment of the present application third aspect shows a kind of electronic equipment, comprising:
Processor, and, memory;
The memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to execute the side shown in the embodiment of the present application via the executable instruction is executed Method.
The embodiment of the present application fourth aspect shows a kind of computer readable storage medium, is stored thereon with computer program, The computer program realizes the method shown in the embodiment of the present application when being executed by processor.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. adaptive gateway role configuration method under a kind of multi-gateway environment, which is characterized in that the described method includes:
Broadcast reception thread in local area network is established, the status information of itself is broadcasted;
Reception replies message;
Itself gateway role is configured according to described reply message, the connection between gateway is disposed according to gateway role.
2. the method according to claim 1, wherein the basis replies message the step for configuring itself gateway role Suddenly include:
Judge whether to receive and reply message, replied message if do not received, configuring itself gateway role state is primary gateway; Otherwise, according to itself gateway role of the type configuration replied message.
3. according to the method described in claim 2, it is characterized in that, type configuration itself the gateway angle that the basis replies message The step of color includes:
Determine the type replied message;
If replying message is address message, according to the address information in described reply message, configured certainly according to from gateway role Body gateway;
If replying message is status information, according to the gateway status information in described reply message, the local area network is elected The interior intended gateway equipment suitable for server broadcasts primary gateway address information as primary gateway, and, disappeared according to the reply Primary gateway address information in breath configures itself gateway according to from gateway role.
4. according to the method described in claim 3, it is characterized in that, the basis reply message in gateway status information, choosing Enumerate the intended gateway equipment in the local area network suitable for server includes: as the step of primary gateway
In status information, the gateway free memory of each gateway is extracted, and, the gateway free memory of itself generates Gateway free memory collection;
It is concentrated in the gateway free memory, the gateway for electing maximum gateway free memory is as primary gateway.
5. according to the method described in claim 4, it is characterized in that, it is described gateway free memory concentrate, elect maximum The gateway of gateway free memory is as the step of primary gateway
The gateway free memory collection is traversed, filters out the gateway for generating maximum gateway free memory as the first alternative net Close equipment;
Judge whether the quantity of the first candidate gateway equipment is greater than or equal to 1;
If being equal to 1, determine that the first candidate gateway equipment is primary gateway;
If it is greater than 1, in status information, the network delay data of the first candidate gateway equipment are extracted, network is generated and prolongs Slow data set;
In network delay data set, the first candidate gateway equipment of most short network delay data is elected as primary gateway.
6. according to the method described in claim 5, electing most short it is characterized in that, described in network delay data set First candidate gateway equipment of network delay data includes: as the step of primary gateway
Traverses network delayed data collection, the first candidate gateway equipment for filtering out corresponding most short network delay data are standby as second Select gateway;
Judge whether the quantity of the second candidate gateway equipment is greater than or equal to 1;
If being equal to 1, determine that the second candidate gateway equipment is primary gateway;
If it is greater than 1, in status information, the device type data of the second candidate gateway equipment, generating device class are extracted Type data set;
According to the preset ordering rule of cable gateway device type, wireless gateway device type, wifi equipment type, set described The device type data descending arrangement that standby categorical data is concentrated, election sort the second most preceding candidate gateway equipment as major network It closes.
7. method according to claim 1-6, which is characterized in that the method also includes:
Whether primary gateway disconnects in real-time monitoring local area network;
If disconnected, gateway status information in local area network is obtained, elects the target network for being suitable for server in the local area network Close equipment be used as primary gateway, broadcast primary gateway address information, and, according to the primary gateway address information in described reply message by Itself gateway is configured according to from gateway role.
8. adaptive gateway role configuration device under a kind of multi-gateway environment, which is characterized in that described device includes:
Status information broadcast module, for broadcasting itself status information;
Message reception module, for establishing broadcast reception thread in local area network, reception is replied message;
Role's configuration module configures itself gateway role for replying message according to, disposes gateway according to gateway role and sets Connection between standby.
9. a kind of electronic equipment characterized by comprising
Processor, and, memory;
Memory, for storing the executable instruction of the processor;
Wherein, the processor be configured to via execute the executable instruction come perform claim require it is 1 to 7 described in any item Method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program Claim 1 to 7 described in any item methods are realized when being executed by processor.
CN201811574925.1A 2018-12-21 2018-12-21 Adaptive gateway role configuration method and device under a kind of multi-gateway environment Pending CN109617731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811574925.1A CN109617731A (en) 2018-12-21 2018-12-21 Adaptive gateway role configuration method and device under a kind of multi-gateway environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811574925.1A CN109617731A (en) 2018-12-21 2018-12-21 Adaptive gateway role configuration method and device under a kind of multi-gateway environment

Publications (1)

Publication Number Publication Date
CN109617731A true CN109617731A (en) 2019-04-12

Family

ID=66009894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811574925.1A Pending CN109617731A (en) 2018-12-21 2018-12-21 Adaptive gateway role configuration method and device under a kind of multi-gateway environment

Country Status (1)

Country Link
CN (1) CN109617731A (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110247980A (en) * 2019-06-25 2019-09-17 腾讯科技(深圳)有限公司 Gateway control method and gateway in a kind of local area network
CN110535736A (en) * 2019-08-22 2019-12-03 厦门盈趣科技股份有限公司 A kind of method, network node and the home network of dynamic adjustment gateway
CN110730092A (en) * 2019-09-10 2020-01-24 阿里巴巴集团控股有限公司 Method and device for debugging gateway
CN110958323A (en) * 2019-12-11 2020-04-03 厦门大洋通信有限公司 Communication method for Internet of things device
CN111245713A (en) * 2020-03-31 2020-06-05 上海庆科信息技术有限公司 Gateway role processing method, device, storage medium, processor and system
CN111314136A (en) * 2020-02-18 2020-06-19 安科讯(福建)科技有限公司 Method and terminal for triggering LTE Femto gateway switching
CN111865736A (en) * 2020-07-17 2020-10-30 青岛易来智能科技股份有限公司 Equipment control method and device
CN111884888A (en) * 2020-07-27 2020-11-03 宁波奥克斯电气股份有限公司 Referee machine election method and device, intelligent equipment and computer readable storage medium
CN112788798A (en) * 2020-12-15 2021-05-11 福建星网天合智能科技有限公司 Master-slave negotiation multi-gateway intelligent Zigbee network system
CN112839310A (en) * 2020-12-29 2021-05-25 杭州涂鸦信息技术有限公司 Wireless communication method and Mesh device
CN112866967A (en) * 2021-01-21 2021-05-28 北京自如信息科技有限公司 Networking method and device of ZigBee device and computer device
CN113037530A (en) * 2019-12-25 2021-06-25 美的集团股份有限公司 Multi-gateway scene implementation method and system, electronic device and storage medium
CN113542106A (en) * 2020-04-15 2021-10-22 美的集团股份有限公司 Gateway selection method and device in multi-gateway environment and storage medium
CN113596093A (en) * 2021-06-28 2021-11-02 青岛海尔科技有限公司 Device set control method and device, storage medium and electronic device
CN113702912A (en) * 2021-08-26 2021-11-26 中国民用航空总局第二研究所 Main radar switching method in radar networking, radar controller and radar system
CN113709839A (en) * 2021-08-19 2021-11-26 珠海格力电器股份有限公司 Multi-gateway network switching method, device and system, electronic equipment and storage medium
CN113721471A (en) * 2020-05-26 2021-11-30 惠州莫思特智照科技有限公司 Networking system and method of intelligent equipment
CN113885349A (en) * 2021-11-04 2022-01-04 深圳海智创科技有限公司 Local area network autonomous distributed intelligent home management method and system
CN114826889A (en) * 2021-01-28 2022-07-29 星络家居云物联科技有限公司 Computer readable storage medium, gateway device and configuration method thereof
CN114902620A (en) * 2022-04-06 2022-08-12 北京小米移动软件有限公司 Gateway system, gateway equipment identity determination method, device and storage medium
CN115001904A (en) * 2022-05-30 2022-09-02 紫光建筑云科技(重庆)有限公司 High-availability NAT gateway design method
CN115309062A (en) * 2022-07-20 2022-11-08 青岛海尔科技有限公司 Device control method, device, storage medium, and electronic apparatus
CN115442221A (en) * 2022-11-08 2022-12-06 四川启睿克科技有限公司 Distributed home equipment service management method and system
CN115460149A (en) * 2022-10-20 2022-12-09 广州河东科技有限公司 Gateway selection method and storage medium in multi-gateway environment
CN115714776A (en) * 2023-01-09 2023-02-24 杭州涂鸦信息技术有限公司 Method for receiving reported data from equipment and method for reporting data by equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7411915B1 (en) * 2004-07-21 2008-08-12 Cisco Technology, Inc. Automatically configuring switch ports with appropriate features
CN108650142A (en) * 2018-07-17 2018-10-12 青岛海信智慧家居系统股份有限公司 The control method and device of multiple gateway equipment in intelligent domestic system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7411915B1 (en) * 2004-07-21 2008-08-12 Cisco Technology, Inc. Automatically configuring switch ports with appropriate features
CN108650142A (en) * 2018-07-17 2018-10-12 青岛海信智慧家居系统股份有限公司 The control method and device of multiple gateway equipment in intelligent domestic system

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110247980B (en) * 2019-06-25 2021-07-30 腾讯科技(深圳)有限公司 Gateway control method in local area network and gateway
CN110247980A (en) * 2019-06-25 2019-09-17 腾讯科技(深圳)有限公司 Gateway control method and gateway in a kind of local area network
CN110535736A (en) * 2019-08-22 2019-12-03 厦门盈趣科技股份有限公司 A kind of method, network node and the home network of dynamic adjustment gateway
CN110730092A (en) * 2019-09-10 2020-01-24 阿里巴巴集团控股有限公司 Method and device for debugging gateway
CN110958323B (en) * 2019-12-11 2023-08-29 厦门大洋通信有限公司 Internet of things road device communication method
CN110958323A (en) * 2019-12-11 2020-04-03 厦门大洋通信有限公司 Communication method for Internet of things device
CN113037530B (en) * 2019-12-25 2022-04-19 美的集团股份有限公司 Multi-gateway scene implementation method and system, electronic device and storage medium
CN113037530A (en) * 2019-12-25 2021-06-25 美的集团股份有限公司 Multi-gateway scene implementation method and system, electronic device and storage medium
CN111314136B (en) * 2020-02-18 2022-12-27 安科讯(福建)科技有限公司 Method and terminal for triggering LTE Femto gateway switching
CN111314136A (en) * 2020-02-18 2020-06-19 安科讯(福建)科技有限公司 Method and terminal for triggering LTE Femto gateway switching
CN111245713B (en) * 2020-03-31 2022-03-04 上海庆科信息技术有限公司 Gateway role processing method, device, storage medium, processor and system
CN111245713A (en) * 2020-03-31 2020-06-05 上海庆科信息技术有限公司 Gateway role processing method, device, storage medium, processor and system
CN113542106A (en) * 2020-04-15 2021-10-22 美的集团股份有限公司 Gateway selection method and device in multi-gateway environment and storage medium
CN113721471A (en) * 2020-05-26 2021-11-30 惠州莫思特智照科技有限公司 Networking system and method of intelligent equipment
CN113721471B (en) * 2020-05-26 2024-04-26 惠州莫思特智照科技有限公司 Networking system and method of intelligent equipment
CN111865736A (en) * 2020-07-17 2020-10-30 青岛易来智能科技股份有限公司 Equipment control method and device
CN111884888A (en) * 2020-07-27 2020-11-03 宁波奥克斯电气股份有限公司 Referee machine election method and device, intelligent equipment and computer readable storage medium
CN112788798A (en) * 2020-12-15 2021-05-11 福建星网天合智能科技有限公司 Master-slave negotiation multi-gateway intelligent Zigbee network system
CN112839310A (en) * 2020-12-29 2021-05-25 杭州涂鸦信息技术有限公司 Wireless communication method and Mesh device
CN112839310B (en) * 2020-12-29 2023-05-12 杭州涂鸦信息技术有限公司 Wireless communication method and Mesh device
CN112866967A (en) * 2021-01-21 2021-05-28 北京自如信息科技有限公司 Networking method and device of ZigBee device and computer device
CN112866967B (en) * 2021-01-21 2022-11-18 北京自如信息科技有限公司 Networking method and device of ZigBee device and computer device
CN114826889A (en) * 2021-01-28 2022-07-29 星络家居云物联科技有限公司 Computer readable storage medium, gateway device and configuration method thereof
CN113596093A (en) * 2021-06-28 2021-11-02 青岛海尔科技有限公司 Device set control method and device, storage medium and electronic device
CN113709839A (en) * 2021-08-19 2021-11-26 珠海格力电器股份有限公司 Multi-gateway network switching method, device and system, electronic equipment and storage medium
CN113702912A (en) * 2021-08-26 2021-11-26 中国民用航空总局第二研究所 Main radar switching method in radar networking, radar controller and radar system
CN113885349A (en) * 2021-11-04 2022-01-04 深圳海智创科技有限公司 Local area network autonomous distributed intelligent home management method and system
CN114902620A (en) * 2022-04-06 2022-08-12 北京小米移动软件有限公司 Gateway system, gateway equipment identity determination method, device and storage medium
CN114902620B (en) * 2022-04-06 2024-04-30 北京小米移动软件有限公司 Gateway system, gateway equipment identity determining method, device and storage medium
CN115001904A (en) * 2022-05-30 2022-09-02 紫光建筑云科技(重庆)有限公司 High-availability NAT gateway design method
CN115309062A (en) * 2022-07-20 2022-11-08 青岛海尔科技有限公司 Device control method, device, storage medium, and electronic apparatus
CN115460149A (en) * 2022-10-20 2022-12-09 广州河东科技有限公司 Gateway selection method and storage medium in multi-gateway environment
CN115442221A (en) * 2022-11-08 2022-12-06 四川启睿克科技有限公司 Distributed home equipment service management method and system
CN115714776A (en) * 2023-01-09 2023-02-24 杭州涂鸦信息技术有限公司 Method for receiving reported data from equipment and method for reporting data by equipment

Similar Documents

Publication Publication Date Title
CN109617731A (en) Adaptive gateway role configuration method and device under a kind of multi-gateway environment
JP7012836B2 (en) Network slice management method and equipment
US20230247388A1 (en) Communication system, method and device for miniature intelligent sensor
CN109218046B (en) Method and system for managing network slices and storage medium
JP2020511083A (en) Service quality control method and device, SMF, UPF, UE, PCF and AN
CN106506717B (en) A kind of automatic discovering method and equipment
CN103873472A (en) Method for automatically having access to network
US20180123891A1 (en) Method and apparatus for automatic networking of gateway device
CN112671904B (en) Method and device for transmitting equipment state information, storage medium and electronic device
WO2019091439A1 (en) Network slice generation method, device and terminal
CN108650142A (en) The control method and device of multiple gateway equipment in intelligent domestic system
CN113395192B (en) Interconnection method, system and equipment
CN111048086A (en) Voice wake-up method among multiple devices, and auto-negotiation voice wake-up method, device and system
CN112469055A (en) Equipment network distribution method, related equipment and storage medium
CN109040295A (en) Determination method and device, terminal and the storage medium of abnormal broken line
WO2014187295A1 (en) Communication method, terminal and communication system
CN112203261A (en) Charging pile management method and device, electronic equipment and readable storage medium
CN103780436A (en) Network device and connection and maintenance method related to network device
EP2854375B1 (en) Communication processing method, server and terminal
CN113330424A (en) Instruction processing method, instruction processing device, electronic device and storage medium
US10880411B2 (en) Interdevice communications
CN110380981B (en) Flow distribution method and equipment
CN102387062B (en) Method for improving transmission rate of peer-to-peer (p2p) node in crossing network by dynamic bridging contact
CN106982156B (en) Priority setting method, device, communication system, equipment and readable storage medium storing program for executing
EP3570495A1 (en) Device management method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190412

RJ01 Rejection of invention patent application after publication