A heartbeat control method for NB-IoT devices

By adopting heartbeat-free mode and heartbeat mode in NB-IoT devices and using a lifetime timer to manage session state, the resource waste and platform pressure problems caused by frequent heartbeat of the device are solved, and the device power consumption and resource utilization are reduced.

CN116055547BActive Publication Date: 2024-12-03E SURFING IOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211639029.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2024-12-03
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

The frequent sending of heartbeat messages by NB-IoT devices leads to waste of network resources and increased power consumption, and when the device switches from dormant state to online state, it needs to log in and subscribe to resources again, which increases the pressure on the Internet of Things platform.

Method used

Adopt heartbeat-free mode and heartbeat mode. The timer is started through the lifetime field carried by the login message, refresh or delete session information, reduce heartbeat interaction, reduce device power consumption and platform resource usage.

Benefits of technology

It effectively reduces the power consumption of NB-IoT devices and the resource usage of IoT platforms, reduces the number of interactions between devices and platforms, and reduces the pressure during peak periods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116055547B_ABST
    Figure CN116055547B_ABST
Patent Text Reader

Abstract

The present invention discloses a heartbeat control method for NB-IoT devices, including: obtaining a first login message of a NB-IoT device as a target device, starting a first lifetime timer, and refreshing the first lifetime timer if a first session message uploaded by the target device is obtained within the first lifetime timer period, saving the first session information corresponding to the first session message, and retaining the first session information after the first lifetime timer expires; obtaining a second login message uploaded by the target device, starting a second lifetime timer, and saving the second session information corresponding to the second session message if a heartbeat message and a second session message uploaded by the target device are obtained within the second lifetime timer period, and deleting the second session information after the second lifetime timer expires. The present invention can be widely applied to the field of Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a heartbeat control method for NB-IoT equipment. Background Art

[0002] NB-IoT technology, with its low power consumption, low cost, wide coverage, and large connection characteristics, effectively solves the problem of low- and medium-speed IoT connection, and promotes the rapid implementation of IoT solutions in scenarios such as smart cities, smart homes, industry, and agriculture, and has been widely used in the field of IoT. The transport layer of NB-IoT is based on the UDP protocol, and the session retention time is short. NB-IoT devices need to frequently send heartbeat messages to the IoT platform to maintain the session and ensure downlink reachability, resulting in a waste of network resources and increasing the number of connections and power consumption of NB-IoT devices. In addition, NB-IoT devices are in a dormant state during non-business periods, but when they switch from dormant state to online state, they need to resend login messages and subscribe to resources. At this time, the amount of data interaction between NB-IoT devices and the IoT platform is several times that of normal data reporting, which greatly increases the number of interactions and power consumption between NB-IoT devices and the IoT platform, and also increases the pressure on the IoT platform during business peaks.

[0003] Therefore, a heartbeat control solution is needed that can reduce the power consumption of NB-IoT devices and reduce the resources occupied by the IoT platform. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a heartbeat control method for NB-IoT devices that can reduce the power consumption of NB-IoT devices and reduce the resources occupied by an Internet of Things platform.

[0005] An aspect of an embodiment of the present invention provides a heartbeat control method for an NB-IoT device, including:

[0006] In the heartbeat-free mode, a first login message of an NB-IoT device is obtained, and the NB-IoT device is used as a target device; a first lifetime timer is started according to a first lifetime field carried by the first login message; within the period of the first lifetime timer, if a first session message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted, and the first session information corresponding to the first session message is saved; after the first lifetime timer expires, the target device is determined to be in an offline state, and the first session information is retained;

[0007] In the heartbeat mode, a second login message uploaded by the target device is obtained; a second lifetime timer is started according to a second lifetime field carried by the second login message; within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, the second session information corresponding to the second session message is saved; after the second lifetime timer expires, the target device is determined to be in an offline state, and the second session information is deleted.

[0008] Preferably, if the first session message uploaded by the target device is obtained within the first lifetime timer period, refreshing the first lifetime timer so that the first lifetime timer is restarted includes:

[0009] Within the first lifetime timer period, if an uplink message actively uploaded by the target device is received, the first lifetime timer is refreshed so that the first lifetime timer is restarted;

[0010] or,

[0011] Within the first lifetime timer period, if a command response message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted.

[0012] Preferably, within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, then the second session information corresponding to the second session message is saved, including:

[0013] Within the second lifetime timer period, if a heartbeat message uploaded by the target device at a set time interval is obtained, the target device is determined to be in an online state;

[0014] If the target device is in an online state period and a second session message uploaded by the target device is obtained, the second session information corresponding to the second session message is saved.

[0015] Preferably, after the second lifetime timer expires, determining the target device as being in an offline state and deleting the second session information includes:

[0016] If, within the period of the second lifetime timer, no heartbeat message uploaded by the target device at the set time interval is obtained, the second lifetime timer is determined to be expired;

[0017] After the second lifetime timer expires, the target device is determined to be in an offline state, and the second session information is deleted.

[0018] Another aspect of the embodiment of the present invention further provides another heartbeat control method for an NB-IoT device, and the NB-IoT device applied to the heartbeat control method for the above-mentioned NB-IoT device includes:

[0019] Upload the login message to the IoT platform and determine the current state as online;

[0020] In the heartbeat-free mode, uploading a first session message to the Internet of Things platform, so that the Internet of Things platform refreshes a first lifetime timer determined by the login message, and saves first session information corresponding to the first session message; after the first lifetime timer expires, determining the current state as an offline state;

[0021] In the heartbeat mode, a heartbeat message is uploaded to the Internet of Things platform at a set time interval to maintain the current state in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined to be an offline state.

[0022] Preferably, uploading the first session message to the Internet of Things platform includes:

[0023] Uploading an uplink message to the Internet of Things platform;

[0024] or,

[0025] After responding to the instruction issued by the Internet of Things platform, upload the instruction response message to the Internet of Things platform.

[0026] Preferably, after the second lifetime timer expires, determining the current state as an offline state includes:

[0027] If the heartbeat message is not uploaded to the Internet of Things platform at the set time interval, the second lifetime timer is determined to be expired;

[0028] After the second lifetime timer expires, the current state is determined to be an offline state.

[0029] Another aspect of the embodiment of the present invention further provides a heartbeat control device for an NB-IoT device, which is applied to an Internet of Things platform in the heartbeat control method for the above-mentioned NB-IoT device, comprising:

[0030] A first heartbeat-free unit is configured to obtain a first login message of an NB-IoT device in a heartbeat-free mode, with the NB-IoT device serving as a target device; start a first lifetime timer according to a first lifetime field carried in the first login message; within a period of the first lifetime timer, if a first session message uploaded by the target device is obtained, refresh the first lifetime timer so that the first lifetime timer is restarted, and save the first session information corresponding to the first session message; after the first lifetime timer expires, determine the target device as being in an offline state, and retain the first session information;

[0031] The first heartbeat unit is used to obtain a second login message uploaded by the target device in a heartbeat mode; start a second lifetime timer according to a second lifetime field carried by the second login message; within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, save the second session information corresponding to the second session message; after the second lifetime timer expires, determine the target device as offline and delete the second session information.

[0032] Another aspect of the embodiment of the present invention further provides another heartbeat control device of an NB-IoT device, which is applied to the NB-IoT device in the heartbeat control method of the above-mentioned NB-IoT device, including:

[0033] A login message uploading unit, used to upload a login message to the Internet of Things platform and determine the current state as an online state;

[0034] a second heartbeat-free unit, configured to upload a first session message to the Internet of Things platform in a heartbeat-free mode, so that the Internet of Things platform refreshes a first lifetime timer determined by the login message, and saves first session information corresponding to the first session message; after the first lifetime timer expires, determines the current state as an offline state;

[0035] The second heartbeat unit is used to upload a heartbeat message to the Internet of Things platform at a set time interval in the heartbeat mode, so that the current state is maintained in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined as an offline state.

[0036] Another aspect of an embodiment of the present invention further provides an electronic device, including a processor and a memory;

[0037] The memory is used to store programs;

[0038] The processor executes the program to implement the above-mentioned heartbeat control method of the NB-IoT device.

[0039] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, which stores a program, and the program is executed by a processor to implement the above-mentioned heartbeat control method of the NB-IoT device.

[0040] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned heartbeat control method of the NB-IoT device.

