CN112437146B - Equipment state synchronization method, device and system - Google Patents

Equipment state synchronization method, device and system Download PDF

Info

Publication number
CN112437146B
CN112437146B CN202011296398.XA CN202011296398A CN112437146B CN 112437146 B CN112437146 B CN 112437146B CN 202011296398 A CN202011296398 A CN 202011296398A CN 112437146 B CN112437146 B CN 112437146B
Authority
CN
China
Prior art keywords
node
temporary
event
equipment
zookeeper
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
Application number
CN202011296398.XA
Other languages
Chinese (zh)
Other versions
CN112437146A (en
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 Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co 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 Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011296398.XA priority Critical patent/CN112437146B/en
Publication of CN112437146A publication Critical patent/CN112437146A/en
Application granted granted Critical
Publication of CN112437146B publication Critical patent/CN112437146B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention provides a method, a device and a system for synchronizing equipment states, wherein the method comprises the following steps: receiving a temporary node change event sent by a Zookeeper; monitoring the change condition of a temporary node in the Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line; the method comprises the steps that the state of the equipment is determined according to the change condition of the temporary node, the problem that an access gateway in the related technology issues an online event and offline event of the equipment through redis or kafka and the like, and the state of the equipment cannot timely inform other systems under abnormal conditions can be solved.

Description

Equipment state synchronization method, device and system
Technical Field
The invention relates to the field of equipment, in particular to a method, a device and a system for synchronizing equipment states.
Background
Redis is a KV database based on a memory, kafka is a distributed publishing and subscribing message system, and when an access gateway publishes an online event through Redis or kafka and other publishing devices, the access gateway can notify other systems under normal conditions. In abnormal situations, the device status cannot be timely notified to other systems.
Aiming at the problem that the access gateway issues the online and offline events of the equipment through redis or kafka and the like in the related art, and the equipment state cannot be timely notified to other systems under abnormal conditions, no solution is provided.
Disclosure of Invention
The embodiment of the invention provides a device state synchronization method, device and system, which are used for at least solving the problem that an access gateway issues device online and offline events through redis or kafka and the like in the related art, and the device state cannot be timely notified to other systems under abnormal conditions.
According to an embodiment of the present invention, there is provided a device state synchronization method including:
receiving a temporary node change event sent by a Zookeeper;
monitoring the change condition of a temporary node in a Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line;
and determining the state of the equipment according to the change condition of the temporary node.
Optionally, receiving the temporary node change event sent by the Zookeeper includes:
receiving a node creation event sent by the Zookeeper;
receiving a first node deletion event sent by the Zookeeper;
and receiving a second node deletion event sent by the Zookeeper.
Optionally, monitoring a change condition of the temporary node in the Zookeeper according to the temporary node change event includes:
determining to add a temporary node according to the node creation event;
determining to delete a temporary node according to the first node deletion event;
and determining to delete all temporary nodes corresponding to the access gateway according to the second node deletion event.
Optionally, determining the state of the device according to the change condition of the temporary node includes:
if the node creation event is monitored, determining that the equipment is in an online state;
if the first node deletion event is monitored, determining that the equipment is in an offline state;
and if the second node deletion event is received, determining that all the devices corresponding to the access gateway are in the offline state.
According to another embodiment of the present invention, there is also provided an apparatus for synchronizing device states, including:
the receiving module is used for receiving a temporary node change event sent by the Zookeeper;
a monitoring module, configured to monitor a change condition of a temporary node in a Zookeeper according to the temporary node change event, where the temporary node is created in the Zookeeper when an access gateway detects that a device is online;
and the determining module is used for determining the state of the equipment according to the change condition of the temporary node.
Optionally, the receiving module includes:
the first receiving submodule is used for receiving the node creation event sent by the Zookeeper;
the second receiving submodule is used for receiving the first node deleting event sent by the Zookeeper;
and the third receiving submodule is used for receiving the second node deletion event sent by the Zookeeper.
Optionally, the listening module includes:
the first determining submodule is used for determining to add a temporary node according to the node creating event;
the second determining submodule is used for determining to delete the temporary node according to the first node deletion event;
and the third determining submodule is used for determining to delete all temporary nodes corresponding to the access gateway according to the second node deletion event.
Optionally, the determining module includes:
a fourth determining submodule, configured to determine that the device is in an online state if the node creation event is monitored;
a fifth determining submodule, configured to determine that the device is in an offline state if the first node deletion event is monitored;
and the sixth determining submodule is used for determining that all the devices corresponding to the access gateway are in the offline state if the second node deletion event is received.
According to another embodiment of the present invention, there is also provided a device state synchronization system including:
the access gateway is used for detecting that the equipment is on line or off line, and creating or deleting a temporary node corresponding to the equipment in the zookeeper;
the Zookeeper is used for sending a temporary node change event to the Internet of things platform system;
and the IOT platform system is used for monitoring the change condition of the temporary node in the Zookeeper according to the temporary node change event and determining the state of the equipment according to the change condition of the temporary node.
Optionally, the Zookeeper is configured to send a node creation event or a first node deletion event to the internet of things platform system;
and the Internet of things platform system is used for determining that the equipment is in an online state according to the node creation event or determining that the equipment is in an offline state according to the first node deletion event.
Optionally, the Zookeeper is further configured to delete all temporary nodes created by the access gateway when detecting that the access gateway exits abnormally, and send a second node deletion event to the internet of things platform system;
and the Internet of things platform system is further used for determining that the equipment corresponding to the access gateway is in an offline state according to the second node deletion event.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, comprising a memory in which a computer program is stored and a processor configured to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device, the access gateway creates the temporary node in the Zookeeper when detecting that the device is online, monitors the change event of the temporary node through the Zookeeper, monitors the change condition of the temporary node in the Zookeeper based on the change event of the temporary node, and determines the state of the device, wherein the state of the device comprises an online state and an offline state, namely the device is in the online state or the offline state, the problems that the access gateway issues the online event and the offline event of the device through redis or kafka and the like in the related technology, the state of the device cannot inform other systems in time under abnormal conditions can be solved, the corresponding online and offline of the device can be determined by monitoring the change condition of the temporary node established in the Zookeeper, and the state of the device can be determined in time under the abnormal conditions.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal of a device status synchronization method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of device state synchronization according to an embodiment of the present invention;
FIG. 3 is a flow diagram for managing the online status of an Internet of things device using a zookeeper, according to an embodiment of the invention;
FIG. 4 is a block diagram of a device state synchronization system according to an embodiment of the present invention;
fig. 5 is a block diagram of a structure of online state synchronization of an internet of things device based on zookeeper according to an embodiment of the present invention;
fig. 6 is a block diagram of a device state synchronization apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a hardware structure block diagram of a mobile terminal of the device state synchronization method according to the embodiment of the present invention, as shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for a communication function and an input/output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the device state synchronization method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmitting device 106 may be a Radio FrequeNcy (RF) module, which is used to communicate with the internet via wireless.
Based on the above mobile terminal or network architecture, in this embodiment, a device status synchronization method is provided, and fig. 2 is a flowchart of the device status synchronization method according to the embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, receiving a temporary node change event sent by a Zookeeper;
in the embodiment of the invention, the Zookeeper is a distributed application program coordination service for developing source codes, is software for providing a consistency service for distributed application, and provides functions comprising: configuration maintenance, domain name service, distributed synchronization, group service, etc. Specifically, the Zookeeper triggers a temporary node change event, where the temporary node change event may include a node creation event, a node deletion event, and correspondingly, the step S202 may include: receiving a node creation event sent by the Zookeeper; receiving a first node deletion event sent by the Zookeeper; and receiving a second node deletion event sent by the Zookeeper.
Step S204, monitoring the change condition of a temporary node in the Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line;
in an embodiment of the present invention, the step S204 may specifically include: determining to add a temporary node according to the node creation event; determining to delete a temporary node according to the first node deletion event; and determining to delete all temporary nodes corresponding to the access gateway according to the second node deletion event.
And step S206, determining the state of the equipment according to the change condition of the temporary node.
In this embodiment of the present invention, if the above node creation event is monitored by the Zookeeper, it may be determined that the device is online, and if the above node deletion event is monitored by the Zookeeper, according to a specific type of the node deletion event, it may further be determined that part or all of the device is offline, specifically, step S206 may specifically include: if the node creation event is monitored, determining that the equipment is in an online state; if the first node deletion event is monitored, determining that the equipment is in an offline state; if the second node deletion event is received, all the devices corresponding to the access gateway are determined to be in the offline state, the online state of the devices is represented in a Zookeeper temporary node creating mode, and when the access gateway exits abnormally, due to the fact that the temporary nodes are deleted, other systems can determine the corresponding devices to be offline and online by monitoring the change condition of the temporary nodes in the Zookeeper.
Through the steps S202 to S206, receiving a temporary node change event sent by the Zookeeper; monitoring the change condition of a temporary node in a Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line; the state of the equipment is determined according to the change condition of the temporary node, the problem that the access gateway issues the online and offline events of the equipment through redis or kafka and the like in the related technology, and the state of the equipment cannot inform other systems in time under abnormal conditions can be solved, the online and offline of the corresponding equipment can be determined by monitoring the change condition of the temporary node established in the Zookeeper, and the state of the equipment can be determined in time under the abnormal conditions.
According to the embodiment of the invention, by utilizing the characteristics of the temporary nodes of the zookeeper, the on-line and off-line events of the equipment can be timely published to the Internet of things platform when the access gateway is in normal operation, and the system subscribing the events can receive the events, so that the on-line state of the equipment is updated; and when the access gateway exits abnormally, other systems also receive the message that the temporary node is deleted, and the online equipment on the access gateway can be timely offline before the access gateway exits abnormally. Fig. 3 is a flowchart of managing online status of an internet of things device using zookeeper according to an embodiment of the present invention, as shown in fig. 3, including:
step S301, the Internet of things platform system starts a monitoring function for monitoring/onlineDev child node events;
step S302, the device is on-line and sends a connection request to an access gateway;
step S303, the access gateway creates a temporary node in the zookeeper under the onlineDevs;
step S304, the Internet of things platform system receives a node creation event sent by the zookeeper;
step S305, the Internet of things platform system determines that equipment is on line according to the node creation event;
step S306, the access gateway exits abnormally;
step S307, the zookeeper detects that the access gateway exits abnormally;
step S308, deleting all temporary nodes created by the access gateway by the zookeeper;
step S309, the Internet of things platform system receives a node deletion event (corresponding to the second node deletion event) sent by the zookeeper;
and step S310, the Internet of things platform system determines that the equipment corresponding to the access gateway is off-line according to the node deletion event.
The embodiment of the invention simply and effectively solves the problem by utilizing the relevant characteristics and functions of the zookeeper temporary node. Even when the equipment access gateway exits abnormally, all systems of the Internet of things platform can still receive the offline notification of the equipment in time, and the offline of the equipment is not found through mechanisms such as timing detection and the like.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method according to the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to another embodiment of the present invention, there is also provided a device state synchronization system, and fig. 4 is a block diagram of the device state synchronization system according to the embodiment of the present invention, as shown in fig. 4, including:
the access gateway 42 is used for detecting that the device is online or offline, and creating or deleting a temporary node corresponding to the device in the zookeeper;
the Zookeeper44 is used for sending a temporary node change event to the internet of things platform system;
and the internet of things platform system 46 is configured to monitor a change condition of a temporary node in the Zookeeper according to the temporary node change event, and determine a state of the device according to the change condition of the temporary node.
Optionally, the Zookeeper44 is configured to send a node creation event or a first node deletion event to the internet of things platform system;
and the IOT platform system is used for determining that the equipment is in an online state according to the node creation event or determining that the equipment is in an offline state according to the first node deletion event.
Optionally, the Zookeeper44 is further configured to delete all temporary nodes created by the access gateway when detecting that the access gateway exits abnormally, and send a second node deletion event to the internet of things platform system;
the internet of things platform system 46 is further configured to determine that the device corresponding to the access gateway is in an offline state according to the second node deletion event.
Fig. 5 is a structural block diagram of online state synchronization of an internet of things device based on zookeeper, according to an embodiment of the present invention, as shown in fig. 5, including: the system comprises a plurality of devices (a device 1, a device 2 and a device 3), a plurality of access gateways (an access gateway 1, an access gateway 2 and an access gateway 3), a zookeeper cluster and a plurality of internet of things platform systems (an internet of things platform system 1, an internet of things platform system 2 and an internet of things platform system 3), wherein the device 1 is connected with the access gateways, the device 2 is connected with the access gateways 2, the device 3 is connected with the access gateways 3, then the access gateways are all connected with the zookeeper cluster, and the zookeeper cluster is respectively connected with the internet of things platform system 1, the internet of things platform system 2 and the internet of things platform system 3.
And the zookeeper cluster is used for managing the online state of the equipment and recording the necessary information of the online equipment.
The access gateway is used for receiving a connection request of a device, and after the device authentication, if the connection is legal, a temporary node is created under a zookeeper middle/online device permanent node, the node name is the device id, and the node data is related information of the device (such as device IP, device type, online access gateway information and the like); and when the equipment is offline at the access gateway, the access gateway deletes the temporary node corresponding to the equipment.
Each system of the internet of things platform is used for monitoring child node events under a zookeeper/onlineDev node after starting, and when new equipment is online in an access gateway, a new temporary node is created under the/onlineDev node; when a device goes offline, the corresponding temporal node under the/onlineDevs node will be deleted.
If the access gateway 1, the access gateway 2 or the access gateway 3 exits abnormally, the zookeeper automatically deletes the temporary node created by the access gateway 1, the access gateway 2 or the access gateway 3, and issues a node deletion event to each instrumented platform system which monitors a child node event under the/onlineDevs node, and each instrumented platform system considers that a device corresponding to the access gateway 1, the access gateway 2 or the access gateway 3 is offline.
An internet of things platform system which needs to process the online and offline services of the equipment monitors the/onlineDevs child node event of the zookeeper when starting. When the device is on or off the line of the access gateway, the access gateway creates or deletes a temporary node corresponding to the device under zookeeper/onlineDevs, and at the moment, the IOT platform system receives a sub-node event notification, so that the device is informed of the on or off the line. If the access gateway exits abnormally, the temporary node corresponding to the online device on the access gateway is automatically deleted, and each system of the internet of things platform also receives the notification that the device is offline.
Example 3
In this embodiment, an apparatus state synchronization apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted for brevity. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a block diagram of a device state synchronization apparatus according to an embodiment of the present invention, as shown in fig. 6, including:
a receiving module 62, configured to receive a temporary node change event sent by the Zookeeper;
a monitoring module 64, configured to monitor a change condition of a temporary node in a Zookeeper according to the temporary node change event, where the temporary node is created in the Zookeeper when an access gateway detects that a device is online;
a determining module 66, configured to determine the state of the device according to the change condition of the temporary node.
Optionally, the receiving module 62 includes:
the first receiving submodule is used for receiving the node creation event sent by the Zookeeper;
the second receiving submodule is used for receiving the first node deleting event sent by the Zookeeper;
and the third receiving submodule is used for receiving the second node deletion event sent by the Zookeeper.
Optionally, the listening module 64 includes:
the first determining submodule is used for determining to add a temporary node according to the node creating event;
the second determining submodule is used for determining to delete the temporary node according to the first node deletion event;
and the third determining submodule is used for determining to delete all temporary nodes corresponding to the access gateway according to the second node deletion event.
Optionally, the determining module 66 includes:
a fourth determining submodule, configured to determine that the device is in an online state if the node creation event is monitored;
a fifth determining submodule, configured to determine that the device is in an offline state if the first node deletion event is monitored;
and the sixth determining submodule is used for determining that all the devices corresponding to the access gateway are in the offline state if the second node deletion event is received.
It should be noted that the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 4
An embodiment of the present invention further provides a storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps in any of the method embodiments described above when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, receiving a temporary node change event sent by a Zookeeper;
s2, monitoring the change condition of a temporary node in the Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line;
and S3, determining the state of the equipment according to the change condition of the temporary node.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-ONly Memory (ROM), a RaNdom Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store computer programs.
Example 5
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, receiving a temporary node change event sent by a Zookeeper;
s2, monitoring the change condition of a temporary node in the Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on-line;
and S3, determining the state of the equipment according to the change condition of the temporary node.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A method for device state synchronization, comprising:
receiving a temporary node change event sent by a Zookeeper, wherein the temporary node change event comprises: the method comprises the steps of sending a node creation event when detecting that equipment is online, sending a first node deletion event for deleting temporary nodes when detecting that the equipment is offline, and sending a second node deletion event for deleting all temporary nodes corresponding to an access gateway when detecting that the access gateway exits abnormally;
monitoring the change condition of a temporary node in a Zookeeper according to the temporary node change event, wherein the temporary node is created in the Zookeeper when an access gateway detects that equipment is on line;
and determining the state of the equipment according to the change condition of the temporary node.
2. The method according to claim 1, wherein monitoring the change condition of the temporary node in the Zookeeper according to the temporary node change event comprises:
determining to add a temporary node according to the node creation event;
determining to delete a temporary node according to the first node deletion event;
and determining to delete all temporary nodes corresponding to the access gateway according to the second node deletion event.
3. The method of claim 2, wherein determining the status of the device based on the change in the temporary node comprises:
if the node creation event is monitored, determining that the equipment is in an online state;
if the first node deletion event is monitored, determining that the equipment is in an offline state;
and if the second node deletion event is received, determining that all the devices corresponding to the access gateway are in the offline state.
4. An apparatus state synchronization device, comprising:
a receiving module, configured to receive a temporary node change event sent by a Zookeeper, where the temporary node change event includes: the method comprises the steps of sending a node creation event when detecting that equipment is online, sending a first node deletion event for deleting temporary nodes when detecting that the equipment is offline, and sending a second node deletion event for deleting all temporary nodes corresponding to an access gateway when detecting that the access gateway exits abnormally;
a monitoring module, configured to monitor a change condition of a temporary node in a Zookeeper according to the temporary node change event, where the temporary node is created in the Zookeeper when an access gateway detects that a device is online;
and the determining module is used for determining the state of the equipment according to the change condition of the temporary node.
5. A device state synchronization system, comprising:
the access gateway is used for detecting that the equipment is on line or off line, and creating or deleting a temporary node corresponding to the equipment in the zookeeper;
the Zookeeper is used for sending a temporary node change event to the Internet of things platform system;
the IOT platform system is used for monitoring the change condition of the temporary node in the Zookeeper according to the temporary node change event and determining the state of the equipment according to the change condition of the temporary node;
and the Zookeeper is also used for sending a node creation event to the Internet of things platform system when detecting that the equipment is on line, sending a first node deletion event for deleting the temporary nodes to the Internet of things platform system when detecting that the equipment is off line, and sending a second node deletion event for deleting all the temporary nodes corresponding to the access gateway to the Internet of things platform system when detecting that the access gateway is abnormally withdrawn.
6. The system of claim 5,
and the Internet of things platform system is used for determining that the equipment is in an online state according to the node creation event or determining that the equipment is in an offline state according to the first node deletion event.
7. The system of claim 5,
the Zookeeper is also used for deleting all temporary nodes created by the access gateway when the abnormal exit of the access gateway is detected;
and the Internet of things platform system is further used for determining that the equipment corresponding to the access gateway is in an offline state according to the second node deletion event.
8. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 3 when executed.
9. An electronic device comprising a memory and a processor, wherein the memory has a computer program stored therein, and the processor is configured to execute the computer program to perform the method of any of claims 1 to 3.
CN202011296398.XA 2020-11-18 2020-11-18 Equipment state synchronization method, device and system Active CN112437146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011296398.XA CN112437146B (en) 2020-11-18 2020-11-18 Equipment state synchronization method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011296398.XA CN112437146B (en) 2020-11-18 2020-11-18 Equipment state synchronization method, device and system

Publications (2)

Publication Number Publication Date
CN112437146A CN112437146A (en) 2021-03-02
CN112437146B true CN112437146B (en) 2022-10-14

Family

ID=74694212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011296398.XA Active CN112437146B (en) 2020-11-18 2020-11-18 Equipment state synchronization method, device and system

Country Status (1)

Country Link
CN (1) CN112437146B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314549B (en) * 2022-06-30 2024-03-22 青岛海尔科技有限公司 Offline equipment management method, storage medium and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254100A (en) * 2016-07-27 2016-12-21 腾讯科技(深圳)有限公司 A kind of data disaster tolerance methods, devices and systems
CN111787066A (en) * 2020-06-06 2020-10-16 王科特 Internet of things data platform based on big data and AI

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710554B (en) * 2012-06-25 2015-09-02 深圳中兴网信科技有限公司 The service state detection method of distributed information system and distributed information system
CN102932210B (en) * 2012-11-23 2015-06-24 北京搜狐新媒体信息技术有限公司 Method and system for monitoring node in PaaS cloud platform
CN106375342A (en) * 2016-10-21 2017-02-01 用友网络科技股份有限公司 Zookeeper-technology-based system cluster method and system
CN107276795B (en) * 2017-06-06 2020-06-02 北京小米移动软件有限公司 Container-based information processing method and device, server and terminal
CN110543512B (en) * 2018-05-29 2022-10-04 优信拍(北京)信息科技有限公司 Information synchronization method, device and system
CN108737574B (en) * 2018-06-28 2021-06-29 郑州云海信息技术有限公司 Node offline judgment method, device, equipment and readable storage medium
CN110858168B (en) * 2018-08-24 2023-08-18 浙江宇视科技有限公司 Cluster node fault processing method and device and cluster node

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254100A (en) * 2016-07-27 2016-12-21 腾讯科技(深圳)有限公司 A kind of data disaster tolerance methods, devices and systems
CN111787066A (en) * 2020-06-06 2020-10-16 王科特 Internet of things data platform based on big data and AI

Also Published As

Publication number Publication date
CN112437146A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN107295080B (en) Data storage method applied to distributed server cluster and server
US6665262B1 (en) Distributed fault management architecture
CN101317370B (en) Method and management agent for event notifications correlation
US20050108389A1 (en) Network endpoint health check
US20100228843A1 (en) Element management system in wireless communication network
CN112422684B (en) Target message processing method and device, storage medium and electronic device
CN103309790A (en) Method and device for monitoring mobile terminal
CN106993043B (en) Data communication system and method based on agency
CN105554099A (en) Method and device for balancing load of acquisition servers
MX2010010616A (en) Updating routing and outage information in a communications network.
CN111884875A (en) Offline device determination method and device
CN108632848B (en) Network slice self-optimization coordination method and device
CN112437146B (en) Equipment state synchronization method, device and system
CN110224872B (en) Communication method, device and storage medium
US10931529B2 (en) Terminal device management method, server, and terminal device for managing terminal devices in local area network
CN115550135B (en) Alarm information transmission method, device, network element and storage medium
CN114422335A (en) Communication method, communication device, server and storage medium
CN110635927B (en) Node switching method, network node and network system
CN114143330A (en) Configuration method, device and system of time server
CN113824595A (en) Link switching control method and device and gateway equipment
CN112769889B (en) Service data pushing method and device, storage medium and electronic device
KR100274848B1 (en) Network management method for network management system
CN112583621B (en) Method, equipment and system for automatically quitting commissioning
CN108964955A (en) A kind of loss Trap message lookup method and Network Management System and a kind of SNMP agent
CN117857309A (en) Self-adaptive monitoring method and system based on decentralization

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