CN111010318A - Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server - Google Patents

Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server Download PDF

Info

Publication number
CN111010318A
CN111010318A CN201911318064.5A CN201911318064A CN111010318A CN 111010318 A CN111010318 A CN 111010318A CN 201911318064 A CN201911318064 A CN 201911318064A CN 111010318 A CN111010318 A CN 111010318A
Authority
CN
China
Prior art keywords
message
server
shadow
equipment
state
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.)
Withdrawn
Application number
CN201911318064.5A
Other languages
Chinese (zh)
Inventor
王西刚
陈涛
许晓伟
张学
杨千秋
董芸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Capitek Co ltd
Original Assignee
Beijing Capitek 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 Beijing Capitek Co ltd filed Critical Beijing Capitek Co ltd
Priority to CN201911318064.5A priority Critical patent/CN111010318A/en
Publication of CN111010318A publication Critical patent/CN111010318A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • H04L41/064Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis involving time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a system for discovering loss of connection of terminal equipment of the Internet of things and an equipment shadow server, and relates to the technical field of the Internet of things. The method comprises the following steps: the method comprises the steps that a device shadow server receives a first message from a message queue server, wherein the first message is used for determining the state of the terminal device; and the equipment shadow server updates the state recorded in the equipment shadow of the terminal equipment according to the first message, wherein the state comprises loss of connection. The method and the device solve the problems that in the related technology, the heartbeat request is frequently sent to the terminal equipment to acquire the heartbeat information or the database is called to acquire the heartbeat information, so that the performance of the server is insufficient and the state of the terminal equipment is not found timely.

Description

Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server
Technical Field
The invention relates to the technical field of Internet of things, in particular to a method and a system for discovering loss of connection of terminal equipment of the Internet of things and an equipment shadow server.
Background
In the application of the internet of things, terminal equipment is used as carriers of various service data and executors of various actions, and data transmission with a server side is required frequently. In general, before a server sends data to a terminal device, it is necessary to determine whether the terminal device is in normal communication, i.e., whether the terminal device is lost. If the terminal equipment is lost, the terminal equipment cannot receive the data from the server side and cannot execute the expected action.
At present, a communication connection maintenance mechanism in the internet of things is simple, heartbeat information is sent to a server terminal actively at regular time for terminal equipment of the internet of things, and then the received heartbeat information is stored in a database by the server terminal. Before sending data to the terminal device, the server needs to send a heartbeat request to the terminal device to obtain heartbeat information or call the heartbeat information in the database to judge whether the terminal device is lost.
With the development of the internet of things technology, the access amount of the internet of things equipment is increasingly higher, the scene is increasingly complex, and the server side sends data to the terminal equipment more frequently, so that the loss of connection of the terminal equipment needs to be found more timely. Before sending data to the terminal device, the server needs to send a heartbeat request to the terminal device to obtain heartbeat information or call the heartbeat information in the database to judge whether the terminal device is lost, so that the prior art has the problems that the state of the terminal device is not found timely, and the server performance is insufficient due to the fact that the heartbeat request is frequently sent to the terminal device to obtain the heartbeat information or the database is called to obtain the heartbeat information.
Disclosure of Invention
In order to solve the technical problem, embodiments of the present application provide a method, a system, and an equipment shadow server for discovering an offline of an internet of things terminal device.
According to a first aspect of some embodiments of the present invention, there is provided a method for discovering an offline terminal device of an internet of things, including: the method comprises the steps that a device shadow server receives a first message from a message queue server, wherein the first message is used for determining the state of the terminal device; and the equipment shadow server updates the state recorded in the equipment shadow of the terminal equipment according to the first message, wherein the state comprises loss of connection.
In some embodiments, the updating the state recorded in the device shadow of the terminal device includes: and when the first message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment to be offline.
In some embodiments, the method for discovering the loss of the internet of things terminal device further includes: when the equipment shadow server receives a second message uploaded by the terminal equipment from the message queue server, online data is recorded, so that the offline monitoring server periodically scans the online data and calls an offline warning and warning server to send the offline warning message to the message queue server when a set condition is met.
In some embodiments, the online data comprises: the terminal device identifier and the time when the terminal device reports the second message, where the online data is recorded in an online log file, and the invoking of the offline warning server to send the offline warning message to the message queue server when a set condition is met includes: when the difference value between the time of scanning the online log file by the offline monitoring server and the time of the second message reported by the terminal device last time recorded in the online log file exceeds a set value, calling the offline warning elimination server to send an offline warning message to the message queue server, wherein the method further comprises the following steps: and the equipment shadow server updates the online log files to a database in batches at regular time.
In some embodiments, the state further includes online, and the method for discovering that the terminal device of the internet of things is lost further includes: when the device shadow server receives the second message uploaded by the terminal device from the message queue server, if the state recorded in the device shadow of the terminal device is offline, the device shadow server calls the offline notification warning server to send an offline warning message to the message queue server, wherein the updating of the state recorded in the device shadow of the terminal device further includes: and when the first message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment to be online.
In some embodiments, the method for discovering the loss of the internet of things terminal device further includes: the device shadow server updating the device shadow according to a third message received from the message queue server, wherein the device shadow server updating the device shadow according to the message comprises: when the third message is a message of newly added terminal equipment, adding an equipment shadow by the equipment shadow server, wherein the state of the terminal equipment recorded in the newly added equipment shadow is not activated; when the third message is a message for deleting terminal equipment, the equipment shadow server deletes the equipment shadow of the terminal equipment; and when the third message is a message for replacing the terminal equipment, the equipment shadow server deletes the equipment shadow of the terminal equipment, adds an equipment shadow, and the state of the terminal equipment recorded in the added equipment shadow is not activated.
In some embodiments, the updating the state recorded in the device shadow of the terminal device further includes: when the device shadow server receives a second message uploaded by the terminal device from the message queue server, if the state of the terminal device recorded in the device shadow data is not activated, the state recorded in the device shadow of the terminal device is updated to be online.
In some embodiments, the method for discovering the loss of the internet of things terminal device further includes: after updating the state recorded in the device shadow of the terminal device, the device shadow server writes a state update result into a state log file, wherein the state update result includes: the method comprises the steps of identifying a terminal device, updating state time, alarming state and state of the updated terminal device; and the shadow server updates the state log files to a database in batch at regular time.
According to a second aspect of some embodiments of the present invention, there is provided a device shadow server, comprising: a memory; and a processor coupled to the memory, the processor configured to perform any one of the methods for discovering an internet of things terminal device loss of contact based on instructions stored in the memory.
According to a third aspect of some embodiments of the present invention, there is provided a system for discovering an offline terminal device of an internet of things, including: the message queue server is used for receiving the message, matching the message with a corresponding theme and then sending the matched message to the equipment shadow server; the offline warning and alarm server is used for sending the offline warning message or the offline alarm message to the message queue server when being called; the offline monitoring server is used for monitoring online data in the equipment shadow server and calling the offline warning and warning server to send an offline warning to the message queue server when a set condition is met; and the device shadow server.
Based on the technical scheme of the invention, the state of the terminal equipment can be recorded in the equipment shadow, so that when the server side judges whether the terminal equipment has the communication condition, the server side does not need to frequently send heartbeat requests to the terminal equipment to acquire heartbeat information or call a database to acquire the heartbeat information, thereby improving the running performance of the Internet of things. In addition, the state of the terminal equipment recorded in the equipment shadow is updated by the equipment shadow server according to the type of the message from the message queue server, so that the state of the terminal equipment can be discovered and updated in time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow diagram of a method of discovering an internet of things terminal device loss of contact according to some embodiments of the invention.
Fig. 2 is a schematic flow chart of a method for discovering an internet of things terminal device loss of contact according to other embodiments of the present invention.
Fig. 3 is a schematic flow chart of a method for discovering an internet of things terminal device loss of contact according to further embodiments of the present invention.
Fig. 4 is a schematic flow chart of a method of discovering an internet of things terminal device loss of contact according to further embodiments of the present invention.
Fig. 5 is a schematic flow chart of a method for discovering an internet of things terminal device being lost according to further embodiments of the present invention.
Fig. 6 is a schematic flow chart of a method for discovering an internet of things terminal device loss of contact according to an example of the invention.
FIG. 7 is a block diagram of a device shadow server according to some embodiments of the invention.
Fig. 8 is a schematic structural diagram of a system for discovering an internet of things terminal device loss of contact according to some embodiments of the present invention.
Fig. 9 is a schematic structural diagram of an apparatus for discovering an internet of things terminal device loss of contact according to some embodiments of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless specifically stated otherwise, the relative arrangement of the steps, numerical expressions and numerical values set forth in these examples do not limit the scope of the invention.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
Fig. 1 is a schematic flow diagram of a method of discovering an internet of things terminal device loss of contact according to some embodiments of the invention. As shown in FIG. 1, the method for discovering the loss of the terminal device of the Internet of things in the embodiment comprises steps 110-120.
In step 110, the device shadow server receives a first message from a message queue server, wherein the first message is used to determine a status of the terminal device.
The equipment shadow server is a server for providing the equipment shadow function in the application of the Internet of things. The message queue server is a server providing a message queue function in the application of the internet of things, the embodiment of the invention does not limit the type of the server, and the server can be a local server device or a cloud server.
The message queue server receives different types of messages from the terminal equipment and/or other servers in the Internet of things and matches topics corresponding to the types of the messages for the different types of messages. The device shadow server may receive the corresponding type of message pushed by the message queue server after subscribing to the topics. These topics may include, for example: the method comprises the steps of business, health, alarm and the like, namely the message can be a business message, a health message and/or an alarm message and the like, wherein the business message is business data recorded in the terminal equipment and reported by the terminal equipment in the Internet of things; the health message is data about the health of the terminal device reported by the terminal device, and may be, for example, heartbeat data of the device; the alarm message is alarm information for determining the state of the terminal device, and may be sent to the message queue server by other servers in the internet of things, for example, the alarm message may include: an offline alarm message, and the like. The status of the terminal device may include, for example, offline, online, etc. Embodiments of the present invention are not limited to the above messages, and any message that can be used to determine the state of the terminal device in the messages received by the message queue server is within the scope of the present invention.
In step 120, the device shadow server updates a status recorded in the device shadow of the terminal device according to the first message, where the status includes an offline status.
The device shadow is data recorded in the server and used for caching the device state. To improve performance, the device shadow may be stored, for example, in an in-memory database of the server. In the application scenario of the internet of things, each terminal device has only one device shadow corresponding to the terminal device, and the state of the corresponding terminal device is recorded in the device shadow.
The status recorded in the device shadow of the terminal device is updated through the message, which can be understood as that whether to update the status and/or how to update the status in the device shadow of the terminal device needs to be determined according to the type of the message and the status recorded in the device shadow of the terminal device.
By the method of the embodiment, the state of the terminal equipment can be recorded in the equipment shadow, so that when the server side judges whether the terminal equipment has the communication condition, the server side does not need to frequently send heartbeat requests to the terminal equipment to acquire heartbeat information or call a database to acquire the heartbeat information, and the running performance of the Internet of things is improved; in addition, the state of the terminal equipment recorded in the equipment shadow is updated by the equipment shadow server according to the type of the message from the message queue server, so that the state of the terminal equipment can be discovered and updated in time.
In some embodiments, the message queue is a Kafka message queue. Kafka is a high throughput distributed publish-subscribe messaging system. The purpose of Kafka is to unify online and offline message processing through a parallel loading mechanism, and also to provide real-time messages through clustering. Each message issued to the Kafka cluster has a category, which is called Topic (Topic).
In view of the characteristic that the Kafka message queue has high throughput, the Kafka message queue adopted in the embodiment of the invention can ensure that the state of the terminal device in the device shadow can be updated in time in the application of the internet of things with large number of terminal devices.
In some embodiments, the status recorded in the device shadow of the terminal device may be updated in the following manner: and when the first message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment into offline.
The terminal device uploads the business data and/or the health data at regular time, and when the state recorded in the device shadow of the terminal device is online, if the message uploaded by the terminal device is not received after timeout, the terminal device can be judged to be lost.
FIG. 2 is a schematic flow chart diagram of a process of updating a state recorded in a device shadow of a terminal device according to other embodiments of the present invention. As shown in FIG. 2, the process includes steps 210-220. In this embodiment, the first message in the embodiment of fig. 1 is an offline warning message.
In step 210, the device shadow server receives a second message uploaded by the terminal device from the message queue server.
The message uploaded by the terminal device is data reported by the terminal device in the scene of the internet of things, and may be, for example, service data recorded in the terminal device or health data such as heartbeat information of the terminal device.
In step 211, the device shadow server records the online data.
The online data may include, for example: and the terminal equipment identifier and the time for reporting the message by the terminal equipment, wherein the terminal equipment identifier is information for determining the identity of the terminal equipment.
In step 212, the offline monitoring server scans the online data.
For example, the loss of connection monitoring server determines the identity of the terminal device and the time when the terminal device reports the message by regularly reading the terminal device identifier in the online data and the time when the terminal device reports the message.
In step 213, the loss of connection monitoring server determines whether the online data meets a defined condition.
In step 214, if the limited condition is satisfied, the loss of contact monitoring server calls the loss of contact warning and warning server to send a loss of contact warning message to the message queue server.
For example, when the difference between the time of scanning the online information by the offline monitoring server and the time of reporting the message by the terminal device last time recorded in the online information exceeds a set value, the offline warning server is called to send an offline warning message to the message queue server,
in step 215, the loss of contact alert server sends a loss of contact alert message to the message queue server.
In step 216, the message queue server sends an offline alert message to the device shadow server.
In step 220, after receiving the offline warning message, the device shadow server updates the state of the terminal device from online to offline.
By the method of the embodiment, the equipment shadow server can update the state recorded in the equipment shadow of the terminal equipment into lost connection when the set conditions are met by recording the online data and scanning the online data at regular time, so that the purpose of timely discovering the lost connection of the terminal equipment is realized, and the timeliness of discovering the lost connection of the terminal equipment is improved.
In some embodiments, the device shadow server may write the online data to an online log file.
In some embodiments, the device shadow server also periodically updates the online log file to a database.
When the terminal equipment is in the loss of connection state, if the service and/or health data uploaded by the terminal equipment is received, the terminal equipment can be judged to have the communication condition, and therefore the state recorded in the equipment shadow of the terminal equipment can be updated to be on-line from loss of connection.
FIG. 3 is a schematic flow chart diagram of a process of updating a state recorded in a device shadow of a terminal device in accordance with further embodiments of the present invention. As shown in FIG. 3, based on the embodiment of FIG. 2, the process can include steps 310-320 in addition to steps 210-220. The first message in the embodiment of fig. 1 may also be an out-of-line alert message.
In step 310, the message queue server sends the second message reported by the terminal device to the message queue server.
In step 311, the device shadow server determines whether to call the disconnection notification alert server according to the status recorded in the device shadow of the terminal device.
In step 312, if the status recorded in the device shadow of the terminal device is offline, the device shadow server invokes the offline warning service networker to send an offline warning message to the message queue server.
In step 313, the delinquent alert server sends a delinquent alert message to the message queue server.
In step 314, the message queue server sends an offline alert message to the device shadow server.
In step 320, the device shadow server updates the state of the terminal device from offline to online after receiving the offline warning message.
By the method of the embodiment, when the state of the terminal equipment is offline, the state of the terminal equipment recorded in the equipment shadow can be updated in time after the data uploaded by the terminal equipment is received, so that the purpose of discovering the state of the terminal equipment in time is achieved, and the timeliness of discovering the state of the terminal equipment is improved.
When a terminal device is newly added in the internet of things, a device shadow corresponding to the terminal device needs to be correspondingly newly established, and a terminal in the device shadow of the terminal device is set to be inactive; similarly, when a terminal device is removed from the internet of things, the device shadow of the terminal device needs to be deleted; when a terminal device is replaced in the internet of things, the original device shadow of the terminal device needs to be deleted, a device shadow is newly built, and a terminal in the device shadow of the terminal device is set to be inactive.
Fig. 4 is a flowchart of a method for discovering an internet of things terminal device loss of contact according to further embodiments of the present invention. As shown in fig. 4, on the basis of the embodiments of fig. 2 and 3, the method for discovering the loss of the terminal device of the internet of things in the embodiment may further include steps 410 to 420.
In step 410, the device shadow server receives a third message from the message queue server.
In step 420, the device shadow server updates a device shadow according to the third message.
Updating a device shadow may be understood as adding a device shadow, removing a device shadow or replacing a device shadow.
In some embodiments, the third message may be a new end device message, where the updated device shadow is: and correspondingly establishing a device shadow corresponding to the terminal device by the device shadow server, and setting the terminal in the device shadow of the terminal device to be inactive.
In some embodiments, the third message may be a delete terminal device message, where the update device shadow is: and the device shadow server deletes the device shadow of the terminal device.
In some embodiments, the third message may be a replace terminal device message, where the update device shadow is: the equipment shadow server deletes the original equipment shadow of the terminal equipment, creates an equipment shadow again and sets the terminal in the equipment shadow of the terminal equipment as inactive.
By the method of the embodiment, the timely synchronization of the device shadow data can be realized, and the timely synchronization of the device shadow data is improved.
In the service scene of the internet of things, the state of the terminal device which is newly added or replaced is usually inactive, and the state is changed to be on-line after service report data or device heartbeat data is received. Therefore, in some embodiments of the present invention, when the device shadow server receives the message uploaded by the terminal device, if the state of the terminal device recorded in the device shadow data is inactive, the state recorded in the device shadow terminal device is updated from inactive to online.
After the state in the device shadow of the terminal device is updated, the updated result can be further recorded in a state log file for backup.
Fig. 5 is a flowchart of a method for discovering an internet of things terminal device loss of contact according to further embodiments of the present invention. As shown in FIG. 5, the method for discovering the loss of the terminal device of the Internet of things in the embodiment comprises steps 510-530.
In step 510, the device shadow server receives a message from the message queue server, wherein the message is used to determine the status of the terminal device.
In step 520, the device shadow server updates the status recorded in the device shadow of the terminal device according to the message.
In step 530, the device shadow server writes the status update result into the status log file after the status update.
The status update result may include: the terminal equipment identification code, the updating time, the alarm state, the state of the updated terminal equipment and the like. The terminal equipment identification code is an identity of the terminal equipment and is used for confirming the identity of the terminal equipment. The updating time is the time when the equipment shadow server updates the state of the terminal equipment. The alarm state is used to indicate whether the state in the device shadow is an alarm or not after the state is updated, and the alarm state may include an alarm and no alarm, for example.
By the method of the above embodiment, the recording of the status update can be realized by writing the status update result into the status log. Meanwhile, the state recorded in the state log can play a role in backing up the state recorded in the device shadow, and when the state recorded in the device shadow is lost, the state of the terminal device can be known by calling the state of the device in the state log.
In some embodiments, the status log file is periodically updated to the database in batches.
Fig. 6 is a schematic flow chart of a method for discovering an internet of things terminal device loss of contact according to an example of the invention. The scheme of fig. 6 is an example of the above embodiment. As shown in FIG. 6, the method for discovering the loss of connection of the terminal equipment of the Internet of things in the embodiment comprises steps 610-633.
In step 610, the message queue server sends the message of the new terminal device to the message queue server.
In step 611, the device shadow server adds a device shadow, and the status of the terminal device recorded in the newly-added device shadow is inactive.
In step 612, the message queue server sends the device-reported message to the message queue server.
In step 613, the device shadow server records an online log file.
In step 614, the device shadow server updates the status recorded in the device shadow of the terminal device from inactive to online.
In step 615, the device shadow server will update the result status log.
In step 616, the offline monitoring server periodically scans the online log file.
In step 617, the offline monitoring server determines whether the difference between the scan time and the last time the online log file was recorded exceeds a set value.
In step 618, if the set value is exceeded, the loss of contact monitoring server calls the loss of contact warning and warning server to send a loss of contact warning and warning message.
In step 619, the loss of contact alert server sends a loss of contact alert message to the message queue server.
In step 620, the message queue server sends an out-of-plumb alert message to the device shadow server.
In step 621, the device shadow server updates the status recorded in the device shadow of the terminal device from online to offline.
In step 622, the device shadow server will update the result status log.
In step 623, the message queue server sends the device-reported message to the message queue server.
In step 624, the device shadow server records the online log file.
In step 625, if the status recorded in the device shadow of the terminal device is offline, the device shadow server calls the offline notification alert server to send an offline message to the message queue server.
In step 626, the delinquent alert server sends a delinquent alert message to the message queue server after being invoked.
In step 627, the message queue server sends an out-of-plumb alert message to the device shadow server.
In step 628, the device shadow server sets the status recorded in the device shadow of the terminal device as online from the offline.
In step 629, the device shadow server writes the update results to the status log.
In step 630, the device shadow server adds a device shadow, and the state of the terminal device recorded in the newly added device shadow is inactive.
In step 630, the message queue server sends the replacement terminal device message to the message queue server.
In step 631, the device shadow server deletes the device shadow of the terminal device and creates a new device shadow, where the state of the terminal device recorded in the new device shadow is inactive.
In step 632, the message queue server sends the delete terminal device message to the message queue server.
In step 633, the device shadow server deletes the device shadow of the terminal device.
FIG. 7 is a block diagram of a device shadow server 700 according to some embodiments of the invention. As shown in fig. 7, the device shadow server 700 of this embodiment includes: a memory 710 and a processor 720 coupled to the memory. The processor 720 is configured to execute the method for discovering an internet of things terminal device loss of contact as described in the above embodiments based on the instructions stored in the memory 710.
Optionally, as another embodiment, the device shadow server 700 may further include an input output interface 730, a network interface 740, a storage interface 750, and the like. These interfaces 730, 740, 750, as well as the memory 710 and the processor 720, may be connected, for example, by a bus 760. The input/output interface 730 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 740 provides a connection interface for various networking devices. The storage interface 750 provides a connection interface for external storage devices such as an SD card and a usb disk.
Fig. 8 is a block diagram of a system for discovering an internet of things terminal device loss of contact in accordance with some embodiments of the invention. As shown in fig. 8, the communication connection maintaining system of this embodiment includes a message queue server 81, a device shadow server 82, an unconnected monitoring server 83, and an unconnected warning server 84, where the device shadow server 82 is connected to the message queue server 81, the unconnected monitoring server 83, and the unconnected warning server 84, respectively, and the unconnected warning server 84 is connected to the message queue server 81 and the unconnected monitoring server 83, respectively.
The device shadow server 82 is the device shadow server according to the above embodiments, and will not be described in detail herein. The message queue server 81 is configured to receive a message, match the message with a topic, and send the message to the device shadow server 82. The missed alert server 83 is configured to send a missed alert message or a missed alert message to the message queue server 81 when called. The offline monitoring server 84 is used for monitoring online data in the device shadow server 82 and calling the offline warning elimination server 83 to send an offline warning to the message queue server 81 when a set condition is met.
Fig. 9 is a block diagram of an apparatus 900 for discovering an internet of things terminal device loss of contact according to some embodiments of the invention. The apparatus 900 is configured to execute the method for discovering the loss of contact of the terminal device in the internet of things in the foregoing embodiment. The apparatus 900 includes a receiving module 910 and an updating module 920.
The receiving module 910 is configured to receive a message from a message queue server, where the message is used to determine a status of a terminal device. The updating module 920 is configured to update the state recorded in the device shadow of the terminal device according to the message.
According to the embodiment of the invention, the state of the terminal equipment recorded in the equipment shadow can be updated according to the messages with different themes, so that the state of the terminal equipment is updated more timely, and the timeliness of state updating is improved. In addition, the loss of connection state is recorded in the device shadow, so that in an application scene of the internet of things, when the state of the terminal device needs to be known, a heartbeat request does not need to be frequently sent to the terminal device to obtain heartbeat information or a database is called to obtain the heartbeat information, and the running performance of the internet of things is improved.
According to an embodiment of the present invention, the updating the state recorded in the device shadow of the terminal device includes: when the message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment into offline; and when the message is the offline alarm message, updating the state recorded in the equipment shadow of the terminal equipment to be online.
Optionally, as another embodiment, the apparatus 900 further includes: the recording module is used for recording online data when the message is uploaded by the terminal equipment so that the offline monitoring server can scan the online data regularly; and the sending module is used for calling the loss of contact warning and warning server to send the loss of contact warning message to the message queue server when the set conditions are met.
According to an embodiment of the invention, the online data comprises: the method comprises the following steps that a terminal device identifies and receives the time of the message, the online data are recorded in an online log file, and when a set condition is met, an offline warning and warning server is called to send an offline warning message to a message queue server, and the method comprises the following steps:
and when the difference value between the time of scanning the online log file by the offline monitoring server and the time of receiving the message last time exceeds a set value, calling the offline warning and warning server to send an offline warning message to the message queue server.
Optionally, as another embodiment, the update module is further configured to update the online log file to the database in batches at regular time.
Optionally, as another embodiment, the apparatus 900 further includes: and the calling module is used for calling the unconnection warning server to send the unconnection warning message to the message queue server if the state recorded in the equipment shadow of the terminal equipment is unconnection when the message is the message uploaded by the terminal equipment.
Optionally, as another embodiment, the updating module is further configured to update the device shadow according to the message, where the updating module is configured to add a new device shadow when the message is an added terminal device message, and the state of the terminal device recorded in the new device shadow is inactive; when the message is a message for deleting the terminal equipment, deleting the equipment shadow of the terminal equipment; and when the message is a message for replacing the terminal equipment, deleting the equipment shadow of the terminal equipment, and creating a new equipment shadow, wherein the state of the terminal equipment recorded in the new equipment shadow is not activated.
Optionally, as another embodiment, the updating module is further configured to, when the message is a message uploaded by a terminal device, if the state of the terminal device recorded in the device shadow data is inactive, update the state recorded in the device shadow of the terminal device to be online.
Optionally, as another embodiment, the apparatus 900 further includes: the writing module is configured to write a status update result into a status log file after updating a status recorded in a device shadow of the terminal device, where the status update result includes: the terminal equipment identification code, the time for updating the state, the alarm state and the state of the updated terminal equipment.
According to the embodiment of the invention, the state log file is periodically and massively updated to the database.
The detailed descriptions of the functions and operations of the modules of the apparatus 900 are the same as the detailed descriptions of the steps of the above method embodiments, and are not repeated herein.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program is configured to implement any one of the aforementioned communication connection maintaining methods when executed by a processor.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for discovering the loss of connection of terminal equipment of the Internet of things comprises the following steps:
the method comprises the steps that a device shadow server receives a first message from a message queue server, wherein the first message is used for determining the state of the terminal device;
and the equipment shadow server updates the state recorded in the equipment shadow of the terminal equipment according to the first message, wherein the state comprises loss of connection.
2. The method of claim 1, wherein,
the updating the state recorded in the device shadow of the terminal device includes:
and when the first message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment to be offline.
3. The method of claim 2, further comprising:
when the equipment shadow server receives a second message uploaded by the terminal equipment from the message queue server, online data is recorded, so that the offline monitoring server periodically scans the online data and calls an offline warning and warning server to send the offline warning message to the message queue server when a set condition is met.
4. The method of claim 3, wherein,
the online data includes: a terminal device identification and a time when the terminal device uploads the second message, the online data being recorded in an online log file, wherein,
the step of calling the offline warning and warning server to send the offline warning message to the message queue server when the set conditions are met comprises the following steps:
when the difference value between the time of scanning the online log file by the offline monitoring server and the time of the second message reported by the terminal equipment at the last time recorded in the online log file exceeds a set value, calling the offline warning and warning server to send an offline warning message to the message queue server,
wherein the method further comprises:
and the equipment shadow server updates the online log files to a database in batches at regular time.
5. The method of claim 3, the state further comprising online, the method further comprising:
when the equipment shadow server receives a second message uploaded by the terminal equipment from the message queue server, if the state recorded in the equipment shadow of the terminal equipment is offline, the equipment shadow server calls the offline warning server to send an offline warning message to the message queue server,
wherein the updating the state recorded in the device shadow of the terminal device further comprises:
and when the first message is an offline warning message, updating the state recorded in the equipment shadow of the terminal equipment to be online.
6. The method of claim 5, further comprising:
the device shadow server updating a device shadow based on a third message received from the message queue server, wherein,
the device shadow server updating the device shadow according to the message, comprising:
when the third message is a message of newly added terminal equipment, adding an equipment shadow by the equipment shadow server, wherein the state of the terminal equipment recorded in the newly added equipment shadow is not activated;
when the third message is a message for deleting terminal equipment, the equipment shadow server deletes the equipment shadow of the terminal equipment;
and when the third message is a message for replacing the terminal equipment, the equipment shadow server deletes the equipment shadow of the terminal equipment, adds an equipment shadow, and the state of the terminal equipment recorded in the added equipment shadow is not activated.
7. The method of claim 6, wherein,
the updating the state recorded in the device shadow of the terminal device further includes:
when the device shadow server receives a second message uploaded by the terminal device from the message queue server, if the state of the terminal device recorded in the device shadow data is not activated, the state recorded in the device shadow of the terminal device is updated to be online.
8. The method of any of claims 1-7, further comprising:
after updating the state recorded in the device shadow of the terminal device, the device shadow server writes a state update result into a state log file, wherein the state update result includes: the method comprises the steps that terminal equipment identifies, updates state time, an alarm state and the state of the updated terminal equipment;
and the shadow server updates the state log files to a database in batch at regular time.
9. A device shadow server, wherein:
a memory; and
a processor coupled to the memory, the processor configured to execute the method of discovering an internet of things terminal device loss of contact as recited in any one of claims 1-8 based on instructions stored in the memory.
10. A system for discovering the loss of connection of terminal equipment of the Internet of things comprises the following steps:
the message queue server is used for receiving the message, matching the message with a corresponding theme and then sending the matched message to the equipment shadow server;
the offline warning and alarm server is used for sending the offline warning message or the offline alarm message to the message queue server when being called;
the offline monitoring server is used for monitoring online data in the equipment shadow server and calling the offline warning and warning server to send an offline warning to the message queue server when a set condition is met;
and the device shadow server of claim 9.
CN201911318064.5A 2019-12-19 2019-12-19 Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server Withdrawn CN111010318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911318064.5A CN111010318A (en) 2019-12-19 2019-12-19 Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911318064.5A CN111010318A (en) 2019-12-19 2019-12-19 Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server

Publications (1)

Publication Number Publication Date
CN111010318A true CN111010318A (en) 2020-04-14

Family

ID=70116782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911318064.5A Withdrawn CN111010318A (en) 2019-12-19 2019-12-19 Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server

Country Status (1)

Country Link
CN (1) CN111010318A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492037A (en) * 2020-12-01 2021-03-12 珠海格力电器股份有限公司 Data processing system and method
CN112600881A (en) * 2020-12-01 2021-04-02 珠海格力电器股份有限公司 Method, device, server and storage medium for providing service of internet of things
CN113542390A (en) * 2021-07-12 2021-10-22 山东大学 Internet of things equipment management method and system adopting memory data model
CN114401292A (en) * 2022-01-10 2022-04-26 徐工汉云技术股份有限公司 Equipment message acquisition system and method based on object shadow

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436410A (en) * 2011-12-12 2012-05-02 华中科技大学 On-line storage method of virtual machine inspection point
US20140189036A1 (en) * 2012-12-31 2014-07-03 Alcatel-Lucent Usa, Inc. Opportunistic delivery of content to user devices with rate adjustment based on monitored conditions
CN107037801A (en) * 2015-10-30 2017-08-11 法拉第未来公司 The system and method communicated for vehicle data
CN110380931A (en) * 2019-07-17 2019-10-25 上海庆科信息技术有限公司 Processing method, device, storage medium, processor and the system of connection status

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436410A (en) * 2011-12-12 2012-05-02 华中科技大学 On-line storage method of virtual machine inspection point
US20140189036A1 (en) * 2012-12-31 2014-07-03 Alcatel-Lucent Usa, Inc. Opportunistic delivery of content to user devices with rate adjustment based on monitored conditions
CN107037801A (en) * 2015-10-30 2017-08-11 法拉第未来公司 The system and method communicated for vehicle data
CN110380931A (en) * 2019-07-17 2019-10-25 上海庆科信息技术有限公司 Processing method, device, storage medium, processor and the system of connection status

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112492037A (en) * 2020-12-01 2021-03-12 珠海格力电器股份有限公司 Data processing system and method
CN112600881A (en) * 2020-12-01 2021-04-02 珠海格力电器股份有限公司 Method, device, server and storage medium for providing service of internet of things
CN113542390A (en) * 2021-07-12 2021-10-22 山东大学 Internet of things equipment management method and system adopting memory data model
CN113542390B (en) * 2021-07-12 2022-07-05 山东大学 Internet of things equipment management method and system adopting memory data model
CN114401292A (en) * 2022-01-10 2022-04-26 徐工汉云技术股份有限公司 Equipment message acquisition system and method based on object shadow
CN114401292B (en) * 2022-01-10 2023-06-06 徐工汉云技术股份有限公司 Equipment message acquisition system and method based on object shadow