[0041] The present invention proposes a heartbeat control method for NB-IoT devices, including a heartbeat-free mode and a heartbeat-enabled mode, and users can freely choose one of them when registering NB-IoT devices on an Internet of Things platform. In the heartbeat-free mode, the first lifetime field carried in the first login message of the device determines the first life cycle of the NB-IoT device, and then starts the first lifetime timer corresponding to the first life cycle, and uses the first session message uploaded by the NB-IoT device to trigger the session process to refresh the first lifetime timer without sending additional heartbeat messages; if the NB-IoT device has no interaction with the Internet of Things platform during the first life cycle, the NB-IoT device is offline, and the offline NB-IoT device does not need to resend the login message and subscribe to resources when it goes online again, which greatly reduces the number of interactions between the NB-IoT device and the Internet of Things platform, and effectively reduces the power consumption of the NB-IoT device and the occupation of network resources of the Internet of Things platform.

[0042] In the heartbeat mode, the second life cycle of the NB-IoT device is determined by the second lifetime field carried in the second login message of the NB-IoT device, and then the second lifetime timer corresponding to the second life cycle is started. The heartbeat message needs to be sent within the second lifetime timer. When the second lifetime timer expires, the NB-IoT device is deemed to be offline and the NB-IoT device session information is deleted. This reduces the heartbeat interaction between the NB-IoT device and the IoT platform to a certain extent, reduces the power consumption of the NB-IoT device, and greatly reduces the storage resource usage of the IoT platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0044] Figure 1 A flowchart of a heartbeat control method for an NB-IoT device provided by an embodiment of the present invention;

[0045] Figure 2 A flowchart of another heartbeat control method for an NB-IoT device provided by an embodiment of the present invention;

[0046] Figure 3 A flowchart of a heartbeat-free mode in a heartbeat control method for an NB-IoT device provided in an embodiment of the present invention;

[0047] Figure 4 A flowchart of a heartbeat mode in a heartbeat control method for an NB-IoT device provided in an embodiment of the present invention;

[0048] Figure 5 A structural block diagram of a heartbeat control device for an NB-IoT device provided in an embodiment of the present invention;

[0049] Figure 6 A structural block diagram of a heartbeat control device for another NB-IoT device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0051] Reference Figure 1The embodiment of the present invention provides a heartbeat control method for an NB-IoT device, which is applied to an Internet of Things platform. The method may include: a heartbeat-free mode and a heartbeat-enabled mode.

[0052] Specifically, in the heartbeat-free mode, the IoT platform can obtain the login message of the NB-IoT device, which can be used as the first login message, and the NB-IoT device can be used as the target device. After uploading the first login message, the target device can become online. Then, the IoT platform can determine the first life cycle of the target device according to the first lifetime field carried by the first login message, and start the first lifetime timer corresponding to the first life cycle. The first lifetime timer can be used to calculate the remaining time of the first life cycle. During the first lifetime timer period, if the first session message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted, and the first session information corresponding to the first session message is saved. If the target device has no interaction with the IoT platform during the first life cycle, after the first lifetime timer expires, the target device is determined to be offline, the first session information is put into cold state, and the first session information is retained.

[0053] In addition, after the target device successfully logs in for the first time, no matter it is online or offline, business data reporting at any time does not require re-login. The IoT platform can find the historical session information of the target device through the globally unique token.

[0054] Specifically, in the heartbeat mode, the IoT platform can obtain the login message uploaded by the target device, and the login message can be used as the second login message. The target device can become online after uploading the second login message. The second life cycle of the target device is determined according to the second lifetime field carried by the second login message, and the second lifetime timer corresponding to the second life cycle is started. The second lifetime timer can be used to calculate the remaining time of the second life cycle. During the second lifetime timer period, if the IoT platform obtains the heartbeat message and the second session message uploaded by the target device, the second session information corresponding to the second session message is saved; after the second lifetime timer expires, the target device is determined to be offline and the second session information is deleted. In addition, the offline target device needs to log in again and subscribe to resources before business data can be transmitted.

[0055] In some embodiments of the present invention, in the above-mentioned heartbeat-free mode, if a first session message uploaded by a target device is obtained within a first lifetime timer period, the first lifetime timer is refreshed so that the first lifetime timer is restarted. Next, the process will be further described, which may specifically include:

[0056] Case 1: within the period of the first lifetime timer, if an uplink message actively uploaded by the target device is received, the first lifetime timer is refreshed so that the first lifetime timer is restarted.

