Internet of Things gateway health examination method and system based on LwM2M protocol

Through the IoT gateway health inspection method and system based on the LwM2M protocol, the stability and reliability problems of IoT gateway inspection, monitoring and remote management are solved, real-time monitoring and remote management of the gateway are realized, and the stability and reliability of the gateway are improved.

CN119854154APending Publication Date: 2025-04-18CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311344965.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The inspection, monitoring and remote management of existing IoT gateways lack stability and reliability, resulting in lag in fault detection and processing, affecting the normal operation and data transmission of the gateway.

Method used

The Internet of Things gateway health inspection methods and systems based on the LwM2M protocol are adopted, and health inspection information is regularly sent to the cloud server through the LwM2M client to realize gateway connection inspection, registration inspection, hardware status inspection, software status inspection, security inspection, network connection inspection, remote management function inspection, troubleshooting and log analysis.

Benefits of technology

Real-time monitoring and remote management of IoT gateways are realized, the stability and reliability of gateway operation are improved, faults are discovered in a timely manner and corresponding measures are taken to ensure the normal operation and data transmission of the gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854154A_ABST
    Figure CN119854154A_ABST
Patent Text Reader

Abstract

The invention provides an Internet of Things gateway health check method and system based on an LwM2M protocol, and belongs to the field of industrial Internet of Things. The method comprises the following steps: an LwM2M client located in an Internet of Things gateway regularly sends health examination information to a cloud server based on an LwM2M protocol; the LwM2M server side located on the cloud server receives the health examination information sent by the LwM2M client side; the LwM2M server performs gateway health check on the Internet of Things gateway according to the received health check information, and takes corresponding measures according to the check result; the gateway health check comprises gateway connection check, gateway registration check, hardware state check, software state check, gateway security check, network connection check, remote management function check and troubleshooting and log analysis. The problem that gateway inspection, monitoring and remote management under the condition of the existing Internet of Things are poor in stability and reliability is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial Internet of Things, and in particular to an Internet of Things gateway health check method based on LwM2M protocol and an Internet of Things gateway health check system based on LwM2M protocol. Background Art

[0002] With the continuous development of IoT technology, IoT gateways have been widely used in various industries. However, due to various reasons, such as environmental changes, software vulnerabilities, etc., IoT gateways may fail, which will seriously affect their normal operation and data transmission. Therefore, it is crucial to achieve real-time monitoring and remote management of IoT gateways to ensure the stability and reliability of the gateway.

[0003] LwM2M (Lightweight M2M), proposed by the Open Mobile Alliance (OMA), is a lightweight, standard and universal IoT gateway management protocol that can be used to quickly deploy client / server IoT services. LwM2M establishes a set of standards for the management and application of IoT gateways. It provides a lightweight and compact secure communication interface and an efficient data model to achieve M2M gateway management and service support. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide an Internet of Things gateway health check method and system based on the LwM2M protocol. The method uses a more lightweight LwM2M protocol to perform health checks on various Internet of Things gateway devices, thereby solving the problem of lack of stability and reliability in gateway inspection, monitoring and remote management under existing Internet of Things conditions.

[0005] In order to achieve the above object, the first aspect of the present invention provides an Internet of Things gateway health check method based on the LwM2M protocol, the method comprising:

[0006] The LwM2M client located at the IoT gateway periodically sends health check information to the cloud server based on the LwM2M protocol;

[0007] The LwM2M server located on the cloud server receives the health check information sent from the LwM2M client;

[0008] The LwM2M server performs a gateway health check on the IoT gateway based on the received health check information and takes corresponding measures based on the check results;

[0009] The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.

[0010] In an embodiment of the present application, the gateway connection check includes:

[0011] 1) After the LwM2M client is started, it sends a heartbeat message carrying count information to the LwM2M server and starts the heartbeat message counter with an initial value of 1; if the sending fails, it continues to send heartbeat messages with a count of 1 until the sending succeeds;

[0012] 2) The LwM2M server receives the heartbeat message and constructs a response message based on the received count information and returns it to the LwM2M client;

[0013] 3) After receiving the response, the LwM2M client determines whether the gateway connection is normal based on the count information in the response message and the count value of the heartbeat message counter;

[0014] 4) When the gateway connection is normal, the LwM2M client sends a heartbeat message carrying the current count information according to the period setting;

[0015] 5) The LwM2M server receives the heartbeat message and constructs a response based on the received count information and returns it to the LwM2M client;

[0016] 6) Repeat steps 3)-5) to continue checking the gateway connection.

[0017] Through the above technical means, the gateway connection check is realized through the information interaction between the LwM2M client and the LwM2M server, ensuring that the LwM2M client or the LwM2M server can perceive the reliable connection between the gateway and the cloud server.

[0018] In an embodiment of the present application, the gateway registration check includes:

[0019] The LwM2M client sends the registration information to the LwM2M server through the LwM2M protocol;

[0020] The LwM2M server parses the current gateway registration information in the registration information and compares it with the gateway registration information in the gateway database;

[0021] If the current gateway registration information does not exist in the current gateway database, the current gateway registration information is written into the gateway database, and a registration success response message is returned to the LwM2M client;

[0022] Otherwise, return the registered response information to the LwM2M client.

[0023] According to the above technical means, it is possible to check whether the gateway connected to the cloud server has been successfully registered, to avoid unregistered gateway connections such as the Internet of Things, which may bring environmental risks to the Internet of Things and affect the normal operation and data transmission of the Internet of Things.

[0024] In the embodiment of the present application, the hardware status check includes:

[0025] The gateway regularly collects the latest status information of the hardware;

[0026] The LwM2M server periodically sends Observe messages to the LwM2M client to request the hardware status information of the gateway;

[0027] The LwM2M client obtains the latest hardware status information collected by the hardware status collection module of the gateway and returns it to the LwM2M server through the Observe message;

[0028] The LwM2M server determines whether the gateway is normal based on the returned hardware status information and the preset rules and algorithms.

[0029] According to the above technical means, the latest hardware status information of the gateway can be obtained, gateway anomalies can be discovered in time, early warnings and repairs can be carried out in advance, and hardware anomalies can be prevented from expanding to affect the normal operation and data transmission of the gateway.

[0030] In the embodiment of the present application, the software status check includes:

[0031] The gateway regularly collects the latest status information of the operating system and applications;

[0032] The LwM2M server periodically sends Observe messages to the LwM2M client to request the software status information of the gateway;

[0033] The LwM2M client obtains the latest status information of the operating system and application collected by the gateway and returns it to the LwM2M server through the Observe message;

[0034] The LwM2M server generates a software health report based on the latest status information of the operating system and application programs returned.

[0035] According to the above technical means, the latest status information of the gateway operating system and application can be checked, the loopholes of the operating system or application can be discovered in time, and corresponding measures can be taken in time to avoid affecting the normal operation of the gateway and data transmission.

[0036] In the embodiment of the present application, the gateway security check includes:

[0037] The LwM2M server parses the authorization code in the registration message and verifies the legitimacy of the authorization code;

[0038] The LwM2M server finds the factory default versions of the operating system and applications corresponding to the gateway based on the gateway ID and gateway type, and writes the version information into the security database;

[0039] The LwM2M server regularly publishes vulnerability information for operating system and application versions;

[0040] The LwM2M client upgrades the operating system and application versions according to the vulnerability information of the operating system and application versions, and reports the upgraded versions to the LwM2M server after the upgrade;

[0041] The LwM2M server writes the upgraded version information into the security database.

[0042] According to the above technical means, the access security of the gateway can be verified, and at the same time, it can be detected whether the gateway has security vulnerabilities and whether the latest security patches are installed.

[0043] In the embodiment of the present application, the network connection check includes:

[0044] The LwM2M server periodically sends Observe messages to the LwM2M client to request the gateway’s network connection information;

[0045] The LwM2M client checks the network connection and network delay between the gateway and the target network element through the ping command, and returns it to the LwM2M server through the Observe message;

[0046] The LwM2M server determines whether the network connection is normal based on the returned network connection and network delay using preset rules and algorithms.

[0047] Based on the above technical means, the network connection status can be checked to ensure that the gateway communicates normally with other devices or servers.

[0048] In the embodiment of the present application, the remote management function check includes:

[0049] The LwM2M server initiates a remote management request message;

[0050] The LwM2M client receives the remote management request message and parses the command information therein;

[0051] The LwM2M client executes the command information and returns the execution result to the LwM2M server. If the LwM2M server receives the execution result, the remote management function is normal, otherwise the remote management function is abnormal.

[0052] Based on the above technical means, it is possible to verify whether the remote management function of the gateway is normal, so as to facilitate remote operation and management when the gateway is abnormal and ensure user needs.

[0053] In the embodiment of the present application, the troubleshooting and log analysis include:

[0054] The LwM2M client uses the Read operation of the LwM2M protocol to obtain the gateway's log information and send it to the LwM2M server.

[0055] After receiving the log information, the LwM2M server saves it to the log analysis system to analyze the relevant operation status and faults.

[0056] According to the above technical means, the gateway log can be obtained through lightweight communication, reducing the occupation of the normal network.

[0057] In an embodiment of the present application, the method further includes:

[0058] Before performing the gateway health check, the LwM2M server sends an Observe message to the LwM2M client to request basic information about the gateway;

[0059] The LwM2M client obtains the basic information of the gateway through the Read operation and sends it to the LwM2M server;

[0060] The basic information includes: gateway model, serial number, manufacturer, production date, operating system version, running status and network connection status.

[0061] According to the above technical means, the basic information of the gateway can be obtained, which is convenient for gateway inspection and verification.

[0062] In an embodiment of the present application, the method further includes:

[0063] The LwM2M server generates a detection report based on the gateway health check results.

[0064] The second aspect of the present application provides an Internet of Things gateway health check system based on the LwM2M protocol, the system comprising:

[0065] The LwM2M client, located in the IoT gateway, is used to periodically send health check information to the cloud server based on the LwM2M protocol;

[0066] The wM2M server is located on the cloud server and is used to receive health check information sent from the LwM2M client; based on the received health check information, it performs a gateway health check on the IoT gateway and takes corresponding measures based on the check results;

[0067] The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.

[0068] According to the above technical means, the resource management and communication mechanism of LwM2M is used to realize the remote monitoring and management of the gateway. By using the Read, Observe and Execute operations provided by the LwM2M protocol, the gateway device information, status monitoring, security configuration, etc. can be obtained, and the gateway can be remotely managed and troubleshooted.

[0069] Through the above technical solution, the following technical effects can be obtained:

[0070] (1) It uses the LwM2M protocol for communication, which has a small protocol stack and occupies less resources, and is suitable for various IoT gateways;

[0071] (2) It can realize real-time monitoring and remote management of IoT gateways, improving the stability and reliability of gateway operation;

[0072] (3) Health checks can be performed based on gateway status information to detect gateway failures in a timely manner and take appropriate measures to ensure the normal operation of the gateway.

[0073] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0075] Figure 1 It is a flow chart of a method for checking the health of an Internet of Things gateway based on the LwM2M protocol provided by an embodiment of the present invention;

[0076] Figure 2 The present invention provides a block diagram of an Internet of Things gateway health check system based on the LwM2M protocol according to an embodiment of the present invention. DETAILED DESCRIPTION

[0077] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0078] Figure 1 FIG. 1 is a flow chart of a method for checking the health of an Internet of Things gateway based on the LwM2M protocol provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0079] S1: The LwM2M client located at the IoT gateway periodically sends health check information to the cloud server based on the LwM2M protocol. In the embodiment of the present application, the health check information sent by the LwM2M client to the cloud server may be sent at the request of the LwM2M server, or may be sent periodically according to the settings.

