Real-time monitoring method and system for survival state of Internet of Things equipment
By monitoring the heartbeat signal of IoT devices and automatically reconnecting according to the device status, the problem of high resource consumption of edge computing terminals and inability to automatically reconnect after equipment is broken is solved, and efficient equipment management and maintenance is achieved.
Patent Information
- Application Number
- CN202411538099.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-10-31
AI Technical Summary
When monitoring and managing a large number of IoT devices, the CPU and memory consumption of edge computing terminals is too high, and multiple devices cannot be connected at the same time, and cannot be automatically reconnected after network jitter or device link is broken, which requires manual maintenance.
By monitoring the heartbeat signals regularly sent by the Internet of Things devices, the device's survival status is determined regularly based on the device type and heartbeat signal, and when the device state is abnormal, the device will be automatically reconnected.
It realizes monitoring more device states using less computing resources, reduces server purchase costs, and reduces manual operations through automated monitoring and reconnection, improves maintenance efficiency and reduces maintenance costs.
Smart Images

Figure CN119583625A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things device monitoring, and in particular relates to a method and system for real-time monitoring of the survival status of Internet of Things devices. Background Art
[0002] Monitor the heartbeat of the device, sensors or measuring devices. The data needs to be transmitted to the edge computing terminal in real time, so it is necessary to monitor the status of the sensor device. The traditional method requires manual operation to reconnect after disconnection. By monitoring the heartbeat of the device, it will automatically reconnect after disconnection.
[0003] Edge computing terminals generally refer to microcomputers. The traditional method uses one thread to monitor one device, which cannot connect hundreds or thousands of measuring devices or sensors at the same time. In addition, a device or sensor is uniquely identified by an IP+port and bound to a thread to monitor and transmit data. This causes the edge computing terminal to be unable to connect to more sensors or terminal devices due to CPU or memory consumption. At the same time, due to network jitter and other reasons, when the terminal device is disconnected, it cannot automatically reconnect to the edge computing device and requires manual maintenance. Summary of the invention
[0004] In order to overcome the problems existing in the above-mentioned related technologies, the present application provides a method and system for real-time monitoring of the survival status of Internet of Things devices.
[0005] According to a first aspect of an embodiment of the present application, a method for real-time monitoring of the survival status of an Internet of Things device is provided, comprising:
[0006] Monitor each IoT device to receive the heartbeat signal sent regularly by the IoT device;
[0007] Determine the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device;
[0008] When the survival status of the Internet of Things device is abnormal, reconnect the Internet of Things device.
[0009] Preferably, the device types of the Internet of Things devices include: dual-channel devices and single-channel devices.
[0010] Preferably, determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes:
[0011] When the device type of the IoT device is a single-channel device or a dual-channel device, determine whether the IoT device regularly sends a heartbeat signal within a preset time interval. If the IoT device regularly sends a heartbeat signal within a preset time interval, the survival status of the IoT device is normal; otherwise, determine the duration of the IoT device not sending a heartbeat signal based on the time when the IoT device last sent a heartbeat signal;
[0012] If the duration for which the IoT device does not send a heartbeat signal reaches a duration threshold, the survival status of the IoT device is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the duration threshold, the survival status of the IoT device is normal.
[0013] Preferably, determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes:
[0014] When the device type of the Internet of Things device is a single-channel device and a heartbeat signal sent by the Internet of Things device is received, determine 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 status of the Internet of Things device is abnormal; if the reply message sent by the Internet of Things device is received, parse the reply message sent by the Internet of Things device to obtain current message information and a current status code, and determine the survival status of the Internet of Things device according to the current message information and the current status code.
[0015] Preferably, determining the survival status of the Internet of Things device according to 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 information does not meet the preset data range, or the current status code is different from the preset status code, the survival status of the Internet of Things device is abnormal.
[0018] Preferably, determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes:
[0019] When the device type of the Internet of Things device is a single-channel device and a heartbeat signal sent by the Internet of Things device is received, it is determined whether the current operating status information sent by the Internet of Things device is received. If the current operating status information sent by the Internet of Things device is not received, the Internet of Things device is in an abnormal state; if the current operating status information sent by the Internet of Things device is received, the survival status of the Internet of Things device is determined according to the current operating status information sent by the Internet of Things device.
[0020] Preferably, determining the survival status of the IoT device according to the current operating status information sent by the IoT device includes:
[0021] If the current operating status information satisfies the preset first operating status information, the survival status of the Internet of Things device is normal; if the current operating status information satisfies the preset second operating status information, the survival status of the Internet of Things device is abnormal.
[0022] Preferably, when the survival state of the Internet of Things device is abnormal, reconnecting the Internet of Things device includes:
[0023] When the survival status of the IoT device is abnormal, triggering an alarm of device abnormality;
[0024] Reconnecting the IoT device using an exponential backoff strategy;
[0025] If the reconnection to the IoT device is successful, the device abnormality alarm is cleared; if the reconnection to the IoT device fails and the number of reconnections to the IoT device reaches a threshold, the device maintenance alarm is triggered.
[0026] According to a second aspect of an embodiment of the present application, there is provided a real-time monitoring system for the survival status of an Internet of Things device, comprising: a plurality of Internet of Things devices and a server;
[0027] Each of the IoT devices is used to periodically send a heartbeat signal to the server;
[0028] The server is used to determine the survival status of the IoT device based on the heartbeat signal periodically sent by the IoT device and the device type of the IoT device; and when the survival status of the IoT device is abnormal, reconnect the IoT device.
[0029] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: at least one processor and a memory; 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 survival status of the Internet of Things device is implemented.
[0032] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, on which an execution program is stored. When the execution program is executed, the real-time monitoring method for the survival status of an Internet of Things device is implemented.
[0033] The technical solution provided by the present invention has the following beneficial effects:
[0034] The present invention provides a method and system for real-time monitoring of the survival status of Internet of Things devices. The method monitors each Internet of Things device to receive a heartbeat signal periodically sent by the Internet of Things device, determines the survival status 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 reconnects the Internet of Things device when the survival status of the Internet of Things device is abnormal. This not only achieves the use of fewer computing resources and monitoring of more device states, thereby reducing the cost of purchasing servers; it also automatically monitors the state and reconnects the state, reduces human operations, greatly improves maintenance efficiency, and reduces maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flow chart of a method for real-time monitoring of the survival status of an Internet of Things device provided by an embodiment of the present invention;
[0037] Figure 2 This is a flow chart of single-threaded multi-device monitoring provided by an embodiment of the present invention;
[0038] Figure 3 This is a flow chart of completing the reconnection of a disconnected device in a single thread provided by an embodiment of the present invention;
[0039] Figure 4 This is a structural block diagram of a real-time monitoring system for the survival status of an Internet of Things device provided by an embodiment of the present invention;
[0040] Figure 5 is a schematic diagram of a device heartbeat monitoring process provided by an embodiment of the present invention;
[0041] Figure 6 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the following embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Embodiment 1
[0044] The present invention provides a method for real-time monitoring of the survival status of an Internet of Things device, such as Figure 1 As shown, the following steps are included:
[0045] Step 101: monitor each IoT device to receive the heartbeat signal sent periodically by the IoT device;
[0046] Step 102: Determine the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device;
[0047] Step 103: When the survival status of the IoT device is abnormal, reconnect the IoT device.
[0048] Specifically, IoT devices may be, but are not limited to, sensors or measuring devices.
[0049] It is understandable that monitoring the heartbeat of a device generally refers to monitoring the health and connection status of the device to ensure that the device is operating normally and remains connected to the system or network. Typically, in a network or system, a device will periodically send a heartbeat signal to indicate its presence and normal operating status.
[0050] In some embodiments, the IoT device periodically sends a heartbeat signal to a server or monitoring system, etc., and may use, but is not limited to, a network communication protocol (such as HTTP, TCP, etc.) to send a data packet containing information such as a device ID and a timestamp.
[0051] Furthermore, when a heartbeat signal sent by an IoT device is received, 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] The dual-channel device can receive and send information. For the dual-channel device, the present invention uses the timing of sending heartbeats and receiving heartbeats to determine the survival status of the IoT device. Further, step 102 includes:
[0054] Step 1021: when the device type of the IoT device is a dual-channel device, determine whether the IoT device regularly sends a heartbeat signal within a preset time interval. If the IoT device regularly sends a heartbeat signal within the preset time interval, the survival status of the IoT device is normal; otherwise, determine the duration of the IoT device not sending a heartbeat signal according to the time when the IoT device last sent a heartbeat signal;
[0055] Step 1022: If the duration during which the IoT device does not send a heartbeat signal reaches a duration threshold, the survival status of the IoT device is abnormal; if the duration during which the IoT device does not send a heartbeat signal does not reach the duration threshold, the survival status of the IoT device is normal.
[0056] It is understandable that the failure of an IoT device to regularly send a heartbeat signal at a preset time interval may mean that the IoT device is in an abnormal state or is disconnected.
[0057] Single-channel devices can only send information, so the present invention adopts the following three solutions for status monitoring of single-channel devices to be compatible with various single-channel devices. The first solution includes: Further, step 102 also includes:
[0058] Step 1023: when the device type of the IoT device is a single-channel device, determine whether the IoT device regularly sends a heartbeat signal within a preset time interval. If the IoT device regularly sends a heartbeat signal within the preset time interval, the survival status of the IoT device is normal; otherwise, determine the duration of the IoT device not sending a heartbeat signal according to the time when the IoT device last sent a heartbeat signal;
[0059] Step 1024: If the duration during which the IoT device does not send a heartbeat signal reaches a duration threshold, the survival status of the IoT device is abnormal; if the duration during which the IoT device does not send a heartbeat signal does not reach the duration threshold, the survival status of the IoT device is normal.
[0060] The second solution includes: further, step 102, further includes:
[0061] Step 1025: When the device type of the IoT device is a single-channel device and a heartbeat signal sent by the IoT device is received, determine whether a reply message sent by the IoT device is received. If the reply message sent by the IoT device is not received, the survival status of the IoT device is abnormal; if a reply message sent by the IoT device is received, parse the reply message sent by the IoT device to obtain current message information and a current status code, and determine the survival status of the IoT device based on the current message information and the current status code.
[0062] Furthermore, the survival status of the IoT device is determined based on the current message information and the current status code, including:
[0063] 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, the survival status of the IoT device is normal;
[0064] If the data in the current message information does not meet the preset data range, or the current status code is different from the preset status code, the survival status of the IoT device is abnormal.
[0065] In some embodiments, a preset data value may also be set to determine the current message information, which may 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 technical personnel in this field according to experimental data or expert experience, etc., but is not limited to. In some embodiments, for example, the IoT device is a thermometer, and the reply message sent by it is parsed to obtain the current message information and the current status code. The data in the current message information is that the temperature at the current moment 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; the current status code is 0, and the preset status code is 1, then the survival status of the IoT device thermometer is abnormal.
[0067] The third solution includes: further, step 102, further includes:
[0068] Step 1026: When the device type of the IoT device is a single-channel device and a heartbeat signal sent by the IoT device is received, 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, the survival status of the IoT device is determined based on the current operating status information sent by the IoT device, including:
[0070] If the current operating status information meets the preset first operating status information, the survival status of the Internet of Things device is normal; if the current operating status information meets the preset second operating status information, the survival status of the Internet of Things device is abnormal.
[0071] It should be noted that the present invention does not limit the “preset first operating status information” and the “preset second operating status information”, and they can be set by technical personnel in this field based on experimental data or expert experience, but are not limited to it.
[0072] Further, step 103 includes:
[0073] Step 1031: When the survival status of the IoT device is abnormal, triggering an alarm of device abnormality;
[0074] Step 1032: Reconnect the IoT device using an exponential backoff strategy, or take other predefined actions;
[0075] Step 1033: If the IoT device is reconnected successfully, the device abnormality alarm is cleared; if the IoT device is reconnected unsuccessfully and the number of times the IoT device is reconnected reaches a threshold, the device maintenance alarm is triggered.
[0076] It should be noted that the present invention does not limit the "other predefined operations", which can be, but are not limited to, set by those skilled in the art based on experimental data or expert experience.
[0077] NIO in Java is an encapsulation of io multiplexing. The present invention monitors IoT devices by utilizing io multiplexing of Java NIO. Furthermore, the present invention uses a thread pool or multi-thread concurrent processing to monitor the heartbeat signals of each IoT device, as shown below:
[0078] Create a thread pool and assign a thread to each device connection to monitor the device status and reconnect. In Java, you can use the thread pool (ThreadPoolExecutor) to manage threads to ensure concurrent monitoring and reconnection operations for multiple devices. You can use ExecutorService to submit device status monitoring tasks and reconnection tasks.
[0079] Use event listening:
[0080] Use Java NIO's Selector to monitor the connection status of multiple devices. Once a device is disconnected, trigger the reconnection operation immediately to ensure that the connection can be reestablished in time.
[0081] Automatic reconnection mechanism after link break:
[0082] Create an automatic reconnection mechanism and use a scheduled task (such as Java's ScheduledExecutorService) to regularly detect the device's connection status. Once the device is disconnected, immediately initiate a reconnection operation. You can use ScheduledExecutorService to perform device status detection and reconnection tasks on a scheduled basis.
[0083] Set the reconnection strategy:
[0084] In the automatic reconnection mechanism, you can design a reconnection strategy, such as an exponential backoff strategy, to gradually increase the reconnection time interval to reduce the pressure of the reconnection operation on the system and devices. You can use a special class to manage the reconnection strategy to ensure that the reconnection operation is reasonable and efficient.
[0085] For example, Figure 2 As shown, the steps to implement io multiplexing through Java NIO and implement single-threaded multi-device monitoring 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 monitors the device port or IP;
[0087] Step 2: Receive message events on the 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: Get the registration events of all devices in a single thread, loop through all messages and heartbeat events, and update the device status.
[0090] For example, Figure 3 As shown, the steps to complete the reconnection of a disconnected device in a single thread are as follows:
[0091] Step 1: Get the status of all device registrations and refresh the device status;
[0092] Step 2: Get the keys of all broken device status objects (e.g., device ID). The device status object contains attributes such as status and time.
[0093] Step 3: Iterate the key of the disconnected device and initiate a reconnection;
[0094] Step 4: If the connection is successful, change the device status to connected;
[0095] Step 5: If you connect or delete a device multiple times, delete the key from all device status keys. Ensure that all device keys are devices connected to this server.
[0096] Furthermore, monitor various IoT devices, including:
[0097] Create a thread pool ThreadPoolExecutor in Java NIO, which includes multiple threads;
[0098] Assign a thread to each IoT device;
[0099] The multiplexer Selector in Java NIO is used to receive and traverse the heartbeat signals and / or messages sent by the IoT devices on each thread in a single-threaded loop.
[0100] It should be noted that asynchronous means that when performing multi-tasking, the execution of each task does not depend on the completion of other tasks, and there is no need to wait for one operation to be completed before starting the next operation. In contrast, synchronous operations Q need to be executed in sequence, and each step must wait for the previous step to be completed before starting;
[0101] ExecutorService is an interface defined for thread pool in Java, which defines methods related to background task execution;
[0102] Selector is generally called a selector, which can also be translated as a multiplexer. It is one of the core components in Java-NIO and is used to check whether one or more NIO Channels are readable or writable. This allows a single thread to manage multiple channels, that is, multiple network connections.
[0103] The advantage of using Selector is that it can process channels with fewer threads, which avoids the overhead of thread context switching compared to using multiple threads.
[0104] ScheduledExecutorService is an interface provided in the Java concurrent 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 the characteristics of a thread pool 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 comes, a thread will be created to execute it. We can use it when doing some ordinary scheduled loop tasks, such as refreshing dictionary constants at a fixed time. We only need to repeat the execution continuously.
[0105] Embodiment 2
[0106] The present invention also provides a real-time monitoring system for the survival status of an Internet of Things device, such as Figure 4 As shown, it includes: multiple IoT devices and servers;
[0107] Each IoT device is used to send a heartbeat signal to the server periodically;
[0108] The server is used to determine the survival status of the IoT device based on the heartbeat signal periodically sent by the IoT device and the device type of the IoT device; and reconnect the IoT device when the survival status of the IoT device is abnormal.
[0109] Furthermore, when the server receives the heartbeat signal sent by the 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 comprises:
[0112] The first judgment module is used to judge whether the IoT device regularly sends a heartbeat signal 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 regularly sends a heartbeat signal within the preset time interval, the survival status of the IoT device is normal; otherwise, according to the time when the IoT device last sent a heartbeat signal, determine the duration for which the IoT device did not send a heartbeat signal;
[0113] The second judgment module is used to determine that if the duration for which the IoT device does not send a heartbeat signal reaches a duration threshold, the survival status of the IoT device is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the duration threshold, the survival status of the IoT device is normal.
[0114] For example, Figure 5 As shown in the figure, when the device type of the IoT device is a dual-channel device, the process of implementing device heartbeat monitoring is as follows:
[0115] IoT devices send heartbeat signals: IoT devices periodically send heartbeat signals to servers or monitoring systems, etc., and can use, but are not limited to, network communication protocols (such as HTTP, TCP, etc.) to send data packets containing information such as device ID and timestamp;
[0116] The server receives the heartbeat signal: The server receives the heartbeat signal sent by the device and records the device 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 the preset time interval, it may mean that the device is in an abnormal state or the connection is disconnected;
[0118] Handling abnormal situations: If the server does not receive the heartbeat signal of the IoT device within a certain period of time, it can alert the device of abnormality and try to reconnect the device or take other predefined actions.
[0119] Furthermore, the server further includes:
[0120] The third judgment module is used to judge 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 a heartbeat signal 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 status of the Internet of Things device is abnormal; if the reply message sent by the Internet of Things device is received, parse the reply message sent by the Internet of Things device to obtain current message information and a current status code, and determine the survival status of the Internet of Things device according to 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 information does not meet the preset data range, or the current status code is different from the preset status code, the survival status of the Internet of Things device is abnormal.
[0124] Furthermore, the server further includes:
[0125] The fourth judgment module is used to judge whether the current operating status information 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 a heartbeat signal sent by the Internet of Things device is received. If the current operating status information sent by the Internet of Things device is not received, the Internet of Things device is in an abnormal state; if the current operating status information sent by the Internet of Things device is received, the survival status of the Internet of Things device is determined according to the current operating status information sent by the Internet of Things device.
[0126] Furthermore, the fourth judgment module is also used for:
[0127] If the current operating status information satisfies the preset first operating status information, the survival status of the Internet of Things device is normal; if the current operating status information satisfies the preset second operating status information, the survival status of the Internet of Things device is abnormal.
[0128] For example, when the device type of the IoT device is a single-channel device, the following three solutions are used to be compatible with various IoT devices, as shown below:
[0129] 1) Timeout processing:
[0130] Set timeout: The server sets a reasonable timeout. If the heartbeat signal of the IoT device is not received within the specified time, it can be considered that the IoT device is in an abnormal state;
[0131] In actual applications, Future or CompletableFuture can be used to implement: Use Java's Future or CompletableFuture to implement asynchronous operations to monitor multiple IoT devices at the same time and set a timeout to detect the status of the device;
[0132] 2) Protocol status code processing:
[0133] Protocol analysis: The server analyzes the reply message of the IoT device based on the protocol used by the IoT device for communication (for example, the measurement data sent by the IoT device, such as measuring the diameter radius, voltage or current of a device);
[0134] Server-side processing: After the server receives the reply message from the IoT device, it determines the device status based on the status code defined by the protocol;
[0135] 3) Self-monitoring processing:
[0136] IoT devices regularly report: IoT devices regularly report their own status, operating conditions and other data to the server. The server regularly receives and processes this data and understands the status of the device by analyzing this self-monitoring information.
[0137] Furthermore, the server further includes:
[0138] The reconnection module is used to reconnect the IoT device when the survival status of the IoT device is abnormal.
[0139] Furthermore, the reconnection module is specifically used for:
[0140] When the survival status of an IoT device is abnormal, an alarm of device abnormality is triggered;
[0141] Reconnect IoT devices using exponential backoff strategies or take other predefined actions;
[0142] If the IoT device is reconnected successfully, the device abnormality alarm is cleared; if the IoT device is reconnected unsuccessfully and the number of times the IoT device is reconnected reaches a threshold, the device maintenance alarm is triggered.
[0143] It can be understood that the system embodiment provided above corresponds to the method embodiment described above, and the corresponding specific contents can be referenced to each other and will not be repeated here.
[0144] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0145] Embodiment 3
[0146] like Figure 6 As shown, the present invention also provides an electronic device, which may be a computer device, a single-chip device, an intelligent mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected via a bus; the memory may be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory may also be used to store data, which may be called and / or modified when the instructions are executed.
[0147] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of a real-time monitoring method for the survival status of an Internet of Things device in the above-mentioned embodiment.
[0148] Embodiment 4
[0149] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage. The processor loads and executes one or more instructions stored in the storage medium, which can implement the steps of a real-time monitoring method for the survival status of an Internet of Things device in the above embodiment.
[0150] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0152] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function 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 rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does 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 real-time monitoring method for the survival status of an Internet of Things device, characterized in that: include: Monitor each IoT device to receive the heartbeat signal sent periodically by the IoT device; Determine the survival status of the IoT device according to a heartbeat signal periodically sent by the IoT device and the device type of the IoT device; When the survival status of the Internet of Things device is abnormal, reconnect the Internet of Things device.
2. The method according to claim 1, characterized in that The device types of the IoT device include: dual-channel devices and single-channel devices.
3. The method according to claim 1, characterized in that The determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes: When the device type of the IoT device is a single-channel device or a dual-channel device, determine whether the IoT device regularly sends a heartbeat signal within a preset time interval. If the IoT device regularly sends a heartbeat signal within a preset time interval, the survival status of the IoT device is normal; otherwise, determine the duration of the IoT device not sending a heartbeat signal based on the time when the IoT device last sent a heartbeat signal; If the duration for which the IoT device does not send a heartbeat signal reaches a duration threshold, the survival status of the IoT device is abnormal; if the duration for which the IoT device does not send a heartbeat signal does not reach the duration threshold, the survival status of the IoT device is normal.
4. The method according to claim 1, characterized in that: The determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes: When the device type of the Internet of Things device is a single-channel device and a heartbeat signal sent by the Internet of Things device is received, determine 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 status of the Internet of Things device is abnormal; if the reply message sent by the Internet of Things device is received, parse the reply message sent by the Internet of Things device to obtain current message information and a current status code, and determine the survival status of the Internet of Things device according to the current message information and the current status code.
5. The method according to claim 4, characterized in that The determining the survival status of the Internet of Things device according to the current message information and the current status code includes: 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; If the data in the current message information does not meet the preset data range, or the current status code is different from the preset status code, the survival status of the Internet of Things device is abnormal.
6. The method according to claim 1, characterized in that The determining the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device includes: When the device type of the Internet of Things device is a single-channel device and a heartbeat signal sent by the Internet of Things device is received, it is determined whether the current operating status information sent by the Internet of Things device is received. If the current operating status information sent by the Internet of Things device is not received, the Internet of Things device is in an abnormal state; if the current operating status information sent by the Internet of Things device is received, the survival status of the Internet of Things device is determined according to the current operating status information sent by the Internet of Things device.
7. The method according to claim 6, characterized in that The determining the survival status of the IoT device according to the current running status information sent by the IoT device includes: If the current operating status information satisfies the preset first operating status information, the survival status of the Internet of Things device is normal; if the current operating status information satisfies the preset second operating status information, the survival status of the Internet of Things device is abnormal.
8. The method according to claim 1, characterized in that When the survival state of the Internet of Things device is abnormal, reconnecting the Internet of Things device includes: When the survival status of the IoT device is abnormal, triggering an alarm of device abnormality; Reconnecting the IoT device using an exponential backoff strategy; If the reconnection to the IoT device is successful, the device abnormality alarm is cleared; if the reconnection to the IoT device fails and the number of times the IoT device is reconnected reaches a threshold, the device maintenance alarm is triggered.
9. A real-time monitoring system for the survival status of IoT devices, characterized in that: include: Multiple IoT devices and servers; Each of the IoT devices is used to periodically send a heartbeat signal to the server; The server is used to determine the survival status of the IoT device according to the heartbeat signal periodically sent by the IoT device and the device type of the IoT device; And when the survival status of the Internet of Things device is abnormal, reconnect the Internet of Things device.
10. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the real-time monitoring method for the survival status of an Internet of Things device as described in any one of claims 1 to 8 is implemented.
11. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, the real-time monitoring method for the survival status of an Internet of Things device as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
State judgment method, electronic equipment, system and medium
CN109981415A
Channel verification system and method of national standard equipment, computer equipment and storage medium
CN114501162A
Method and tool for monitoring offline state of Internet of Things equipment
CN115695238A
Vehicle control method, device and equipment and storage medium
CN116319883A
Internet of Things equipment fault tolerance method, device and equipment based on gap and storage medium
CN116389231A