[0057] Case 2: within the period of the first lifetime timer, if a command response message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted.

[0058] Specifically, the target device actively reports an uplink message to the IoT platform, or after the IoT platform sends a downlink instruction to the target device, the target device uploads an instruction response message, which can trigger the refresh of the first lifetime timer. That is, before the expiration of the first lifetime timer, the interaction between the target device and the IoT platform can trigger the refresh of the first lifetime timer, causing the first lifetime timer to be restarted.

[0059] In some embodiments of the present invention, in the above-mentioned heartbeat mode, if a heartbeat message and a second session message uploaded by a target device are obtained within a second lifetime timer period, a process of saving the second session information corresponding to the second session message is introduced. The process will be further described below, and may specifically include:

[0060] S1. Within the second lifetime timer period, if a heartbeat message uploaded by the target device at a set time interval is obtained, the target device is determined to be in an online state.

[0061] S2: If a second session message uploaded by the target device is obtained during a period in which the target device is in an online state, second session information corresponding to the second session message is saved.

[0062] Specifically, within the second lifetime timer period, the target device needs to send a heartbeat message to the IoT platform to maintain the session. The second session information can be temporarily stored in the session node of the IoT platform. When the second lifetime timer expires and the target device is offline, the IoT platform can delete the second session information.

[0063] Further, in the above embodiment of the present invention, after the second lifetime timer expires in the heartbeat mode, the process of determining the target device as offline and deleting the second session information may include:

[0064] S1. Within the period of the second lifetime timer, if the heartbeat message uploaded by the target device at the set time interval is not obtained, the second lifetime timer is determined to be expired.

[0065] S2. After the second lifetime timer expires, the target device is determined to be in an offline state, and the second session information is deleted.

[0066] Specifically, if the target device does not upload a heartbeat message to the IoT platform at a set time interval, it can be determined that the target device is offline, and the second lifetime timer can be determined to be expired. After the target device is offline, the IoT platform can delete the second session information.

[0067] Reference Figure 2 The embodiment of the present invention provides another heartbeat control method for NB-IoT device, which is applied to the NB-IoT device in the heartbeat control method for the above NB-IoT device. The method may include:

[0068] Upload the login message to the IoT platform and determine the current state as online.

[0069] In the heartbeat-free mode, a first session message is uploaded to the Internet of Things platform so that the Internet of Things platform can refresh a first lifetime timer determined by the login message and save first session information corresponding to the first session message; after the first lifetime timer expires, the current state is determined to be an offline state.

[0070] Specifically, uploading the first session message to the Internet of Things platform may include uploading an uplink message to the Internet of Things platform, or uploading an instruction response message to the Internet of Things platform after responding to an instruction issued by the Internet of Things platform.

[0071] In the heartbeat mode, a heartbeat message is uploaded to the Internet of Things platform at a set time interval to maintain the current state in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined to be an offline state.

[0072] Specifically, the process of determining the current state of the target device as an offline state may include: if the target device does not upload a heartbeat message to the Internet of Things platform at a set time interval, the second lifetime timer may be determined to be expired;

[0073] After the second lifetime timer expires, the current state is determined to be an offline state.

[0074] Next, the process of the heartbeat control of the NB-IoT device by the IoT platform in the present invention will be explained with a specific example.

[0075] Reference Figure 3 , Figure 3 A flowchart of a heartbeat-free mode in a heartbeat control method of an NB-IoT device is shown.

[0076] 1. Device login: Determine the life cycle of the target device based on the lifetime field carried in the login message, start the lifetime timer (such as 24 hours), and store the session information in the session node of the IoT platform.

[0077] 2. Data reporting: Regardless of whether the target device is online or not, data can be reported directly, and the lifetime timer will be refreshed and restarted.

[0078] 3. Command issuance: When issuing a command, the target device needs to be online. When the device replies to the command, the lifetime timer will be refreshed and restarted.

[0079] 4. Device offline: If the target device has no interaction with the IoT platform within the lifetime period, the target device is deemed offline and the session node is notified to put the session information into cold storage without deleting it. When the target device sends a data packet again, it will become online, restart the lifetime timer, and update the previous session information.

[0080] Reference Figure 4 , Figure 4 A flowchart of a heartbeat mode in a heartbeat control method for an NB-IoT device is shown.

[0081] 1. Device login: Determine the target device lifecycle based on the lifetime field carried in the login message and start the lifetime timer. During the lifetime period, the target device needs to send a heartbeat message to the IoT platform to maintain the session. The session information is temporarily stored in the session node of the IoT platform.

[0082] 2. Data reporting: If the target device is offline, you will need to log in to the device before reporting data. The data reporting message will not refresh the lifetime timer.

[0083] 3. Command issuance: When issuing commands, the target device needs to be online. The target device’s reply to the command will not refresh the timer. Whether the command can be sent downlink may also be related to the power saving mode of the target device. For example, in PSM mode, the target device will not be able to receive commands when it is in power saving state.

[0084] 4. Device offline: Lifetime timer expires, the target device goes offline, and the session node is notified to delete the session information, thereby achieving the goal. Even if the device does not actively send an offline message, the IoT platform will promptly update the online status of the target device; if the target device wants to become online, it needs to resend a login message, or when the target device is online and wants to continue to stay online, it can send an update message to the IoT platform to maintain online status.

[0085] Reference Figure 5 , an embodiment of the present invention provides a heartbeat control device for an NB-IoT device, comprising:

[0086] A first heartbeat-free unit is configured to obtain a first login message of an NB-IoT device in a heartbeat-free mode, with the NB-IoT device serving as a target device; start a first lifetime timer according to a first lifetime field carried in the first login message; within a period of the first lifetime timer, if a first session message uploaded by the target device is obtained, refresh the first lifetime timer so that the first lifetime timer is restarted, and save the first session information corresponding to the first session message; after the first lifetime timer expires, determine the target device as being in an offline state, and retain the first session information;

[0087] The first heartbeat unit is used to obtain a second login message uploaded by the target device in a heartbeat mode; start a second lifetime timer according to a second lifetime field carried by the second login message; within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, save the second session information corresponding to the second session message; after the second lifetime timer expires, determine the target device as offline and delete the second session information.

[0088] Reference Figure 6 , an embodiment of the present invention provides another heartbeat control device of an NB-IoT device, comprising:

[0089] A login message uploading unit, used to upload a login message to the Internet of Things platform and determine the current state as an online state;

[0090] a second heartbeat-free unit, configured to upload a first session message to the Internet of Things platform in a heartbeat-free mode, so that the Internet of Things platform refreshes a first lifetime timer determined by the login message, and saves first session information corresponding to the first session message; after the first lifetime timer expires, determines the current state as an offline state;

[0091] The second heartbeat unit is used to upload a heartbeat message to the Internet of Things platform at a set time interval in the heartbeat mode, so that the current state is maintained in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined as an offline state.

[0092] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes Figure 1 The method shown.

[0093] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0094] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features described may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0095] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods 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, etc., which can store program codes.

[0096] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0097] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0098] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0100] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0101] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A heartbeat control method for NB-IoT devices. It is characterized in that Applied to IoT platforms, including: In the heartbeat-free mode, a first login message of an NB-IoT device is obtained, and the NB-IoT device is used as a target device; a first lifetime timer is started according to a first lifetime field carried by the first login message; within the period of the first lifetime timer, if a first session message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted, and the first session information corresponding to the first session message is saved; after the first lifetime timer expires, the target device is determined to be in an offline state, and the first session information is retained; In the heartbeat mode, obtaining a second login message uploaded by the target device; starting a second lifetime timer according to a second lifetime field carried by the second login message; within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, saving the second session information corresponding to the second session message; after the second lifetime timer expires, determining the target device as offline and deleting the second session information; After the second lifetime timer expires, determining the target device as being in an offline state and deleting the second session information includes: If, within the period of the second lifetime timer, no heartbeat message uploaded by the target device at the set time interval is obtained, the second lifetime timer is determined to be expired; After the second lifetime timer expires, the target device is determined to be in an offline state, and the second session information is deleted.

2. The heartbeat control method of the NB-IoT device according to claim 1, It is characterized in that If the first session message uploaded by the target device is obtained within the first lifetime timer period, refreshing the first lifetime timer so that the first lifetime timer is restarted includes: Within the first lifetime timer period, if an uplink message actively uploaded by the target device is received, the first lifetime timer is refreshed so that the first lifetime timer is restarted; or, Within the first lifetime timer period, if a command response message uploaded by the target device is obtained, the first lifetime timer is refreshed so that the first lifetime timer is restarted.