[0080] S2: The LwM2M server located on the cloud server receives the health check information sent from the LwM2M client. In the embodiment of the present application, the interaction between the LwM2M server and the LwM2M client is based on a lightweight IoT gateway management protocol.

[0081] S3: The LwM2M server performs a gateway health check on the IoT gateway based on the received health check information, and takes corresponding measures based on the check results. In the embodiment of the present application, if an abnormality occurs during the IoT gateway health check, the operator will be reminded to perform maintenance or send an alarm message.

[0082] The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.

[0083] In an embodiment of the present application, the gateway connection check includes:

[0084] 1) After the LwM2M client is started, it sends a heartbeat message carrying count information to the LwM2M server and starts the heartbeat message counter with an initial value of 1; if the sending fails, it continues to send heartbeat messages with a count of 1 until the sending succeeds;

[0085] 2) The LwM2M server receives the heartbeat message and constructs a response message based on the received count information and returns it to the LwM2M client;

[0086] 3) After receiving the response, the LwM2M client determines whether the gateway connection is normal based on the count information in the response message and the count value of the heartbeat message counter;

[0087] 4) When the gateway connection is normal, the LwM2M client sends a heartbeat message carrying the current count information according to the period setting;

[0088] 5) The LwM2M server receives the heartbeat message and constructs a response based on the received count information and returns it to the LwM2M client;

[0089] 6) Repeat steps 3)-5) to continue checking the gateway connection.

[0090] Specifically, after the LwM2M client of the gateway is started, it starts to send the first message to the LwM2M server and starts the counter with an initial value of 1; if the sending fails, the LwM2M client continues to send heartbeat messages with a count of 1; if successful, the LwM2M server constructs a response based on count 1 and returns it to the LwM2M client; after the LwM2M client receives the response, it determines whether the gateway connection is normal based on the count information in the response message and the count value of the heartbeat message counter; if normal, the LwM2M client sends the message again according to the period setting (such as 1 minute). At this time, the count information in the message is 2. After receiving the heartbeat message, the LwM2M server constructs a response based on count 2 and returns it to the LwM2M client; subsequently, the heartbeat message is sent cyclically according to the period setting to implement the gateway connection check.

[0091] In one embodiment of the present application, the response constructed by the LwM2M client includes not only the counting information but also a message for the LwM2M client to verify that the counting information is correct.

[0092] In one embodiment, an LwM2M protocol example of a heartbeat message is as follows:

[0093] Connection request message:

[0094] Message Type:CON

[0095] Code:POST

[0096] Uri-Path: " / heart" (heartbeat message path)

[0097] Payload:1.

[0098] Through the above technical means, the gateway connection check is realized through the information interaction between the LwM2M client and the LwM2M server, ensuring that the LwM2M client or the LwM2M server can perceive the reliable connection between the gateway and the cloud server.

[0099] In an embodiment of the present application, the gateway registration check includes:

[0100] The LwM2M client sends the registration information to the LwM2M server through the LwM2M protocol;

[0101] The LwM2M server parses the current gateway registration information in the registration information and compares it with the gateway registration information in the gateway database. In the embodiment of the present application, the gateway registration information includes: gateway ID, manufacturer, gateway type, registration time and other information.

[0102] If the current gateway registration information does not exist in the current gateway database, the current gateway registration information is written into the gateway database, and a registration success response message is returned to the LwM2M client;

[0103] Otherwise, return the registered response information to the LwM2M client.

[0104] In one embodiment, the LwM2M protocol example is as follows:

[0105] Connection request message:

[0106] Message Type:CON(Confirmable)

[0107] Code:POST

[0108] Uri-Path: " / rd" (registration server path)

[0109] Payload: Gateway registration information (including gateway ID, manufacturer, gateway type, authorization code, etc.).

[0110] According to the above technical means, it is possible to check whether the gateway connected to the cloud server has been successfully registered, to avoid unregistered gateway connections such as the Internet of Things, which may bring environmental risks to the Internet of Things and affect the normal operation and data transmission of the Internet of Things.

[0111] In the embodiment of the present application, the hardware status check includes:

[0112] The gateway periodically collects the latest status information of the hardware. In the embodiment of the present application, the gateway will start the hardware status collection module to periodically collect the latest status information of the hardware.

[0113] The LwM2M server periodically sends Observe messages to the LwM2M client to request the hardware status information of the gateway;

[0114] The LwM2M client obtains the latest hardware status information collected by the hardware status collection module of the gateway and returns it to the LwM2M server through the Observe message;

[0115] The LwM2M server determines whether the gateway is normal based on the returned hardware status information through preset rules and algorithms. In one embodiment, the preset rules may be: whether the CPU usage exceeds a preset ratio, whether the hard disk space usage is greater than a preset threshold, whether the memory is less than a preset threshold, etc.

[0116] In one embodiment, the LwM2M protocol example is as follows:

[0117] Observe request message:

[0118] Message Type:CON

[0119] Code:GET

[0120] Uri-Path: " / 3 / 0 / 1" (gateway hardware status resource path)

[0121] Options:Observe=1 (turn on observation mode)

[0122] According to the above technical means, the latest hardware status information of the gateway can be obtained, gateway anomalies can be discovered in time, early warnings and repairs can be carried out in advance, and hardware anomalies can be prevented from expanding to affect the normal operation and data transmission of the gateway.

[0123] In the embodiment of the present application, the software status check includes:

[0124] The gateway regularly collects the latest status information of the operating system and application programs. In the embodiment of the present application, the software status can be detected by running the diagnostic tools provided by the operating system or third-party software. For example, system diagnostic tools, security monitoring tools, and process health monitoring tools can be installed in the gateway. These tools can monitor the operating system, system vulnerabilities, and process health status and generate reports. If the tool is set to execute on a scheduled basis, the latest status information of the operating system and application programs can be collected regularly.

[0125] The LwM2M server periodically sends Observe messages to the LwM2M client to request the software status information of the gateway;

[0126] The LwM2M client obtains the latest status information of the operating system and application collected by the gateway and returns it to the LwM2M server through the Observe message;

[0127] The LwM2M server generates a software health report based on the latest status information of the operating system and application programs returned.

[0128] In one embodiment, the LwM2M protocol example is as follows:

[0129] Observe request message:

[0130] Message Type:CON

[0131] Code:GET

[0132] Uri-Path: " / 3 / 0 / 2" (gateway software status resource path)

[0133] Options:Observe=1 (turn on observation mode).

[0134] According to the above technical means, the latest status information of the gateway operating system and application can be checked, the loopholes of the operating system or application can be discovered in time, and corresponding measures can be taken in time to avoid affecting the normal operation of the gateway and data transmission.

[0135] In the embodiment of the present application, the gateway security check includes:

[0136] The LwM2M server parses the authorization code in the registration message and verifies the legitimacy of the authorization code;

[0137] The LwM2M server finds the factory default versions of the operating system and applications corresponding to the gateway based on the gateway ID and gateway type, and writes the version information into the security database;

[0138] The LwM2M server regularly publishes vulnerability information of operating system and application versions. If the version of the registered gateway has a vulnerability, an alarm will be issued;

[0139] The LwM2M client upgrades the operating system and application versions according to the vulnerability information of the operating system and application versions, and reports the upgraded versions to the LwM2M server after the upgrade;

[0140] The LwM2M server writes the upgraded version information into the security database.

[0141] In one embodiment, the LwM2M protocol example of the message is as follows:

[0142] Message Type:CON(Confirmable)

[0143] Code:POST

[0144] Uri-Path:" / update" (registration server path)

[0145] Payload: operating system upgrade version information (operating system, application ID, version before upgrade, version after upgrade).

[0146] According to the above technical means, the access security of the gateway can be verified, and at the same time, it can be detected whether the gateway has security vulnerabilities and whether the latest security patches are installed.

[0147] In the embodiment of the present application, the network connection check includes:

[0148] The LwM2M server periodically sends Observe messages to the LwM2M client to request the gateway’s network connection information;

[0149] The LwM2M client checks the network connection and network delay between the gateway and the target network element through the ping command, and returns it to the LwM2M server through the Observe message;

[0150] The LwM2M server determines whether the network connection is normal based on the returned network connection and network delay using preset rules and algorithms.

[0151] In other embodiments, a proxy server may be deployed in the network to test the download bandwidth, and the gateway may download a test file through a script to perform a bandwidth test; third-party software may also be installed on the gateway to perform more comprehensive network health monitoring.

[0152] In one embodiment, the LwM2M protocol example is as follows:

[0153] Observe request message:

[0154] Message Type:CON

[0155] Code:GET

[0156] Uri-Path: " / 3 / 0 / 3" (gateway network status resource path)

[0157] Options:Observe=1 (turn on observation mode).

[0158] Based on the above technical means, the network connection status can be checked to ensure that the gateway communicates normally with other devices or servers.

[0159] In the embodiment of the present application, the remote management function check includes:

[0160] The LwM2M server initiates a remote management request message;

[0161] The LwM2M client receives the remote management request message and parses the command information therein. In one embodiment, the command information may be restarting the gateway, upgrading the firmware, etc.

[0162] The LwM2M client executes the command information and returns the execution result to the LwM2M server. If the LwM2M server receives the execution result, the remote management function is normal, otherwise the remote management function is abnormal.

[0163] In one embodiment, the LwM2M protocol example is as follows:

[0164] Message Type:CON

[0165] Code:POST

[0166] Uri-Path: " / 3 / 0 / 5" (remote restart resource path)

[0167] Payload: Restart command information.

[0168] Based on the above technical means, it is possible to verify whether the remote management function of the gateway is normal, so as to facilitate remote operation and management when the gateway is abnormal and ensure user needs.

[0169] In the embodiment of the present application, the troubleshooting and log analysis include:

[0170] The LwM2M client uses the Read operation of the LwM2M protocol to obtain the gateway's log information and send it to the LwM2M server.

[0171] After receiving the log information, the LwM2M server saves it in the log analysis system to analyze the relevant operation conditions and faults. In other embodiments, the log information can also be saved in the log audit system, and the log audit system or the log analysis system analyzes the relevant operation conditions and faults.

[0172] In one embodiment, the LwM2M protocol example is as follows:

[0173] Message Type:CON

[0174] Code:GET

[0175] Uri-Path: " / 3 / 0 / 6" (gateway log information resource path).

[0176] According to the above technical means, the gateway log can be obtained through lightweight communication, reducing the occupation of the normal network.

[0177] In an embodiment of the present application, the method further includes:

[0178] Before performing the gateway health check, the LwM2M server sends an Observe message to the LwM2M client to request basic information about the gateway;

[0179] The LwM2M client obtains the basic information of the gateway through the Read operation and sends it to the LwM2M server;

[0180] The basic information includes: gateway model, serial number, manufacturer, production date, operating system version, running status and network connection status.

[0181] In one embodiment, the LwM2M protocol example is as follows:

[0182] Message Type:CON

[0183] Code:GET

[0184] Uri-Path: " / 3 / 0 / 0" (gateway basic information resource path).

[0185] According to the above technical means, the basic information of the gateway can be obtained, which is convenient for gateway inspection and verification.

[0186] In an embodiment of the present application, the method further includes:

[0187] The LwM2M server generates a test report based on the gateway health check results. The test report should include the basic information of the gateway, the hardware status, software status, network status, security status and other aspects of the test results, and provide corresponding suggestions and solutions. It can be generated and output in text, PDF, HTML and other formats. The report is obtained using the Read operation of the LwM2M protocol.

[0188] In one embodiment, the LwM2M protocol example is as follows:

[0189] Message Type:ACK(Acknowledgment)

[0190] Code:GET

[0191] Uri-Path: " / report" (report generation path)

[0192] Payload: Health check report content.

[0193] The above gateway health check method can use the resource management and communication mechanism of LwM2M to realize remote monitoring and management of the gateway. By using the operations such as Read, Observe and Execute provided by the LwM2M protocol, gateway device information, status monitoring, security configuration, etc. can be obtained, and the gateway can be remotely managed and troubleshooted. During the health check process, it is necessary to establish a stable LwM2M connection with the gateway, and obtain the gateway status and configuration information through the corresponding operations of the LwM2M protocol, and finally generate a health check report.

[0194] In general, health checks on IoT gateways are a systematic process that requires comprehensive consideration of multiple aspects of the gateway, including hardware, software, network, and security. By performing regular health checks, gateway problems can be discovered in a timely manner and corresponding solutions can be provided to ensure the stability and security of the gateway.

[0195] The LwM2M protocol is used for communication between IoT gateways and cloud servers. This protocol provides a lightweight communication method with the advantages of small protocol stack, less resource occupation, and high flexibility. It is suitable for monitoring and management of IoT gateways.

[0196] It should be noted that in actual application, the gateway health check runs through the entire life cycle of the gateway. Therefore, the above-mentioned gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, troubleshooting and log analysis are all cycled throughout the entire life cycle of the gateway according to the set time conditions until the gateway is removed from the Internet of Things.

[0197] The second aspect of the present application provides an IoT gateway health check system based on the LwM2M protocol, such as Figure 2 As shown, the system comprises:

[0198] The LwM2M client, located in the IoT gateway, is used to periodically send health check information to the cloud server based on the LwM2M protocol;

[0199] The wM2M server is located on the cloud server and is used to receive health check information sent from the LwM2M client; based on the received health check information, it performs a gateway health check on the IoT gateway and takes corresponding measures based on the check results;

[0200] The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.

[0201] According to the above technical means, the resource management and communication mechanism of LwM2M is used to realize the remote monitoring and management of the gateway. By using the Read, Observe and Execute operations provided by the LwM2M protocol, the gateway device information, status monitoring, security configuration, etc. can be obtained, and the gateway can be remotely managed and troubleshooted.

[0202] Those skilled in the art will understand that all or part of the steps in the method for implementing the above-mentioned embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions for making a single-chip microcomputer, a chip or a processor (processor) perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0203] The optional embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the technical concept of the embodiments of the present invention, the technical scheme of the embodiments of the present invention can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.

[0204] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.

Claims

1. A health check method for an Internet of Things gateway based on the LwM2M protocol, characterized in that: The method comprises: The LwM2M client located at the IoT gateway periodically sends health check information to the cloud server based on the LwM2M protocol; The LwM2M server located on the cloud server receives the health check information sent from the LwM2M client; The LwM2M server performs a gateway health check on the IoT gateway based on the received health check information and takes corresponding measures based on the check results; The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.

2. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The gateway connection check includes: 1) After the LwM2M client is started, it sends a heartbeat message carrying count information to the LwM2M server and starts the heartbeat message counter with an initial value of 1; if the sending fails, it continues to send heartbeat messages with a count of 1 until the sending succeeds; 2) The LwM2M server receives the heartbeat message and constructs a response message based on the received count information and returns it to the LwM2M client; 3) After receiving the response, the LwM2M client determines whether the gateway connection is normal based on the count information in the response message and the count value of the heartbeat message counter; 4) When the gateway connection is normal, the LwM2M client sends a heartbeat message carrying the current count information according to the period setting; 5) The LwM2M server receives the heartbeat message and constructs a response based on the received count information and returns it to the LwM2M client; 6) Repeat steps 3)-5) to continue checking the gateway connection.

3. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The gateway registration check includes: The LwM2M client sends the registration information to the LwM2M server through the LwM2M protocol; The LwM2M server parses the current gateway registration information in the registration information and compares it with the gateway registration information in the gateway database; If the current gateway registration information does not exist in the current gateway database, the current gateway registration information is written into the gateway database, and a registration success response message is returned to the LwM2M client; Otherwise, return the registered response information to the LwM2M client.

4. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The hardware status check includes: The gateway regularly collects the latest status information of the hardware; The LwM2M server periodically sends Observe messages to the LwM2M client to request the hardware status information of the gateway; The LwM2M client obtains the latest hardware status information collected by the hardware status collection module of the gateway and returns it to the LwM2M server through the Observe message; The LwM2M server determines whether the gateway is normal based on the returned hardware status information and the preset rules and algorithms.

5. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The software status check includes: The gateway regularly collects the latest status information of the operating system and applications; The LwM2M server periodically sends Observe messages to the LwM2M client to request the software status information of the gateway; The LwM2M client obtains the latest status information of the operating system and application collected by the gateway and returns it to the LwM2M server through the Observe message; The LwM2M server generates a software health report based on the latest status information of the operating system and application programs returned.

6. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The gateway security check includes: The LwM2M server parses the authorization code in the registration message and verifies the legitimacy of the authorization code; The LwM2M server finds the factory default versions of the operating system and applications corresponding to the gateway based on the gateway ID and gateway type, and writes the version information into the security database; The LwM2M server regularly publishes vulnerability information for operating system and application versions; The LwM2M client upgrades the operating system and application versions according to the vulnerability information of the operating system and application versions, and reports the upgraded versions to the LwM2M server after the upgrade; The LwM2M server writes the upgraded version information into the security database.

7. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The network connection check includes: The LwM2M server periodically sends Observe messages to the LwM2M client to request the gateway’s network connection information; The LwM2M client checks the network connection and network delay between the gateway and the target network element through the ping command, and returns it to the LwM2M server through the Observe message; The LwM2M server determines whether the network connection is normal based on the returned network connection and network delay using preset rules and algorithms.

8. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The remote management function check includes: The LwM2M server initiates a remote management request message; The LwM2M client receives the remote management request message and parses the command information therein; The LwM2M client executes the command information and returns the execution result to the LwM2M server. If the LwM2M server receives the execution result, the remote management function is normal, otherwise the remote management function is abnormal.

9. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The troubleshooting and log analysis include: The LwM2M client uses the Read operation of the LwM2M protocol to obtain the gateway's log information and send it to the LwM2M server. After receiving the log information, the LwM2M server saves it to the log analysis system to analyze the relevant operation status and faults.

10. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 1, characterized in that: The method further comprises: Before performing the gateway health check, the LwM2M server sends an Observe message to the LwM2M client to request basic information about the gateway; The LwM2M client obtains the basic information of the gateway through the Read operation and sends it to the LwM2M server; The basic information includes: gateway model, serial number, manufacturer, production date, operating system version, running status and network connection status.

11. The method for checking the health of an Internet of Things gateway based on the LwM2M protocol according to claim 10, characterized in that: The method further comprises: The LwM2M server generates a detection report based on the gateway health check results.

12. An IoT gateway health check system based on LwM2M protocol, characterized in that: The system comprises: The LwM2M client, located in the IoT gateway, is used to periodically send health check information to the cloud server based on the LwM2M protocol; The wM2M server is located on the cloud server and is used to receive health check information sent from the LwM2M client; based on the received health check information, it performs a gateway health check on the IoT gateway and takes corresponding measures based on the check results; The gateway health check includes: gateway connection check, gateway registration check, hardware status check, software status check, gateway security check, network connection check, remote management function check, and troubleshooting and log analysis.