Similar Documents

Publication Publication Date Title
CN111010318A (en) Method and system for discovering loss of connection of terminal equipment of Internet of things and equipment shadow server
CN107515796B (en) Equipment abnormity monitoring processing method and device
CN109257200B (en) Method and device for monitoring big data platform
KR101871383B1 (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN110650164B (en) File uploading method and device, terminal and computer storage medium
CN110543512A (en) Information synchronization method, device and system
CN113434312A (en) Data blood relationship processing method and device
CN114091704B (en) Alarm suppression method and device
CN111460038A (en) Quasi-real-time data synchronization method and device
CN111427749B (en) Monitoring tool and method for ironic service in opentack environment
CN109831323B (en) Server information management method, management system and server
CN111274032A (en) Task processing system and method, and storage medium
CN111290873B (en) Fault processing method and device
CN108959657A (en) A kind of operation of data modification method and device
CN112073395B (en) File distribution method and device
CN114049065A (en) Data processing method, device and system
CN114726756A (en) Configuration monitoring method and equipment
CN114416560A (en) Program crash analysis aggregation method and system
CN112488462A (en) Unified pushing method, device and medium for workflow data
CN108184141B (en) Processing method of monitoring video task and server
CN111291127A (en) Data synchronization method, device, server and storage medium
CN115103322B (en) Subscription merging method, device, electronic equipment, storage medium and product
CN114615130A (en) Method and device for managing life cycle of infrastructure alarm rule
CN114089712B (en) Data processing method and device
CN117453665A (en) Data processing method, device, equipment and storage medium

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200414

WW01 Invention patent application withdrawn after publication