3. The heartbeat control method of the NB-IoT device according to claim 1, It is characterized in that If the heartbeat message and the second session message uploaded by the target device are obtained within the second lifetime timer period, the second session information corresponding to the second session message is saved, including: Within the second lifetime timer period, if a heartbeat message uploaded by the target device at a set time interval is obtained, the target device is determined to be in an online state; If the target device is in an online state period and a second session message uploaded by the target device is obtained, the second session information corresponding to the second session message is saved.

4. A heartbeat control method for NB-IoT devices, It is characterized in that The NB-IoT device used in the heartbeat control method of the NB-IoT device according to any one of claims 1 to 3 comprises: Upload the login message to the IoT platform and determine the current state as online; In the heartbeat-free mode, uploading a first session message to the Internet of Things platform, so that the Internet of Things platform refreshes a first lifetime timer determined by the login message, and saves first session information corresponding to the first session message; after the first lifetime timer expires, determining the current state as an offline state; In the heartbeat mode, a heartbeat message is uploaded to the Internet of Things platform at a set time interval to maintain the current state in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined to be an offline state.

5. The heartbeat control method of the NB-IoT device according to claim 4, It is characterized in that The uploading of the first session message to the Internet of Things platform includes: Uploading uplink messages to the Internet of Things platform; or, After responding to the instruction issued by the Internet of Things platform, upload the instruction response message to the Internet of Things platform.

6. The heartbeat control method of the NB-IoT device according to claim 4, It is characterized in that After the second lifetime timer expires, determining the current state as an offline state includes: If the heartbeat message is not uploaded to the Internet of Things platform at the set time interval, the second lifetime timer is determined to be expired; After the second lifetime timer expires, the current state is determined to be an offline state.

7. A heartbeat control device for NB-IoT equipment, It is characterized in that The Internet of Things platform used in the heartbeat control method of the NB-IoT device according to any one of claims 1 to 3 comprises: A first heartbeat-free unit is configured to obtain a first login message of an NB-IoT device in a heartbeat-free mode, with the NB-IoT device serving as a target device; start a first lifetime timer according to a first lifetime field carried in the first login message; within a period of the first lifetime timer, if a first session message uploaded by the target device is obtained, refresh the first lifetime timer so that the first lifetime timer is restarted, and save the first session information corresponding to the first session message; after the first lifetime timer expires, determine the target device as being in an offline state, and retain the first session information; The first heartbeat unit is used to obtain a second login message uploaded by the target device in a heartbeat mode; start a second lifetime timer according to a second lifetime field carried by the second login message; within the second lifetime timer period, if a heartbeat message and a second session message uploaded by the target device are obtained, save the second session information corresponding to the second session message; after the second lifetime timer expires, determine the target device as offline and delete the second session information; After the second lifetime timer expires, determining the target device as being in an offline state and deleting the second session information includes: If, within the period of the second lifetime timer, no heartbeat message uploaded by the target device at the set time interval is obtained, the second lifetime timer is determined to be expired; After the second lifetime timer expires, the target device is determined to be in an offline state, and the second session information is deleted.

8. A heartbeat control device for NB-IoT equipment, It is characterized in that The NB-IoT device used in the heartbeat control method of the NB-IoT device according to any one of claims 4 to 6 comprises: A login message uploading unit, used to upload a login message to the Internet of Things platform and determine the current state as an online state; a second heartbeat-free unit, configured to upload a first session message to the Internet of Things platform in a heartbeat-free mode, so that the Internet of Things platform refreshes a first lifetime timer determined by the login message, and saves first session information corresponding to the first session message; after the first lifetime timer expires, determines the current state as an offline state; The second heartbeat unit is used to upload a heartbeat message to the Internet of Things platform at a set time interval in the heartbeat mode, so that the current state is maintained in an online state within a second lifetime timer period, and the second lifetime timer is determined by the login message; during the online state, a second session message is uploaded to the Internet of Things platform so that the Internet of Things can save the second session information corresponding to the second session message, and delete the second session information after the second lifetime timer expires; after the second lifetime timer expires, the current state is determined as an offline state.

9. An electronic device, It is characterized in that including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the heartbeat control method of the NB-IoT device as described in any one of claims 1 to 3, or the heartbeat control method of the NB-IoT device as described in any one of claims 4 to 6.