CN114866365B - Arbitration machine election method, device, intelligent equipment and computer readable storage medium - Google Patents
Arbitration machine election method, device, intelligent equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN114866365B CN114866365B CN202110060677.4A CN202110060677A CN114866365B CN 114866365 B CN114866365 B CN 114866365B CN 202110060677 A CN202110060677 A CN 202110060677A CN 114866365 B CN114866365 B CN 114866365B
- Authority
- CN
- China
- Prior art keywords
- intelligent
- arbiter
- arbitrator
- equipment
- devices
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000012360 testing method Methods 0.000 claims abstract description 47
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012423 maintenance Methods 0.000 claims description 8
- 230000001960 triggered effect Effects 0.000 claims description 4
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 206010033799 Paralysis Diseases 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000005406 washing Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/2816—Controlling appliance services of a home automation network by calling their functionalities
- H04L12/2821—Avoiding conflicts related to the use of home appliances
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1881—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with schedule organisation, e.g. priority, sequence management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/2823—Reporting information sensed by appliance or service execution status of appliance services in a home automation network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Environmental & Geological Engineering (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides an arbitration machine election method, an arbitration machine election device, intelligent equipment and a computer readable storage medium, wherein the arbitration machine election method comprises the following steps: after the intelligent equipment is networked, sending an online message through a multicast message; the other intelligent devices send out own device information in a multicast message mode and test the connectivity of the intelligent devices to the new online intelligent devices; the intelligent equipment which is newly on line receives equipment information sent back by the multicast message, and the connectivity of the intelligent equipment and other intelligent equipment is tested; the intelligent equipment votes for the arbiter according to the connectivity test result between the intelligent equipment and other intelligent equipment; after the voting is finished, the intelligent device with the highest vote count announces itself to be an arbitrator. According to the invention, the message is sent by multicast, so that the election of the arbitrator is realized, the condition that the router disables local area network broadcasting is overcome, meanwhile, the intelligent equipment with the best network state is selected as the arbitrator according to connectivity test, so that the wake-up reaction of the intelligent home system is quicker, and the user experience is improved.
Description
Technical Field
The invention relates to the technical field of intelligent home, in particular to an arbitration machine election method, an arbitration machine election device, intelligent equipment and a computer readable storage medium.
Background
In a distributed intelligent home system, a plurality of devices supporting intelligent wake-up are usually arranged in a local area network, when a wake-up signal is received, the problem that a plurality of intelligent devices respond to a user wake-up instruction at the same time possibly exists, the use experience of a user is affected, in the existing solution, an arbitration machine is selected at the end side, instruction interaction is carried out by the arbitration machine, and further, the fact that which device of the local area network can respond to wake-up is determined.
In the prior art, an arbitrator election is generally performed in a local area network broadcast negotiation mode, when a router disables local area network broadcast, the election method fails to affect the use experience of a user, in addition, when an arbitrator network selected through local area network broadcast is unstable, the situation that the arbitrator frequently goes on and off lines and is disconnected with other intelligent devices easily occurs, so that voice interaction of the user fails to affect the use experience of the user, and therefore, the arbitrator election method which can normally work under the condition that the router disables local area network broadcast and ensures stable connection between the selected arbitrator and other intelligent devices needs to be developed.
Disclosure of Invention
The invention solves the problems that when a router disables local area network broadcast, an arbitration machine election method in the prior art fails and the network connection state of an arbitration machine selected in the prior art is poor.
In order to solve the above problems, the present invention provides an arbitration machine election method, including: after the intelligent equipment is connected with the network and is accessed into the intelligent home system, an online message is sent through a multicast message, and an arbiter election is triggered; after receiving the online message, other intelligent devices in the intelligent home system send out own device information in a multicast message mode, and simultaneously test the connectivity of the own device to the new online intelligent device; the intelligent equipment which is newly online receives equipment information sent back by other intelligent equipment in the intelligent home system through a multicast message, and simultaneously tests the connectivity of the intelligent equipment and other intelligent equipment in the intelligent home system; the intelligent equipment in the intelligent home system votes for the arbiter according to the connectivity test result between itself and other intelligent equipment; after the voting is finished, the intelligent device with the highest vote count announces itself to be an arbitrator; the online message at least comprises the online state, the IP address and the equipment type of the intelligent equipment, and the equipment information at least comprises the online state, the IP address and the equipment type of the intelligent equipment and the connectivity of the intelligent equipment to other intelligent equipment in the group.
Because the multicast message is adopted to copy only one same data packet, the data transmission efficiency is improved under the condition that the network occupation is smaller, the risk that the arbiter cannot elect due to the fact that a router disables local area network broadcasting in the prior art is avoided, the intelligent equipment with the best network condition can be elected to be an arbiter according to the test result of connectivity, the selected arbiter and other intelligent equipment are in a better connection state, the risk that the arbiter is in poor network connection to cause the wake-up failure of a user is reduced, meanwhile, the local arbitration mechanism of the arbiter is elected through the connectivity voting among the intelligent equipment in the intelligent home system, the time is short, the quick election of the arbiter is realized, the control speed of the intelligent equipment after being on line is accelerated, and the use experience of the user is improved.
Furthermore, the intelligent device votes to the intelligent device with the shortest connection time according to the connectivity test result between the intelligent device and other intelligent devices, and elects to be an arbitrator.
The time consumption of connection between the arbitrator selected by the scheme and most intelligent equipment in the intelligent home system is shorter, so that the wake-up speed of the intelligent home system can be improved, and the user experience is improved.
Furthermore, when the connection time of one intelligent device and a plurality of intelligent devices is the same and is the shortest, voting is carried out according to the preset IP address priority sequence of the intelligent devices, or voting is carried out according to the preset device type priority sequence; when the number of votes of the intelligent devices is highest in parallel, voting is carried out according to the preset IP address priority order of the intelligent devices, or the election result of the arbitrator is determined according to the preset device type priority order.
The setting can more reasonably vote under the condition that the connection time is the same, so as to quickly select the arbiter.
Further, when the connection time of one intelligent device and a plurality of intelligent devices is the same and is the shortest, voting is performed to the intelligent device with the smallest IP address.
Specifically, the method can also be set to vote to the intelligent device with the largest IP address, and the specific selection sequence can be preset by a user or a manufacturer.
Further, when the ticket numbers of the plurality of intelligent devices are highest in parallel, the intelligent device with the smallest IP address is judged to be an arbitrator.
Specifically, the intelligent device with the largest selected IP address may be set as the arbiter, and the specific selection sequence may be preset by the user or the manufacturer.
Further, after receiving the online message, other intelligent devices in the intelligent home system send out their own device information in a multicast message manner, and compare the time interval between themselves and the last connectivity test of the new online intelligent device at the same time, if the time interval is smaller than a fourth preset time period t4, the connectivity test is not performed any more, and the result of the last test is directly used, where the fourth preset time period t4 is a preset time period threshold.
The time interval specifically refers to the time interval between the time when the intelligent device receives the online message and the time when the intelligent device and the new online intelligent device perform the last connectivity test, and the setting can effectively avoid the problem that the network of the individual device is unstable and frequently goes online and offline, so that the network connectivity is repeatedly tested.
Furthermore, when the arbiter finds out that the connection of one intelligent device is interrupted, the arbiter updates the online device information in the device information table of the arbiter, and the arbiter does not reselect.
The connection interruption refers to disconnection of the arbitrator and the tcp socket of the intelligent device or timeout of connection of the heartbeat packet, the setting can ensure running stability of the intelligent home system, and the arbitrator election can not be restarted due to offline of one intelligent device, in this case, the arbitrator updates online information in the device information table, marks the intelligent device as off-line or deletes the intelligent device from the device information table.
Further, when one intelligent device finds that the connection between the intelligent device and the arbiter is interrupted, the intelligent device tries to reconnect the arbiter, if the connection fails, the router gateway where the intelligent device is located is pinned, if the intelligent device is connected, the router gateway waits for a sixth preset time t6, if the intelligent device is not connected with the arbiter in a restoration mode, an equipment on-line message is sent, the arbiter is triggered to reselect, and the sixth preset time t6 is a preset time threshold.
Under the condition of short network fluctuation, reelection of the arbiter cannot occur, and when abnormal conditions such as power failure and network disconnection occur in the arbiter, other intelligent devices in the intelligent home system can initiate reelection of the arbiter as soon as possible, so that the online of the arbiter can be always kept, and the problem of operation paralysis of the intelligent home system caused by the fact that the arbiter is suspended is avoided.
Further, the device information is sent in a device information table mode, after the arbiter is selected, each intelligent device sends the device information table through multicast at intervals of a first preset time period t1, the device information table is used for recording device information of the intelligent device and/or indirectly found intelligent devices, and connection time of the intelligent device to other intelligent devices is consumed, when the intelligent device does not receive the device information table of one intelligent device in a second preset time period t2, the intelligent device is judged to be offline, the intelligent device is deleted from the device information table maintained by the arbiter, the first preset time period t1 and the second preset time period t2 are preset time period thresholds, and t2 is more than t1.
The device information timing device sends the notification to other intelligent devices in the intelligent home system, and the devices in the device information table can be guaranteed to be in an on-line state, so that the election of the arbitrator can be rapidly executed, and false information interference of off-line devices is avoided.
Further, each intelligent device triggers a connection time-consuming test from itself to each intelligent device every third preset time period t3, and refreshes a connection time-consuming field in the device information table, wherein the third preset time period t3 is a preset time period threshold.
The setting can detect the connection time-consuming condition of the intelligent equipment and other intelligent equipment at regular time, is convenient for monitoring the network connection state of the intelligent home system, and ensures continuous maintenance and update of the connection time-consuming in the equipment information table.
The invention also discloses an arbitrator election device, which comprises: the message receiving and transmitting module is used for sending or receiving messages in a multicast mode; the connectivity testing module is used for testing the connectivity between all intelligent devices in the intelligent home system; the equipment information table maintenance module is used for generating and maintaining an updated equipment information table; the voting module is used for carrying out arbitration machine voting according to the connection time consumption of each intelligent device and other intelligent devices; and the arbiter determining module is used for determining the intelligent device with the highest vote number to be an arbiter according to the voting result.
Specifically, the message transceiver module is configured to send an online message in a multicast manner when the intelligent device is networked and connected to the intelligent home system, and also be capable of receiving device information sent by other intelligent devices, sending its own device information table at a certain time interval after the arbiter election is generated, and receiving the device information table sent by other intelligent devices, where the arbiter determination module is further configured to execute a subsequent operation after the intelligent device loses connection with the arbiter, and initiate the arbiter to reselect if necessary.
The invention also discloses an intelligent device, which comprises a computer readable storage medium storing a computer program and a processor, wherein the computer program is read and run by the processor to realize the arbitration machine election method.
The invention also discloses a computer readable storage medium storing a computer program which, when read and run by a processor, implements the arbitration machine election method as described above.
Compared with the prior art, the arbitration machine election method, the arbitration machine election device, the intelligent equipment and the computer readable storage medium have the following advantages: after the equipment is networked, a message is sent through multicast, an arbitrator election is initiated, the equipment with the best network condition is selected to be an arbitrator under the condition that a router disables LAN broadcasting, meanwhile, through a connectivity test, the arbitrator is well connected with all intelligent equipment, so that a user obtains good awakening experience, and the network connection state is updated in real time through maintenance and transmission of an equipment information table, thereby ensuring that the current latest connection state information can be directly obtained when new equipment is on line, accelerating the arbitrator election process, further leading the awakening of the intelligent equipment to be quicker, and obtaining better user experience.
Drawings
FIG. 1 is a schematic diagram of an application environment of an arbitration method and apparatus according to an embodiment of the present invention;
FIG. 2 is a flow chart of an arbitration method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of an arbitration method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of an arbitration method according to an embodiment of the present invention;
FIG. 5 is a block diagram of an intelligent device according to an embodiment of the present invention;
FIG. 6 is a functional block diagram of an arbitration method according to an embodiment of the present invention;
reference numerals illustrate:
1-an intelligent home system; 11-an intelligent device; a 111-computer readable storage medium; 112-a processor; 113-a communication module; 2-arbiter election device; 21-a message receiving and transmitting module; 22-connectivity test module; 23-an equipment information table maintenance module; 24-voting module; 25-arbiter determination module.
Detailed Description
The present invention will be further described in detail with reference to the drawings and examples, for the purpose of making the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the described embodiments are some, but not all, embodiments of the invention. The specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The following describes an arbitration election method, an arbitration device, an intelligent device and a computer readable storage medium according to the embodiments of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, in the smart home system 1, a plurality of smart devices 11 are located in the same local area network, the plurality of smart devices 11 can communicate with each other in the form of multicast messages, and when a user sends a control command, the corresponding smart device 11 processes the control command.
It should be understood that the control command issued by the user may be a voice control command (including a wake-up command word, a device control command, etc.) of the smart home system 1, or may be another type of command such as a gesture control command. Taking the control instruction as a voice control instruction as an example, after a user wakes up the voice recognition function of one of the intelligent devices 11 through a wake-up command word, not only can the voice control of the intelligent device 11 be realized through the device control command, but also other intelligent devices 11 in the intelligent home system 1 can be controlled through the waken-up intelligent device 11, namely, the distributed voice control function is realized.
In this embodiment, after one intelligent device 11 is networked and connected to the intelligent home system 1, an arbitrator can be elected among the intelligent devices 11, so that when a user sends a control instruction, the elected arbitrator can determine that one intelligent device 11 is most suitable for processing the control instruction of the user in the intelligent home system 1, thereby effectively avoiding that a plurality of intelligent devices 11 respond to the control instruction of the user at the same time and effectively improving the use experience of the user.
In this embodiment, the intelligent device 11 is a voice control device, such as a home appliance including a voice air conditioner, a voice television, a voice refrigerator, and a voice lamp, or may be a common intelligent home appliance, which is not limited thereto.
Example 1
The present embodiment provides an arbitration method, as shown in fig. 2-4, and it should be noted that the arbitration method of the present invention is not limited by the specific order of fig. 2, 3, and 4. It should be understood that, in other embodiments, the order of some steps in the arbitration method of the present invention may be interchanged according to actual needs, or some steps may be omitted or deleted. The arbitration election method can be applied to the intelligent device 11 shown in fig. 1, and can include the following steps:
step S1, after the intelligent equipment 11 is networked and is accessed into the intelligent home system 1, an online message is sent through a multicast message, and an arbiter election is triggered;
in this embodiment, the online message includes at least the online status of the intelligent device 11 itself, an IP (Internet Protocol, a protocol address of interconnection between networks), and a device type, and the setting sends basic information of the intelligent device 11 to other intelligent devices 11 in the group through the online message.
Step S2, after receiving the online message, other intelligent devices 11 in the intelligent home system 1 send out own device information in a multicast message mode, and simultaneously test the connectivity of the own device information to the newly online intelligent devices 11;
in this embodiment, the device information at least includes basic information of the smart device 11 itself, connectivity of the smart device 11 to other smart devices 11 in the group, including an online status, an IP address, a device type, and the like, and connection time consumed when the smart device 11 is reachable or not reachable, and connection time consumed when the smart device is reachable, and the device information is used for the other smart devices 11 in the smart home system 1 to discover and detect connectivity with the new online smart device 11, so as to prepare for an arbitrator election.
Step S3, the newly-online intelligent device 11 receives device information sent back by other intelligent devices 11 in the intelligent home system 1 through multicast messages, and simultaneously tests connectivity between the intelligent device 11 and other intelligent devices 11 in the intelligent home system 1;
the setting enables the newly-online intelligent device 11 to timely find other intelligent devices 11 in the intelligent home system 1, the connectivity between the intelligent device 11 and other intelligent devices 11 can be determined through the connectivity test, the time consumption of connection when the intelligent device 11 is reachable or unreachable or reachable to other intelligent devices 11 is recorded, and preparation is made for subsequent arbitration machine election.
Step S4, the intelligent equipment 11 in the intelligent home system 1 votes for an arbitrator according to the connectivity test result between the intelligent equipment 11 and other intelligent equipment 11;
according to the connectivity test result, the intelligent device 11 with the best network condition can be selected to be an arbitrator, the selected arbitrator and other intelligent devices 11 are in a better connection state, the risk of wake-up failure of a user caused by poor network connection of the arbitrator is reduced, meanwhile, the local arbitration mechanism of the arbitrator is selected through the connectivity voting among the intelligent devices 11 in the intelligent home system 1, the time is short, the quick election of the arbitrator is realized, the control speed of the intelligent devices 11 after being on line is accelerated, and the user experience is improved.
In step S5, after the voting is completed, the intelligent device 11 with the highest vote count announces itself as an arbitrator.
The arrangement enables the intelligent device 11 in the intelligent home system 1 to determine an arbitrator according to the received information, and the determined arbitrator can be used for determining the awakened intelligent device 11 in the intelligent home system 1 when the user sends out the awakening command word by taking the intelligent device 11 as a voice device as an example. In one embodiment, after a user sends a wake-up command word, the intelligent devices 11 with the same wake-up command word can respectively collect the audio energy corresponding to the wake-up command word, the collected audio energy is reported to an arbitrator, the arbitrator determines one intelligent device 11 from the intelligent home system 1 as the awakened intelligent device 11 based on the received audio energy, so that the plurality of intelligent devices 11 with the same wake-up command word are effectively prevented from being awakened, and based on the setting, a simple example is that the user can wake-up the living room television in a living room, and then control the air conditioner of a bedroom through voice interaction of the living room television, thereby obtaining good user experience.
Therefore, in the arbitration machine election method provided by the invention, when the intelligent equipment 11 is accessed into the intelligent home system 1, the arbitration machine is elected in the intelligent home system 1 in a more flexible and intelligent mode by automatically initiating the arbitration machine election flow; meanwhile, the condition that the router disables local area network broadcasting is effectively solved, normal operation of the intelligent home system 1 is ensured, in addition, the selected arbiter is selected by utilizing the connectivity among all intelligent devices 11 in the intelligent home system 1, so that the selected arbiter and other intelligent devices 11 have good connectivity, the response is quicker when a user wakes up, and the use experience of the user is greatly improved.
Specifically, in this embodiment, in the step S4, the arbitration machine is selected according to the connectivity test result between the device itself and the other intelligent devices 11, and specifically includes: the intelligent devices 11 elect an arbitrator according to the connection time consumption of each other intelligent device 11.
As an embodiment of the invention, after the intelligent device 11 obtains the connection time consumption with other intelligent devices 11, selecting one intelligent device 11 with the shortest connection time consumption as an arbitrator, and adopting the arbitrator selected by the scheme to connect with most intelligent devices 11 in the intelligent home system 1 has shorter time consumption, thereby improving the wake-up speed of the intelligent home system 1 and improving the user experience. During election, the device type and the IP address can be used as a device identification means to vote, or after the devices are ordered in the group according to the type and/or the IP address, the voting can be performed according to the ordering sequence number.
It should be understood that when there are more intelligent devices 11 in the smart home system 1, each intelligent device 11 may select more than two intelligent devices 11 to vote when voting, and the intelligent device 11 with the highest vote is finally used as an arbitrator, and the setting may select a relatively stable and fast device connected to all the intelligent devices 11 as the arbitrator, so as to further ensure the stability of the operation of the arbitrator, and ensure the use experience of the user, and it should be understood that each intelligent device 11 may also select at least one intelligent device with short connection time to vote.
As an embodiment of the present invention, each intelligent device 11 selects an arbitrator which is considered suitable by itself according to connection time consumption with other intelligent devices 11, specifically, each intelligent device 11 selects an intelligent device 11 with shortest connection time consumption as an arbitrator, when connection time consumption of one intelligent device 11 and a plurality of intelligent devices 11 is the same and is the shortest, voting is performed according to a preset priority order of IP addresses of the intelligent devices 11 or according to a preset device type priority order, specifically, an intelligent device 11 with a larger IP address may be selected, an intelligent device 11 with a smaller IP address may also be selected, a device type priority order may be preset by a manufacturer or may be set by a user by himself, in this embodiment, in case of presetting priority levels of a living room television-living room air conditioner-first bedroom air conditioner-second bedroom air conditioner-refrigerator-range hood, in case of the same connection time consumption of one intelligent device 11 and a living room air conditioner-refrigerator-range hood, in this embodiment, voting is performed as an arbitrator, in case of a specific IP address selection order and a specific type priority order may not be set in this embodiment, and the method is more reasonable.
It should be understood that, when the number of tickets of the plurality of intelligent devices 11 is highest in parallel, the result of arbitrating machine election is determined according to the preset IP address priority order of the intelligent devices 11 or according to the preset device type priority order, specifically, the intelligent device 11 with the largest IP address may be determined to be the arbitrating machine, or the intelligent device 11 with the smallest IP address may be determined to be the arbitrating machine, or the final result of arbitrating machine election may be determined according to the preset device type priority order, in this embodiment, in the case of the preset priority order of the living room television-living room air conditioner-first bedroom air conditioner-second bedroom air conditioner-washing machine-refrigerator-range hood, when the situation that the ticket number of the living room air conditioner-first bedroom air conditioner-washing machine is the highest and the ticket number is the same occurs, it should be understood that the preset priority order of the IP address and the preset device type priority order include, but are not limited to the above-listed cases, and the priority order of the IP address and/or the device type may be preset by the user, or may be produced by the user.
The preference order rule used when the intelligent device 11 performs voting may be the same as or different from the preference order rule used when determining the arbitrator, as an example, when one intelligent device 11 finds that there are two or more intelligent devices 11 that are connected with the same time and are not the shortest, it may select a preset IP address preference order to perform voting, for example, vote to the intelligent device 11 with the largest IP address or vote to the intelligent device 11 with the smallest IP address, and when two or more intelligent devices with the same number of votes and the highest number of votes occur in the final voting result, may select to determine the arbitrator according to the preset IP address preference order, or may determine the arbitrator according to the preset priority order of the device type, and the specific combination scheme is not specifically limited in this embodiment.
In this embodiment, each of the smart devices 11 in the smart home system 1 may send device information through multicast at each interval for a first preset time period t1, and notify, through device information, the existence of other smart devices 11 in the smart home system 1 at regular time, where the device information includes an on-line state, an IP address, a device type, and the like, and the first preset time period t1 is a preset time period threshold, which may be 5 seconds, 8 seconds, 10 seconds, and the like, and preferably is 5 seconds.
In this embodiment, each of the intelligent devices 11 generates and maintains a device information table, where the device information table is used to record device information of the intelligent device 11 that is found by itself and/or indirectly, and connection time of the intelligent device 11 to other intelligent devices 11 is consumed, it should be understood that in this case, each intelligent device 11 sends out a device information table that is maintained by itself through multicast at intervals of a first preset time period t1.
Specifically, when the intelligent device 11 does not receive the device information table of a certain intelligent device 11 within the second preset time period, the device is determined to be offline, and is deleted from the device information table maintained by itself, where the second preset time period t2 is a preset time period threshold value, and t2 is greater than t1, in this embodiment, the second preset time period t2 may be 20 seconds, 30 seconds, 40 seconds, and preferably 30 seconds, and the setting may ensure that devices in the device information table are all in an online state, so as to quickly execute election of the arbiter, and avoid false information interference of the offline device.
Preferably, each intelligent device 11 triggers a connection time consuming test from itself to each intelligent device 11 every third preset time period t3, and refreshes a connection time consuming field in a corresponding device information table, where the third preset time period t3 is a preset time period threshold, in this embodiment, the third preset time period t3 may be 8 minutes, 10 minutes, 12 minutes, and the like, preferably 10 minutes, and the setting may be used to detect the connection time consuming condition of the intelligent device 11 and other intelligent devices 11 at regular time, so as to monitor the network connection state of the intelligent home system 1, and ensure continuous maintenance and update of connection time consuming in the device information table.
It should be noted that, when receiving the online message sent by the new online smart device 11, the step S2 executed by the other smart devices 11 in the smart home system 1 specifically includes:
step S21, transmitting the self-maintained equipment information table in a multicast mode;
this setup may help the new online intelligent device 11 discover other devices within the local area network quickly.
Step S211, comparing the time interval between the intelligent device 11 and the last connectivity test of the new online intelligent device, if the time interval is smaller than a fourth preset time period t4, directly using the result of the last test, and not executing step S22; if not less than the fourth preset time period t4, executing step S22;
the time interval specifically refers to a time interval between when the intelligent device 11 receives the online message and a time interval between when the intelligent device 11 and a new online intelligent device 11 perform a last connectivity test, and the setting can effectively avoid a problem that an individual device network is unstable and frequently goes online and offline, so as to cause repeated testing of network connectivity, and the fourth preset time period t4 is a preset time period threshold, and in this embodiment, the fourth preset time period t4 may be 8 seconds, 10 seconds, 12 seconds, and preferably 10 seconds.
Step S22, testing the connection between itself and the new online intelligent device 11 is time-consuming.
Preferably, the following steps may be further performed before the step S211 is performed:
step S210, detecting whether there is a new online smart device 11 in the device information table maintained by the device itself, if yes, executing step S211, and if no, executing step S22.
The setting can determine whether the newly-online intelligent device 11 has the problem of frequent online and offline according to the device information table, and can directly test connectivity of the intelligent device 11 which is not frequently online and offline, so that a time length judging link is avoided.
When the new online intelligent device 11 receives the device information table sent by other intelligent devices 11 in the group, the following steps are executed:
s31: synchronizing other information except the connection and connection time-consuming information in the device information table into the device information table maintained by the device information table, and simultaneously testing the connectivity of the device information table and the intelligent devices 11.
Optionally, the intelligent device 11 in the intelligent home system 1 may vote after completing the connectivity test with the new online intelligent device 11, where the new online intelligent device 11 may vote after completing the connectivity test with other intelligent devices 11 after sending the online message for a fifth predetermined time period t5, where the fifth predetermined time period t5 is a predetermined time period threshold, in this embodiment, the fifth predetermined time period t5 may be 1 second, 2 seconds, 3 seconds, and preferably be 2 seconds, and this setting may ensure that voting is performed after completing the connectivity test, thereby ensuring the timeliness and accuracy of voting.
Optionally, as shown in fig. 4, the arbitration machine election method provided by the present invention further includes:
step S6, when the arbiter finds out that the connection of one intelligent device 11 is interrupted, the arbiter updates the online device information in the device information table of the intelligent device, and the arbiter does not reselect.
It should be noted that in this embodiment, the connection interruption refers to disconnection of the arbitrator from the tcp socket connection of the smart device 11 or timeout of the heartbeat packet connection, and this setting can ensure operation stability of the smart home system 1, and the arbitrator election will not be restarted due to offline of one smart device 11, in which case, the arbitrator updates online information in its device information table, and marks the smart device 11 as being offline or deletes it from the device information table.
Alternatively, as shown in fig. 4, the arbitration machine election method provided by the present invention further includes:
step S7, when one intelligent device 11 finds that the connection between the intelligent device and the arbiter is interrupted, the arbiter is tried to be reconnected, and if the connection fails, step S71 is executed;
step S71, ping the router gateway where the intelligent device 11 is located, if the router gateway is connected, executing step S72;
step S72, wait for the sixth predetermined duration t6, if the connection with the arbiter is restored, then the operation is normal, if the connection with the arbiter is not restored, then send the equipment on-line message, trigger the arbiter to reselect.
If the intelligent device 11 is successfully reconnected to the arbiter, normal operation is continued, and the arbiter reselection is not initiated, in step S71, if the intelligent device 11 is not connected, the network connection is interrupted, in step S72, the recovery connection indicates that the tcp socket connection between the intelligent device 11 and the arbiter is recovered, the heartbeat packet is normal, the device information table or the announcement message sent by the arbiter is received, and if the connection is recovered during a sixth predetermined time period t6, the temporary network fluctuation is indicated, the arbiter is not required to be reselected, wherein the sixth predetermined time period t6 is a preset time period threshold, and in the embodiment, the first predetermined time period t6 is 5 seconds. Under the condition of short network fluctuation, reelection of the arbiter cannot occur, and when abnormal conditions such as power failure and network disconnection occur in the arbiter, other intelligent devices 11 in the intelligent home system 1 can initiate reelection of the arbiter as soon as possible, so that the online of one arbiter can be always kept, and the problem of running paralysis of the intelligent home system 1 cannot occur due to the fact that the arbiter is suspended.
It should be appreciated that when the intelligent device 11 does not receive the device information returned by other intelligent devices 11 within the fifth predetermined time period t5 after sending the online message, the voting choice itself is a referee, and no connectivity detection is performed.
Example 2
The present embodiment provides an intelligent device, where the intelligent device 11 may implement the respective possible steps in embodiment 1, as shown in fig. 5, where the intelligent device 11 includes a computer readable storage medium 111, a processor 112, and a communication module 113, where the computer readable storage medium 111, the processor 112, and the communication module 113 are directly or indirectly electrically connected to each other, so as to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The computer readable storage medium 111 is used to store a program or data, and the computer readable storage medium 111 may be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable read-only memory, an electrically erasable read-only memory, and the like.
The processor 112 is configured to read/write data or programs stored in the computer-readable storage medium 111 and perform corresponding functions. For example, the referee election method provided by the present invention can be implemented when a computer program stored in the computer-readable storage medium 111 is executed by the processor 112.
The communication module 113 is used for establishing a communication connection with other intelligent devices 11 through a network, and for transceiving data through the network.
It should be understood that the architecture shown in fig. 5 is merely a schematic diagram of the architecture of the smart device 11, and that the smart device 11 may also include more or fewer components than those shown in fig. 5, or have a different configuration than those shown in fig. 5, and that each component shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
Example 3
In order to perform the corresponding steps in each possible manner in embodiment 1, this embodiment proposes an implementation manner of an arbiter election device, as shown in fig. 6, it should be noted that, in the arbiter election device 2 provided in the present invention, the basic principle and the technical effects thereof are the same as those of embodiment 1, and for brevity, the details of the corresponding matters in embodiment 1 are referred to where this embodiment is not mentioned. The arbiter election device 2 includes: the device comprises a message transceiving module 21, a connectivity testing module 22, a device information table maintenance module 23, a voting module 24 and an arbiter determining module 25.
In particular, the modules described above may be stored in the computer readable storage medium 111 or solidified in the operating system of the smart device 11 in the form of software or firmware and executed by the processor 112. Meanwhile, data, codes of programs, and the like necessary for executing the above-described modules may be stored in the computer-readable storage medium 111.
The message transceiver module 21 is configured to send or receive a message in a multicast manner, and specifically, in this embodiment, the message transceiver module 21 is configured to send an online message in a multicast manner when the smart device 11 is networked and connected to the smart home system 1, and also be capable of receiving device information sent by other smart devices 11, and send its own device information table at a certain time interval after the arbiter election is generated, and receive the device information table sent by other smart devices 11.
The connectivity test module 22 is used for testing connectivity between the intelligent devices 11 in the intelligent home system 1.
The device information table maintenance module 23 is configured to generate and maintain an updated device information table.
The voting module 24 is used for each intelligent device 11 to perform arbitrator voting according to the time consumption of connection with other intelligent devices 11.
The arbiter determination module 25 is configured to determine, according to the voting result, that the intelligent device 11 with the highest vote number is the arbiter, and the arbiter determination module 25 is further configured to execute steps S7, S71, S72 after the intelligent device 11 loses connection with the arbiter, and initiate an arbiter re-election if necessary.
Example 4
The present embodiment discloses a computer readable storage medium 111, on which a computer program is stored, which when executed can implement the referee election method provided by the present invention, and in the present embodiment, the computer program is executed by the processor 112.
The advantages provided in this embodiment over the prior art are the same as the arbitration machine election method, device and intelligent device described in embodiments 1, 2 or 3, and are not described here again.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the invention, and the scope of the invention should be assessed accordingly to that of the appended claims.
Claims (12)
1. An arbitrator election method, characterized in that the arbitrator election method comprises:
after the intelligent equipment (11) is connected with the internet and is connected with the intelligent home system (1), an online message is sent through a multicast message, and an arbitrator election is triggered;
after receiving the online message, other intelligent devices (11) in the intelligent home system (1) send out own device information in a multicast message mode, and simultaneously test the connectivity of the own device information to the new online intelligent devices (11);
the intelligent equipment (11) which is newly online receives equipment information sent back by other intelligent equipment (11) in the intelligent home system (1) through multicast messages, and meanwhile, the connectivity between the intelligent equipment (11) and the other intelligent equipment (11) in the intelligent home system (1) is tested;
according to the connectivity test result between the intelligent equipment (11) and other intelligent equipment (11), the intelligent equipment (11) in the intelligent home system (1) votes for an arbitrator;
according to the connectivity test result between the intelligent device (11) and other intelligent devices (11), voting to the intelligent device (11) with the shortest connection time consumption, and electing the intelligent device to be an arbitrator;
after the voting is finished, the intelligent device (11) with the highest vote count announces itself to be an arbitrator;
the online message at least comprises the online state, the IP address and the equipment type of the intelligent equipment (11), and the equipment information at least comprises the online state, the IP address and the equipment type of the intelligent equipment (11) and the connectivity of the intelligent equipment (11) to other intelligent equipment (11) in the group.
2. An arbitration method according to claim 1, characterized in that when the connection time of one intelligent device (11) and a plurality of intelligent devices (11) is the same and the connection time is the shortest, voting is performed according to the preset IP address priority order of the intelligent devices (11), or voting is performed according to the preset device type priority order;
when the number of votes of the plurality of intelligent devices (11) is highest in parallel, voting is carried out according to the preset IP address priority order of the intelligent devices (11), or an arbitration machine election result is determined according to the preset device type priority order.
3. An arbitrator election method according to claim 2 characterised in that when the connection time of one intelligent device (11) to a plurality of intelligent devices (11) is the same and the shortest, the intelligent device (11) with the smallest IP address is voted for.
4. An arbitrator election method according to claim 2, characterised in that when the number of tickets of a plurality of intelligent devices (11) is highest in parallel, the intelligent device (11) with the smallest IP address is determined to be the arbitrator.
5. The method for electing an arbitrator according to claim 1, wherein after receiving the online message, the other intelligent devices (11) in the intelligent home system (1) send their own device information in a multicast message manner, and compare the time interval between themselves and the last connectivity test of the new online intelligent device (11), if the time interval is less than a fourth preset time period t4, the connectivity test is not performed any more, and the result of the last test is directly used, where the fourth preset time period t4 is a preset time period threshold.
6. An arbitrator election method according to claim 1 characterised in that when the arbitrator finds an intelligent device (11) connection interrupt, the arbitrator updates the on-line device information in its own device information table without arbitrator reelect.
7. An arbitration method according to claim 1, characterized in that when an intelligent device (11) finds that the connection with the arbiter is interrupted, it tries to reconnect the arbiter, if the connection fails, it pings the router gateway where the intelligent device (11) is located, if it is connected, it waits for a sixth predetermined time period t6, if it does not resume the connection with the arbiter, it sends a device on-line message, it triggers the arbiter to reselect, said sixth predetermined time period t6 being a predetermined time period threshold.
8. The method for electing an arbiter according to claim 1, wherein the device information is sent in a device information table manner, after the arbiter is selected, each intelligent device (11) sends a device information table through multicast every first preset time period t1, the device information table is used for recording the device information of the intelligent device (11) itself and/or indirectly discovered intelligent devices (11), and the connection time of the intelligent device (11) to other intelligent devices (11), when the intelligent device (11) does not receive the device information table of a certain intelligent device (11) within the second preset time period t2, the intelligent device (11) is determined to be offline, and is deleted from the device information table maintained by the arbiter, and the first preset time period t1 and the second preset time period t2 are preset time period thresholds, t2 > t1.
9. The method for electing an arbiter according to claim 8, wherein each of said intelligent devices (11) triggers a connection time-consuming test of itself to each intelligent device (11) every third preset time period t3, and refreshes a connection time-consuming field in said device information table, said third preset time period t3 being a preset time period threshold.
10. An arbiter election device employing an arbiter election method according to any of the claims 1-9, characterized in that said arbiter election device (2) comprises:
the message receiving and transmitting module (21), the said message receiving and transmitting module (21) is used for sending or receiving the message in the form of multicasting;
the connectivity testing module (22), the said connectivity testing module (22) is used for testing the connectivity between every intelligent device (11) in the intelligent home system (1);
an equipment information table maintenance module (23) for generating and maintaining an updated equipment information table;
the voting module (24) is used for carrying out arbitration machine voting on each intelligent device (11) according to the connection time consumption of the intelligent devices (11);
and the arbiter determining module (25) is used for determining that the intelligent device (11) with the highest vote number becomes an arbiter according to the voting result.
11. A smart device, characterized in that the smart device (11) comprises a computer readable storage medium (111) storing a computer program and a processor (112), which computer program, when read and run by the processor (112), implements the arbiter election method according to any of claims 1-9.
12. A computer readable storage medium, characterized in that the computer readable storage medium (111) stores a computer program which, when read and run by a processor (112), implements the arbiter election method according to any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110060677.4A CN114866365B (en) | 2021-01-18 | 2021-01-18 | Arbitration machine election method, device, intelligent equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110060677.4A CN114866365B (en) | 2021-01-18 | 2021-01-18 | Arbitration machine election method, device, intelligent equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114866365A CN114866365A (en) | 2022-08-05 |
CN114866365B true CN114866365B (en) | 2024-01-19 |
Family
ID=82623240
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110060677.4A Active CN114866365B (en) | 2021-01-18 | 2021-01-18 | Arbitration machine election method, device, intelligent equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114866365B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115426213B (en) * | 2022-09-01 | 2023-11-10 | 厦门立林科技有限公司 | Voice panel equipment awakening method, voice panel equipment, system and medium |
CN116582381B (en) * | 2023-07-11 | 2023-10-20 | 北京探境科技有限公司 | Intelligent device control method and device, storage medium and intelligent device |
CN116582382B (en) * | 2023-07-11 | 2023-09-29 | 北京探境科技有限公司 | Intelligent device control method and device, storage medium and electronic device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107070729A (en) * | 2017-06-13 | 2017-08-18 | 深圳市伊特利网络科技有限公司 | Main equipment elects method and system in network linking |
CN110247980A (en) * | 2019-06-25 | 2019-09-17 | 腾讯科技(深圳)有限公司 | Gateway control method and gateway in a kind of local area network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10270610B2 (en) * | 2016-06-12 | 2019-04-23 | Apple Inc. | Selection of a coordinator device for an automated environment |
-
2021
- 2021-01-18 CN CN202110060677.4A patent/CN114866365B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107070729A (en) * | 2017-06-13 | 2017-08-18 | 深圳市伊特利网络科技有限公司 | Main equipment elects method and system in network linking |
CN110247980A (en) * | 2019-06-25 | 2019-09-17 | 腾讯科技(深圳)有限公司 | Gateway control method and gateway in a kind of local area network |
Also Published As
Publication number | Publication date |
---|---|
CN114866365A (en) | 2022-08-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114866365B (en) | Arbitration machine election method, device, intelligent equipment and computer readable storage medium | |
CN109347590B (en) | Synchronization method of DoIP entity in vehicle-mounted Ethernet and DoIP entity | |
CN112738834A (en) | MESH networking network emergency management method and electronic equipment | |
CN111245677A (en) | Communication abnormity reporting method and device, electronic equipment and storage medium | |
CN109981404B (en) | Ad hoc network structure and diagnosis method thereof | |
CN114338464B (en) | Fault diagnosis method, device, equipment and computer readable storage medium | |
CN111935763B (en) | Method for improving data transmission reliability in wireless mesh network and network system | |
CN113905050B (en) | Method, device and system for detecting internet access information | |
CN109040295A (en) | Determination method and device, terminal and the storage medium of abnormal broken line | |
CN111884888A (en) | Referee machine election method and device, intelligent equipment and computer readable storage medium | |
JP2007158569A (en) | Network fault detecting apparatus | |
CN112839310A (en) | Wireless communication method and Mesh device | |
US9024728B2 (en) | Remote activating device | |
CN116260707B (en) | Block chain node disaster recovery method, device and equipment based on consensus and storage medium | |
CN113037798B (en) | Multi-gateway communication method, system, electronic device and storage medium | |
WO2023185214A1 (en) | Network switching method, node, electronic device and readable storage medium | |
CN114087727B (en) | Wireless pairing method, device and system, upper and lower computer nodes and air conditioning unit | |
KR20150104435A (en) | Method of performing transition of operation mode for a routing processor | |
CN113746710B (en) | Relay gateway control system and method based on intelligent central control system | |
CN109818870B (en) | Multicast routing method, device, service board and machine readable storage medium | |
US20050262224A1 (en) | Method for modifying one or more parameters for the operation of a network and subscribers for carrying out this method | |
TWI697224B (en) | Communication system, communication device and computer program pruduct | |
CN115119230A (en) | Method, device, equipment and storage medium for determining master equipment and slave equipment | |
JP5276461B2 (en) | Network system | |
CN110233713B (en) | Multi-link communication method and system based on LLDP message |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |