A method and system for real-time monitoring of the survival state of an internet of things device
By monitoring the heartbeat signals of IoT devices and implementing an automatic reconnection mechanism, the limitations on the number of connected devices and low maintenance efficiency in traditional methods are solved, achieving efficient device status monitoring and automatic reconnection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional IoT device monitoring methods cannot connect a large number of devices simultaneously, and require manual maintenance after network jitter or disconnection, resulting in wasted computing resources and low maintenance efficiency.
By listening to the heartbeat signals of IoT devices, the system determines the device's liveness based on the device type and heartbeat signal status, and automatically reconnects using an exponential backoff strategy. Java NIO and thread pools are used to manage multiple device connections.
It enables the monitoring of more device statuses with less computing resources, automatic reconnection reduces manual operation, improves maintenance efficiency and reduces costs.
Smart Images

Figure CN119583625B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of IoT device monitoring technology, specifically relating to a method and system for real-time monitoring of the liveness status of IoT devices. Background Technology
[0002] Monitoring device heartbeats is necessary because data from sensors or measuring devices needs to be transmitted to the edge computing terminal in real time. Traditionally, after disconnection, manual reconnection is required. By monitoring device heartbeats, the connection can be automatically reconnected after disconnection.
[0003] Edge computing terminals generally refer to microcomputers. Traditionally, each thread monitors a single device, making it impossible to connect hundreds or thousands of measurement devices or sensors simultaneously. Furthermore, each device or sensor is uniquely identified by an IP address and port, and bound to a single thread for monitoring and data transmission. This results in edge computing terminals being unable to connect more sensors or terminal devices due to CPU and memory consumption. Additionally, due to network jitter and other factors, when a terminal device loses connection, it cannot automatically reconnect to the edge computing terminal, requiring manual maintenance. Summary of the Invention
[0004] To overcome the problems existing in the above-mentioned related technologies, this application provides a method and system for real-time monitoring of the liveness status of Internet of Things (IoT) devices.
[0005] According to a first aspect of the embodiments of this application, a method for real-time monitoring of the liveness status of Internet of Things (IoT) devices is provided, including:
[0006] Monitor each IoT device to receive heartbeat signals sent periodically by the IoT devices;
[0007] The liveness status of the IoT device is determined based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device;
[0008] When the IoT device's liveness status is abnormal, reconnect the IoT device.
[0009] Preferably, the device types of the IoT devices include: dual-channel devices and single-channel devices.
[0010] Preferably, determining the liveness status of the IoT device based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device includes:
[0011] When the IoT device is a single-channel or dual-channel device, it is determined whether the IoT device sends a heartbeat signal periodically within a preset time interval. If the IoT device sends a heartbeat signal periodically within the preset time interval, the IoT device's survival status is normal; otherwise, the duration for which the IoT device has not sent a heartbeat signal is determined based on the time when the last heartbeat signal sent by the IoT device is received.
[0012] If the duration for which the IoT device does not send a heartbeat signal reaches a certain threshold, the IoT device's survival status is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the threshold, the IoT device's survival status is normal.
[0013] Preferably, determining the liveness status of the IoT device based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device includes:
[0014] When the IoT device is a single-channel device and a heartbeat signal is received from the IoT device, it is determined whether a reply message from the IoT device has been received. If no reply message is received, the IoT device's survival status is abnormal. If a reply message is received, the reply message is parsed to obtain the current message information and the current status code, and the survival status of the IoT device is determined based on the current message information and the current status code.
[0015] Preferably, determining the liveness status of the IoT device based on the current message information and the current status code includes:
[0016] If the data in the current message information meets the preset data range, and the current status code is the same as the preset status code, then the survival status of the IoT device is normal.
[0017] If the data in the current message does not meet the preset data range, or if the current status code is different from the preset status code, then the survival status of the IoT device is abnormal.
[0018] Preferably, determining the liveness status of the IoT device based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device includes:
[0019] When the IoT device is a single-channel device and a heartbeat signal is received from the IoT device, it is determined whether the current operating status information sent by the IoT device is received. If the current operating status information sent by the IoT device is not received, the IoT device is in an abnormal state. If the current operating status information sent by the IoT device is received, the survival status of the IoT device is determined based on the current operating status information sent by the IoT device.
[0020] Preferably, determining the liveness status of the IoT device based on the current operating status information sent by the IoT device includes:
[0021] If the current operating status information meets the preset first operating status information, the survival status of the IoT device is normal; if the current operating status information meets the preset second operating status information, the survival status of the IoT device is abnormal.
[0022] Preferably, the step of reconnecting the IoT device when the IoT device's liveness status is abnormal includes:
[0023] When the survival status of the IoT device is abnormal, an alarm for device abnormality is triggered;
[0024] The IoT device is reconnected using an exponential backoff strategy.
[0025] If the reconnection to the IoT device is successful, the device malfunction alarm will be deactivated; if the reconnection to the IoT device fails and the number of reconnections reaches the threshold, a device maintenance alarm will be triggered.
[0026] According to a second aspect of the present application, a real-time monitoring system for the liveness status of Internet of Things (IoT) devices is provided, comprising: multiple IoT devices and a server;
[0027] Each of the IoT devices is used to periodically send heartbeat signals to the server;
[0028] The server is configured to determine the liveness status of the IoT device based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device; and to reconnect to the IoT device when the liveness status of the IoT device is abnormal.
[0029] According to a third aspect of the present application, an electronic device is provided, comprising: at least one processor and a memory; wherein the memory and the processor are connected via a bus.
[0030] The memory is used to store one or more programs;
[0031] When the one or more programs are executed by the at least one processor, the method for real-time monitoring of the liveness status of IoT devices is implemented.
[0032] According to a fourth aspect of the embodiments of this application, a readable storage medium is provided, on which an executable program is stored, wherein when the executable program is executed, the method for real-time monitoring of the liveness status of IoT devices is implemented.
[0033] The technical solution provided by this invention has the following beneficial effects:
[0034] This invention provides a method and system for real-time monitoring of the liveness status of IoT devices. By monitoring each IoT device to receive heartbeat signals periodically sent by the IoT devices, the liveness status of the IoT devices is determined based on the periodically sent heartbeat signals and the device type of the IoT devices. When the liveness status of an IoT device is abnormal, the device is reconnected. This not only enables monitoring of more device statuses with less computing resources, reducing the cost of purchasing servers, but also automatically realizes status monitoring and reconnection, reducing manual operation, greatly improving maintenance efficiency and reducing maintenance costs. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of a method for real-time monitoring of the liveness status of IoT devices provided in an embodiment of the present invention;
[0037] Figure 2 This is a flowchart of single-threaded multi-device monitoring provided in an embodiment of the present invention;
[0038] Figure 3 This is a flowchart of a single-threaded process for reconnecting a disconnected device, provided in an embodiment of the present invention.
[0039] Figure 4 This is a structural block diagram of an IoT device liveness status real-time monitoring system provided in an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of the device heartbeat monitoring process provided in an embodiment of the present invention;
[0041] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the following embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0043] Example 1
[0044] This invention provides a method for real-time monitoring of the liveness status of IoT devices, such as... Figure 1 As shown, it includes the following steps:
[0045] Step 101: Listen to each IoT device to receive the heartbeat signals sent periodically by the IoT devices;
[0046] Step 102: Determine the liveness status of the IoT device based on the heartbeat signals periodically sent by the IoT device and the device type of the IoT device;
[0047] Step 103: When the IoT device's liveness status is abnormal, reconnect the IoT device.
[0048] Specifically, IoT devices can be, but are not limited to, sensors or measuring devices.
[0049] Understandably, monitoring a device's heartbeat typically refers to monitoring its health and connectivity status to ensure it is functioning properly and maintaining a connection with the system or network. Generally, within a network or system, devices periodically send heartbeat signals to indicate their presence and operational status.
[0050] In some embodiments, IoT devices periodically send heartbeat signals to servers or monitoring systems, which may, but are not limited to, using network communication protocols (such as HTTP, TCP, etc.) to send data packets containing information such as device ID and timestamps.
[0051] Furthermore, upon receiving a heartbeat signal from an IoT device, the current state of the IoT device and the time when the heartbeat signal was last received are recorded.
[0052] Furthermore, the device types of IoT devices include: dual-channel devices and single-channel devices.
[0053] Dual-channel devices can receive and send information. For dual-channel devices, this invention uses periodic heartbeat sending and receiving to determine the liveness status of the IoT device. Further, step 102 includes:
[0054] Step 1021: When the IoT device is a dual-channel device, determine whether the IoT device sends a heartbeat signal periodically within a preset time interval. If the IoT device sends a heartbeat signal periodically within the preset time interval, the IoT device's survival status is normal; otherwise, determine the duration for which the IoT device has not sent a heartbeat signal based on the time when the last heartbeat signal sent by the IoT device was received.
[0055] Step 1022: If the duration for which the IoT device does not send a heartbeat signal reaches the duration threshold, the IoT device's survival status is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the duration threshold, the IoT device's survival status is normal.
[0056] Understandably, if an IoT device fails to send a heartbeat signal at the preset time interval, it may mean that the IoT device is in an abnormal state or has lost connection.
[0057] Since single-channel devices can only transmit information, this invention employs the following three schemes for status monitoring of single-channel devices to ensure compatibility with various single-channel devices. The first scheme includes: Further, step 102 also includes:
[0058] Step 1023: When the IoT device is a single-channel device, determine whether the IoT device sends a heartbeat signal periodically within a preset time interval. If the IoT device sends a heartbeat signal periodically within the preset time interval, the IoT device's survival status is normal; otherwise, determine the duration for which the IoT device has not sent a heartbeat signal based on the time when the last heartbeat signal sent by the IoT device was received.
[0059] Step 1024: If the duration for which the IoT device does not send a heartbeat signal reaches the duration threshold, the IoT device's survival status is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the duration threshold, the IoT device's survival status is normal.
[0060] The second option includes: further, step 102 also includes:
[0061] Step 1025: When the IoT device is a single-channel device and a heartbeat signal is received from the IoT device, determine whether a reply message from the IoT device has been received. If no reply message from the IoT device is received, the IoT device's survival status is abnormal. If a reply message from the IoT device is received, parse the reply message to obtain the current message information and the current status code, and determine the IoT device's survival status based on the current message information and the current status code.
[0062] Furthermore, the liveness status of IoT devices is determined based on the current message information and the current status code, including:
[0063] If the data in the current message meets the preset data range, and the current status code is the same as the preset status code, then the IoT device is in a normal state of survival.
[0064] If the data in the current message does not meet the preset data range, or if the current status code is different from the preset status code, the IoT device's survival status is abnormal.
[0065] In some embodiments, preset data values can also be set to determine the current message information, which can be set according to actual needs.
[0066] It should be noted that the present invention does not limit the "preset data range" and "preset status code," which can be set by those skilled in the art based on experimental data or expert experience, etc. In some embodiments, for example, if the IoT device is a thermometer, the current message information and the current status code are obtained by parsing the reply message sent by the device. If the data in the current message information is that the temperature at the current moment of collection is 60 degrees, but the preset data range is 26 degrees to 40 degrees, then the survival status of the IoT device thermometer is abnormal; if the current status code is 0, while the preset status code is 1, then the survival status of the IoT device thermometer is abnormal.
[0067] The third option includes: further, step 102 also includes:
[0068] Step 1026: When the IoT device is a single-channel device and a heartbeat signal is received from the IoT device, determine whether the current operating status information sent by the IoT device is received. If the current operating status information sent by the IoT device is not received, the IoT device is in an abnormal state. If the current operating status information sent by the IoT device is received, determine the survival status of the IoT device based on the current operating status information sent by the IoT device.
[0069] Furthermore, based on the current operating status information sent by the IoT device, the liveness status of the IoT device is determined, including:
[0070] If the current operating status information meets the preset first operating status information, the IoT device's survival status is normal; if the current operating status information meets the preset second operating status information, the IoT device's survival status is abnormal.
[0071] It should be noted that the present invention does not limit the "preset first operating state information" and the "preset second operating state information", which can be set by those skilled in the art based on experimental data or expert experience, etc.
[0072] Further, step 103 includes:
[0073] Step 1031: When the survival status of an IoT device is abnormal, trigger a device abnormality alarm;
[0074] Step 1032: Reconnect the IoT device using an exponential backoff strategy, or take other predefined actions;
[0075] Step 1033: If reconnecting to the IoT device is successful, the device malfunction alarm will be deactivated; if reconnecting to the IoT device fails and the number of reconnections reaches the threshold, a device maintenance alarm will be triggered.
[0076] It should be noted that the present invention does not limit the "other predefined operations", which can be set by those skilled in the art based on experimental data or expert experience, etc.
[0077] Java's NIO is a wrapper around I / O multiplexing. This invention utilizes Java NIO's I / O multiplexing for listening to IoT devices. Furthermore, this invention uses a thread pool or multi-threaded concurrency to process the heartbeat signals of each IoT device being monitored, as detailed below:
[0078] Create a thread pool and allocate a thread for each device connection to monitor device status and perform reconnection operations. In Java, a thread pool (ThreadPoolExecutor) can be used to manage threads, ensuring concurrent monitoring and reconnection operations for multiple devices. An ExecutorService can be used to submit device status monitoring and reconnection tasks.
[0079] Using event listeners:
[0080] Use Java NIO's Selector to monitor the connection status of multiple devices. Once a device's connection is detected to be lost, a reconnection operation is immediately triggered to ensure that the connection can be re-established in a timely manner.
[0081] Automatic reconnection mechanism after connection failure:
[0082] Create an automatic reconnection mechanism using a scheduled task (such as Java's ScheduledExecutorService) to periodically check the device's connection status. Once a device disconnection is detected, immediately initiate a reconnection operation. ScheduledExecutorService can be used to periodically execute device status checks and reconnection tasks.
[0083] Configure reconnection policy:
[0084] In automatic reconnection mechanisms, reconnection strategies can be designed, such as exponential backoff, which gradually increases the reconnection interval to reduce the stress on the system and devices. Dedicated classes can be used to manage reconnection strategies, ensuring that reconnection operations are reasonable and efficient.
[0085] For example, such as Figure 2 As shown, the steps to implement I / O multiplexing and achieve single-threaded multi-device monitoring using Java NIO are as follows:
[0086] Step 1: The IoT device sends a heartbeat or message (e.g., measurement data: voltage, current, inner diameter, radius, diameter) to the server, and the server listens on the device's port or IP address;
[0087] Step 2: Receive message events on a single-threaded loop selector;
[0088] Step 3: Register the device's message sending event to the selector, and communicate with the server through the selectorChannel;
[0089] Step 4: Use a single thread to retrieve registration events from all devices, loop through all messages and heartbeat events, and update the device status.
[0090] For example, such as Figure 3 As shown, the steps for a single thread to reconnect a disconnected device are as follows:
[0091] Step 1: Obtain the registration status of all devices and refresh the device status;
[0092] Step 2: Obtain all disconnected device status object keys (e.g., device ID). The device status object contains attributes such as status and time.
[0093] Step 3: Iterate through the disconnected device key and initiate a reconnection;
[0094] Step 4: Once the connection is successful, change the device status to "connected".
[0095] Step 5: If a device is connected to or deleted multiple times, remove the key from all device status keys. Ensure that all device keys are for devices connected to this server.
[0096] Furthermore, monitoring of various IoT devices, including:
[0097] In Java NIO, create a thread pool called ThreadPoolExecutor, which contains multiple threads.
[0098] Assign one thread to each IoT device;
[0099] The Java NIO multiplexer Selector is used to receive and iterate through heartbeat signals and / or messages sent by IoT devices on each thread in a single thread.
[0100] It's important to note that asynchronous processing refers to a multitasking scenario where the execution of each task does not depend on the completion of other tasks; there's no need to wait for one operation to finish before starting the next. In contrast, synchronous processing requires operations Q to be executed sequentially, with each step waiting for the previous step to complete before it can begin.
[0101] ExecutorService is an interface defined in Java for thread pools, which defines methods related to the execution of background tasks.
[0102] A selector, also known as a multiplexer, is a core component in Java NIO. It is used to check whether the state of one or more NIO Channels is readable or writable. This allows a single thread to manage multiple channels, which means it can manage multiple network connections.
[0103] The advantage of using Selector is that it can process channels with fewer threads, avoiding the overhead of thread context switching compared to using multiple threads.
[0104] ScheduledExecutorService is an interface provided in the Java concurrency package for executing scheduled tasks. It inherits from the ExecutorService interface and provides additional methods to schedule and control the execution of scheduled tasks. ScheduledExecutorService has thread pool characteristics and can also implement task loop execution. It can be regarded as a simple scheduled task component. Because of the thread pool feature, tasks can be executed concurrently by multiple threads without affecting each other. When a task arrives, a thread is actually created to execute it. We can use it to do some ordinary scheduled loop tasks, such as periodically refreshing dictionary constants, which only requires continuous repetition.
[0105] Example 2
[0106] This invention also provides a real-time monitoring system for the liveness status of IoT devices, such as... Figure 4 As shown, it includes: multiple IoT devices and servers;
[0107] Each IoT device is used to periodically send a heartbeat signal to the server;
[0108] The server is used to determine the liveness status of IoT devices based on the heartbeat signals periodically sent by the IoT devices and the device type of the IoT devices; and to reconnect the IoT devices when the liveness status of the IoT devices is abnormal.
[0109] Furthermore, when the server receives a heartbeat signal from an IoT device, it records the current state of the IoT device and the time when the heartbeat signal was last received.
[0110] Furthermore, the device types of IoT devices include: dual-channel devices and single-channel devices.
[0111] Furthermore, the server includes:
[0112] The first judgment module is used to determine whether the IoT device sends a heartbeat signal periodically within a preset time interval when the device type of the IoT device is a single-channel device or a dual-channel device. If the IoT device sends a heartbeat signal periodically within the preset time interval, the IoT device's survival status is normal; otherwise, the duration for which the IoT device has not sent a heartbeat signal is determined based on the time when the last heartbeat signal sent by the IoT device is received.
[0113] The second judgment module is used to determine the survival status of an IoT device as abnormal if the duration during which the IoT device does not send a heartbeat signal reaches a certain threshold, and the survival status of the IoT device as normal if the duration during which the IoT device does not send a heartbeat signal does not reach the threshold.
[0114] For example, such as Figure 5 As shown, when the IoT device is a dual-channel device, the process for implementing device heartbeat monitoring is as follows:
[0115] IoT devices send heartbeat signals: IoT devices periodically send heartbeat signals to servers or monitoring systems, which can be, but are not limited to, using network communication protocols (such as HTTP, TCP, etc.) to send data packets containing information such as device ID and timestamp;
[0116] The server receives heartbeat signals: The server receives heartbeat signals sent by the device and records the device's status and the time when the heartbeat signal was last received;
[0117] Monitoring device status: The server periodically checks the received heartbeat signals. If the IoT device does not send a heartbeat signal within a preset time interval, it may mean that the device is in an abnormal state or the connection is lost.
[0118] Handling abnormal situations: If the server does not receive a heartbeat signal from the IoT device within a certain period of time, it can issue an alarm for device abnormality and attempt to reconnect the device or take other predefined actions.
[0119] Furthermore, the server also includes:
[0120] The third judgment module is used to determine whether a reply message sent by the IoT device has been received when the device type of the IoT device is a single-channel device and a heartbeat signal sent by the IoT device is received. If no reply message is received, the survival status of the IoT device is abnormal. If a reply message is received, the reply message sent by the IoT device is parsed to obtain the current message information and the current status code, and the survival status of the IoT device is determined based on the current message information and the current status code.
[0121] Furthermore, the third judgment module is also specifically used for:
[0122] If the data in the current message information meets the preset data range, and the current status code is the same as the preset status code, then the survival status of the IoT device is normal.
[0123] If the data in the current message does not meet the preset data range, or if the current status code is different from the preset status code, then the survival status of the IoT device is abnormal.
[0124] Furthermore, the server also includes:
[0125] The fourth judgment module is used to determine whether the current operating status information sent by the IoT device is received when the device type of the IoT device is a single-channel device and the heartbeat signal sent by the IoT device is received. If the current operating status information sent by the IoT device is not received, the IoT device is in an abnormal state; if the current operating status information sent by the IoT device is received, the liveness status of the IoT device is determined according to the current operating status information sent by the IoT device.
[0126] Furthermore, the fourth judgment module is also used for:
[0127] If the current operating status information meets the preset first operating status information, the survival status of the IoT device is normal; if the current operating status information meets the preset second operating status information, the survival status of the IoT device is abnormal.
[0128] For example, when the IoT device is a single-channel device, the following three solutions are used to ensure compatibility with various IoT devices, as detailed below:
[0129] 1) Timeout handling:
[0130] Set a timeout period: The server sets a reasonable timeout period. If no heartbeat signal is received from the IoT device within the specified time, the IoT device can be considered to be in an abnormal state.
[0131] In practical applications, Future or CompletableFuture can be used to implement asynchronous operations, allowing simultaneous monitoring of multiple IoT devices and setting timeouts to detect device status.
[0132] 2) Protocol status code handling:
[0133] Protocol parsing: The server parses the response messages from IoT devices (e.g., measurement data sent by IoT devices, such as measuring the diameter, radius, voltage, or current of a device) according to the protocol used for communication between IoT devices.
[0134] Server-side processing: After receiving the response message from the IoT device, the server determines the device status based on the status code defined in the protocol;
[0135] 3) Self-monitoring and processing:
[0136] IoT devices periodically report: IoT devices periodically report their own status, operating conditions and other data to the server. The server receives and processes this data periodically, and understands the status of the devices by parsing this self-monitoring information.
[0137] Furthermore, the server also includes:
[0138] The reconnection module is used to reconnect the IoT device when the IoT device's liveness status is abnormal.
[0139] Furthermore, the reconnection module is specifically used for:
[0140] When the survival status of an IoT device is abnormal, an alarm for device abnormality is triggered;
[0141] Reconnect IoT devices using an exponential backoff strategy, or take other predefined actions;
[0142] If reconnecting to the IoT device is successful, the device malfunction alarm will be cleared; if reconnecting to the IoT device fails and the number of reconnections reaches the threshold, a device maintenance alarm will be triggered.
[0143] It is understood that the system embodiments provided above correspond to the method embodiments described above, and the specific details can be referred to each other, which will not be repeated here.
[0144] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0145] Example 3
[0146] like Figure 6 As shown, the present invention also provides an electronic device, which may be a computer device, a microcontroller device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, processor, and transceiver component are connected via a bus; the memory can be used to store executable programs, and an exemplary executable program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, which can be accessed and / or modified when instructions are executed.
[0147] The processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and it is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to implement the corresponding method flow or corresponding function, so as to realize the steps of the real-time monitoring method for the liveness status of an Internet of Things device in the above embodiments.
[0148] Example 4
[0149] Based on the same inventive concept, this invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory). This readable storage medium is a memory device within an electronic device, used to store programs and data. It is understood that the storage medium here can include both built-in storage media within the electronic device and extended storage media supported by the electronic device. The storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more executable programs (including program code). It should be noted that the storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Loading and executing one or more instructions stored in the storage medium by the processor can implement the steps of the real-time monitoring method for the liveness status of an IoT device in the above embodiments.
[0150] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0151] This 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 block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0152] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0153] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for real-time monitoring of the survival state of an Internet of Things device, characterized in that, The method comprises the steps of: monitoring each Internet of Things device to receive a heartbeat signal periodically sent by the Internet of Things device; determining the survival state of the Internet of Things device according to the heartbeat signal periodically sent by the Internet of Things device and the device type of the Internet of Things device; reconnecting the Internet of Things device when the survival state of the Internet of Things device is abnormal; the step of determining the survival state of the Internet of Things device according to the heartbeat signal periodically sent by the Internet of Things device and the device type of the Internet of Things device comprises the steps of: when the device type of the Internet of Things device is a single-channel device and the heartbeat signal sent by the Internet of Things device is received, determining whether a reply message sent by the Internet of Things device is received, if the reply message sent by the Internet of Things device is not received, the survival state of the Internet of Things device is abnormal, if the reply message sent by the Internet of Things device is received, analyzing the reply message sent by the Internet of Things device to obtain current message information and a current status code, and determining the survival state of the Internet of Things device according to the current message information and the current status code; the step of determining the survival state of the Internet of Things device according to the current message information and the current status code comprises the steps of: if the data in the current message information meets a preset data range and the current status code is the same as a preset status code, the survival state of the Internet of Things device is normal; if the data in the current message information does not meet the preset data range or the current status code is not the same as the preset status code, the survival state of the Internet of Things device is abnormal; wherein the single-channel device can only send information; the reply message at least includes the following two kinds: measurement data and temperature; the measurement data at least includes the following four kinds: device diameter, device radius, voltage and current; when the reply message is temperature, the preset data range is 26 degrees to 40 degrees.
2. The method of claim 1, wherein, The device type of the Internet of Things device comprises a double-channel device and a single-channel device.
3. The method of claim 1, wherein, the step of determining the survival state of the Internet of Things device according to the heartbeat signal periodically sent by the Internet of Things device and the device type of the Internet of Things device comprises the steps of: when the device type of the Internet of Things device is a single-channel device or a double-channel device, determining whether the Internet of Things device periodically sends a heartbeat signal in a preset time interval, if the Internet of Things device periodically sends a heartbeat signal in a preset time interval, the survival state of the Internet of Things device is normal, otherwise, determining the length of time during which the Internet of Things device does not send a heartbeat signal according to the time when the last heartbeat signal sent by the Internet of Things device is received; if the length of time during which the Internet of Things device does not send a heartbeat signal reaches a length threshold, the survival state of the Internet of Things device is abnormal, if the length of time during which the Internet of Things device does not send a heartbeat signal does not reach the length threshold, the survival state of the Internet of Things device is normal.
4. The method of claim 1, wherein, the step of determining the survival state of the Internet of Things device according to the heartbeat signal periodically sent by the Internet of Things device and the device type of the Internet of Things device comprises the steps of: When the device type of the Internet of Things device is a single-channel device and the heartbeat signal sent by the Internet of Things device is received, it is judged whether the current running state information sent by the Internet of Things device is received, and if the current running state information sent by the Internet of Things device is not received, the abnormal state of the Internet of Things device; if the current running state information sent by the Internet of Things device is received, the survival state of the Internet of Things device is determined according to the current running state information sent by the Internet of Things device.
5. The method of claim 4, wherein, The survival state of the Internet of Things device is determined according to the current running state information sent by the Internet of Things device, comprising: If the current running state information meets the preset first running state information, the survival state of the Internet of Things device is normal; if the current running state information meets the preset second running state information, the survival state of the Internet of Things device is abnormal.
6. The method of claim 1, wherein, When the survival state of the Internet of Things device is abnormal, the Internet of Things device is reconnected, comprising: When the survival state of the Internet of Things device is abnormal, an alarm of device abnormality is triggered; The exponential backoff strategy is used to reconnect the Internet of Things device; If the Internet of Things device is successfully reconnected, the alarm of device abnormality is removed; if the Internet of Things device fails to be reconnected and the number of times of reconnecting the Internet of Things device reaches a threshold, an alarm of device maintenance is triggered.
7. An Internet of Things device alive status real-time monitoring system, characterized in that, Comprise: A plurality of Internet of Things devices and a server; Each of the Internet of Things devices is configured to periodically send a heartbeat signal to the server; The server is configured to determine the survival state of the Internet of Things device according to the heartbeat signal periodically sent by the Internet of Things device and the device type of the Internet of Things device; And when the survival state of the Internet of Things device is abnormal, the Internet of Things device is reconnected; The server further comprises: A third judging module is configured to determine whether a reply message sent by the Internet of Things device is received when the device type of the Internet of Things device is a single-channel device and the heartbeat signal sent by the Internet of Things device is received, and if the reply message sent by the Internet of Things device is not received, the survival state of the Internet of Things device is abnormal; if the reply message sent by the Internet of Things device is received, the reply message sent by the Internet of Things device is parsed to obtain current message information and a current status code, and the survival state of the Internet of Things device is determined according to the current message information and the current status code; The third judging module is further configured to: If the data in the current message information meets a preset data range and the current status code is the same as a preset status code, the survival state of the Internet of Things device is normal; If the data in the current message information does not meet the preset data range or the current status code is not the same as the preset status code, the survival state of the Internet of Things device is abnormal; The single-channel device can only send information; The reply message at least includes the following two kinds: measurement data and temperature; The measurement data at least includes the following four kinds: device diameter, device radius, voltage and current; When the reply message is temperature, the preset data range is 26 degrees to 40 degrees.
8. An electronic device, comprising: The method comprises the steps that: at least one processor and a memory; the memory and the processor are connected through a bus; the memory is used for storing one or more programs; when the one or more programs are executed by the at least one processor, the method for real-time monitoring of the survival state of the Internet of Things device is realized.
9. A readable storage medium, characterized by, The program is executed, and the method for real-time monitoring of the survival state of the Internet of Things device is realized.
Citation Information
Patent Citations
Internet of Things equipment fault tolerance method, device and equipment based on gap and storage medium
CN116389231A
Internet of Things terminal state monitoring method and system, electronic equipment and storage medium
CN117714333A