CN117997807A - Method, system and communication device for detecting heartbeat of Internet of things equipment - Google Patents

Method, system and communication device for detecting heartbeat of Internet of things equipment Download PDF

Info

Publication number
CN117997807A
CN117997807A CN202211378432.7A CN202211378432A CN117997807A CN 117997807 A CN117997807 A CN 117997807A CN 202211378432 A CN202211378432 A CN 202211378432A CN 117997807 A CN117997807 A CN 117997807A
Authority
CN
China
Prior art keywords
internet
things
heartbeat
equipment
platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211378432.7A
Other languages
Chinese (zh)
Inventor
季振方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211378432.7A priority Critical patent/CN117997807A/en
Priority to PCT/CN2023/127338 priority patent/WO2024093851A1/en
Publication of CN117997807A publication Critical patent/CN117997807A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a method, a system and a communication device for detecting heartbeat of Internet of things equipment, wherein the method is applied to an Internet of things platform which is in communication connection with the Internet of things equipment, and the method comprises the following steps: when the internet of things platform does not receive the first heartbeat data sent by the first internet of things device within a preset time length after the last heartbeat data receiving, sending second heartbeat data to the first internet of things device; and determining that the first Internet of things equipment is in an online state or an offline state according to a second heartbeat data transmission result, wherein the first Internet of things equipment is in the online state when the second heartbeat data transmission is successful, and the first Internet of things equipment is in the offline state when the second heartbeat data transmission is failed. The method provided by the application can determine the offline state of the first Internet of things equipment at the first time under the condition that the first Internet of things equipment loses the packet, so that the accuracy of online state detection of the Internet of things equipment is improved.

Description

Method, system and communication device for detecting heartbeat of Internet of things equipment
Technical Field
The application relates to the technical field of the Internet of things, in particular to a method, a system and a communication device for detecting heartbeat of equipment of the Internet of things.
Background
In recent years, with the continuous popularization of the internet of things technology, internet of things devices, such as intelligent desk lamps, intelligent sockets, and the like, have been moved into thousands of households. The functions of remote control, data reporting, device related data issuing and the like of the Internet of things device can be conveniently realized through interaction among the terminal device, the Internet of things platform and the Internet of things device.
In general, the internet of things device sends heartbeat data to the internet of things platform under a certain heartbeat period, so that long connection is established with the internet of things platform. The Internet of things platform updates the online state or the offline state of the Internet of things device according to heartbeat data sent by the Internet of things device, and a user can acquire information of the online state or the offline state of the Internet of things device through the terminal device.
However, when the internet of things platform is disconnected from the internet of things device, the internet of things platform is not accurate enough to update the online state or the offline state of the internet of things device.
Disclosure of Invention
The application provides a method, a system and a communication device for detecting the heartbeat of Internet of things equipment, wherein when the Internet of things platform is disconnected with the Internet of things equipment, the Internet of things platform initiates active detection, so that the problem that the state of the Internet of things equipment cannot be accurately judged is solved, and the accuracy of online state detection of the Internet of things equipment is improved.
In a first aspect, the present application provides a method for detecting heartbeat of an internet of things device, where the method is applied to an internet of things platform, and the internet of things platform is communicatively connected with a first internet of things device, and the method includes: when the internet of things platform does not receive the first heartbeat data sent by the first internet of things device within a preset time length after the last heartbeat data receiving, sending second heartbeat data to the first internet of things device; and determining whether the first Internet of things equipment is in an online state or an offline state according to the second heartbeat data transmission result, wherein the first Internet of things equipment is in the online state when the second heartbeat data transmission is successful, and indicating that the first Internet of things is in the offline state when the second heartbeat data transmission is failed.
According to the method provided by the first aspect, when the first heartbeat period sent by the first Internet of things device is not received by the Internet of things device in the heartbeat period, whether the first Internet of things device is in an online state or an offline state can be determined without waiting for a timeout period (three heartbeat periods) in the prior art, and second heartbeat data can be actively sent to the first Internet of things device.
It should be understood that the preset time length may be a heartbeat cycle, where the heartbeat cycle may refer to a suggested value obtained by the internet of things device from an operator or an experiment performed on the basis of the suggested value, and then set according to the experimental value, where the heartbeat cycles of the internet of things devices of the same model are the same. Of course, the heartbeat cycle may also be a target heartbeat cycle, where the target heartbeat cycle is determined according to an environment where the internet of things device is located.
It should also be understood that the first internet of things device may be a device with a sensor detection function or an access device with an intelligent function in the internet of things, for example, an intelligent switch, an intelligent socket, an intelligent ammeter, an intelligent water meter, an intelligent electric lamp, a large intelligent television, an intelligent water dispenser, an intelligent air conditioner, an intelligent floor heating device, an intelligent projector, an intelligent washing machine or an intelligent electric cooker, etc.
In a possible implementation manner of the first aspect, the method further includes: acquiring related information of the first Internet of things device, wherein the related information comprises one or more of the following: the method comprises the steps of equipment information of first Internet of things equipment, region information of the first Internet of things equipment and first Internet of things equipment network information. Determining a target heartbeat cycle of the first Internet of things device according to the related information of the first Internet of things device, and sending the target heartbeat cycle to the first Internet of things device, wherein the preset time period is the target heartbeat cycle. In the implementation manner, the heartbeat period suitable for the first Internet of things device under the scene can be determined according to the related information of the first Internet of things device, then the first Internet of things device can send heartbeat data to the Internet of things platform based on the target heartbeat period by sending the target heartbeat period to the first Internet of things device, and when the Internet of things platform does not receive the first heartbeat data sent by the first Internet of things device in the target heartbeat period, second heartbeat data is sent to the first Internet of things device, so that waste of air interface resources is avoided, and power consumption of the device is reduced.
In one possible implementation manner of the aspect, before sending the second heartbeat data to the first internet of things device, the method further includes determining, according to the related information of the first internet of things device, that the first internet of things device starts the heartbeat active detection mechanism. In this implementation manner, the internet of things platform can determine whether the first internet of things device is in a weak network based on the related information of the first internet of things device, when the first internet of things device is in the weak network, the possibility that the device loses packets is larger, so that a heartbeat active detection mechanism needs to be started, when the first internet of things device is in a strong network, the device does not need to start the heartbeat active detection mechanism, because the possibility that the device loses packets when the first internet of things device is in the strong network is smaller.
In one possible implementation manner of the aspect, the internet of things platform stores a device heartbeat database, determines a target heartbeat cycle of the first internet of things device according to related information of the first internet of things device, and includes: and inquiring a target heartbeat period of the first Internet of things device in the device heartbeat database according to the related information of the first Internet of things device.
It should be understood that the device heartbeat database contains a large number of device portraits, and when the internet of things platform receives the related information of the first internet of things device, the target heartbeat period of the device in the current scene can be found out from the device heartbeat database.
In one possible implementation manner of an aspect, determining, according to information related to a first internet of things device, that the first internet of things device starts a heartbeat active detection mechanism includes: and inquiring the first Internet of things equipment in the equipment heartbeat database according to the related information of the first Internet of things equipment to start a heartbeat active detection mechanism.
Similarly, the mass information stored in the heartbeat database of the device includes whether the device needs to start the heartbeat active detection mechanism in the current scene.
It should be noted that, the target heartbeat period in the device heartbeat database and whether the first internet of things device starts the heartbeat active detection mechanism can be set independently by the user. In other words, the first internet of things can be in communication connection with the internet of things platform based on the target heartbeat period set by the user in a personalized manner, and the first internet of things device can also determine whether to start the heartbeat active detection mechanism based on the user in a personalized manner.
In one possible implementation of an aspect, the method further includes: acquiring user setting information, wherein the user setting information comprises: the heartbeat cycle of the second internet equipment set by the user and/or whether the second internet equipment set by the user starts an active detection mechanism; transmitting request information to the second internet-of-things device, wherein the request information is used for requesting related information of the second internet-of-things device; and receiving the related information of the second internet-of-things device, and adding the related information of the second internet-of-things device and the user setting information to the device heartbeat database. By the implementation mode, a device heartbeat database can be expanded, more relevant information of devices in different scenes is collected, and a heartbeat period set by a user in the scene and whether a heartbeat active detection mechanism is started or not are collected.
For example, the user may input user setting information on the terminal device, and then the terminal device sends the user setting information to the internet of things platform, and finally the internet of things platform updates the device heartbeat database based on the user setting information.
In a second aspect, the present application provides a method for detecting heartbeat of an internet of things device, where the method is applied to a first internet of things device, and the first internet of things device is communicatively connected with an internet of things platform, and the method includes: the method comprises the steps of sending relevant information of first Internet of things equipment to an Internet of things platform, wherein the relevant information comprises one or more of the following: the method comprises the steps of equipment information of first Internet of things equipment, region information of the first Internet of things equipment and network information of the first Internet of things equipment; receiving a target heartbeat period sent by an internet of things platform, wherein the target heartbeat period is determined according to related information of first internet of things equipment; sending first heartbeat data to the internet of things platform according to the target heartbeat period; and receiving second heartbeat data sent by the internet of things platform, wherein the second heartbeat data is sent when the first heartbeat data is not received by the internet of things platform in a target period.
According to the method provided by the second aspect, the heartbeat period suitable for the first Internet of things device under the scene can be determined by sending the related information of the first Internet of things device to the Internet of things platform, the first Internet of things device sends heartbeat data to the Internet of things platform based on the target heartbeat period, and when the Internet of things platform does not receive the first heartbeat data sent by the first Internet of things device in the target heartbeat period, the second heartbeat data is sent to the first Internet of things device, so that waste of air interface resources is avoided, and power consumption of the device is reduced.
In a possible implementation method of the second aspect, the receiving the actively sent second heartbeat data sent by the internet of things platform includes: when the first Internet of things device starts an active detection mechanism, the receiving Internet of things platform sends actively sent second heartbeat data. In the implementation manner, when the first internet of things device starts the active detection mechanism, the first internet of things device is indicated to be in the weak network, and the possibility of packet loss of the device is indicated to be high, so that the heartbeat active detection mechanism needs to be started. When the first Internet of things device starts the active detection mechanism, the first Internet of things device can receive the second heartbeat data which is sent actively and sent by the Internet of things platform.
In a possible implementation manner of the second aspect, request information sent by the internet of things platform is received, where the request information is used to request related information of a second internet of things device, and the related information of the second internet of things device includes one or more of the following: device information of the second internet-of-things device, region information of the second internet-of-things device, and network information of the second internet-of-things device; and based on the request information, sending the related information of the second internet of things device to the internet of things platform. By the implementation mode, a device heartbeat database can be expanded, more relevant information of devices in different scenes is collected, and a heartbeat period set by a user in the scene and whether a heartbeat active detection mechanism is started or not are collected.
In a possible implementation manner of the second aspect, the target heartbeat period is set by a user.
In a third aspect, a system based on heartbeat detection of an internet of things device is provided, the system comprising an internet of things platform for performing the method of the first aspect above or any of the possible implementation manners of the first aspect, and an internet of things device for performing the method of the second aspect above or any of the possible implementation manners of the second aspect.
In a fourth aspect, a communication device is provided, the communication device comprising means for performing the steps of the above first aspect or any of the possible implementation forms of the first aspect, or the steps of the above second aspect or any of the possible implementation forms of the second aspect.
In a fifth aspect, a communication device is provided, the communication device comprising at least one processor and a memory, the processor and the memory being coupled, the memory storing program instructions which, when executed by the processor, perform the method of the first aspect above or any of the possible implementations of the first aspect or the method of the second aspect above or any of the possible implementations of the second aspect.
In a sixth aspect, a communication device is provided, the communication device comprising at least one processor and interface circuitry, the at least one processor being configured to perform the method of the above first aspect or any of the possible implementations of the first aspect, or the method of the above second aspect or any of the possible implementations of the second aspect.
In a seventh aspect, there is provided an internet of things platform, which includes the communication apparatus provided in the fourth aspect, or the terminal device includes the communication apparatus provided in the fifth aspect, or the terminal device includes the communication apparatus provided in the sixth aspect.
An eighth aspect provides an internet of things device, the internet of things device comprising the communication apparatus provided in the fourth aspect, or the internet of things device comprising the communication apparatus provided in the fifth aspect, or the internet of things device comprising the communication apparatus provided in the sixth aspect.
A ninth aspect provides a computer program product comprising a computer program for performing the method of the first aspect above or any of the possible implementations of the first aspect or the method of the second aspect above or any of the possible implementations of the second aspect when executed by a processor.
In a tenth aspect, a computer readable storage medium is provided, in which a computer program is stored which, when executed, is adapted to carry out the method of the first aspect above or any of the possible implementations of the first aspect or the possible implementations of the second aspect above.
In an eleventh aspect, there is provided a chip comprising: a processor for calling and running a computer program from a memory, causing a communication device on which the chip is installed to perform a method for performing the above first aspect or any of the possible implementation forms of the first aspect or the possible implementation forms of the second aspect or any of the possible implementation forms of the second aspect.
In a twelfth aspect, a communication system is provided, where the communication system includes the internet of things platform and the internet of things device.
Drawings
Fig. 1 shows an interaction schematic diagram among an internet of things device, an IOT cloud platform and a terminal device in the related art;
fig. 2 shows a schematic diagram of an architecture of a heartbeat detection system of an internet of things device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an example of a heartbeat detection method 300 of an internet of things device according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another example of a heartbeat detection method 400 of an internet of things device according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an interface for detecting heartbeat of an Internet of things device;
FIG. 6 shows a schematic interface diagram of an intelligent socket on an APP in an offline state;
FIG. 7 is a schematic flow chart diagram of an example method 700 for updating a device heartbeat database provided by an embodiment of the present application;
FIG. 8 shows a schematic flow chart diagram of another example method 800 for updating a device heartbeat database provided by an embodiment of the present application;
FIG. 9 illustrates an interface diagram for user personalized setting of smart jack parameters;
fig. 10 is a schematic diagram of an example of an internet of things device heartbeat detection system according to an embodiment of the present application;
fig. 11 shows a schematic block diagram of a communication apparatus 1100 provided by an embodiment of the application;
FIG. 12 shows a schematic block diagram of another example communication apparatus 1200 provided by an embodiment of the present application;
fig. 13 shows a schematic diagram of a chip system.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include, for example, "one or more" such forms of expression, unless the context clearly indicates to the contrary. It should also be understood that in embodiments of the present application, "one or more" means one or more than two (including two); "and/or", describes an association relationship of the association object, indicating that three relationships may exist; for example, a and/or B may represent: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The plurality of the embodiments of the present application is greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first," "second," and the like are used for distinguishing between the descriptions and not necessarily for indicating or implying a relative importance, or alternatively, for indicating or implying a sequential order.
The technical scheme of the embodiment of the application can be applied to various communication systems, such as: global system for mobile communications (global system for mobile communications, GSM), code division multiple access (code division multiple access, CDMA) system, wideband code division multiple access (wideband code division multiple access, WCDMA) system, general packet radio service (GENERAL PACKET radio service, GPRS), long term evolution (long term evolution, LTE) system, LTE frequency division duplex (frequency division duplex, FDD) system, LTE time division duplex (time division duplex, TDD), universal mobile telecommunications system (universal mobile telecommunication system, UMTS), worldwide interoperability for microwave access (worldwide interoperability for microwave access, wiMAX) communication system, future fifth generation (5th generation,5G) system, or New Radio (NR), etc.
The terminal device in the embodiments of the present application may refer to a user device, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user apparatus. The terminal device may also be a cellular telephone, a cordless telephone, a session initiation protocol (session initiation protocol, SIP) phone, a wireless local loop (wireless local loop, WLL) station, a personal digital assistant (personal DIGITAL ASSISTANT, PDA), a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a future 5G network or a terminal device in a future evolved public land mobile network (public land mobile network, PLMN), etc., as embodiments of the present application are not limited in this respect.
In the embodiment of the application, the terminal equipment or the network equipment comprises a hardware layer, an operating system layer running on the hardware layer and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (central processing unit, CPU), a memory management unit (memory management unit, MMU), and a memory (also referred to as a main memory). The operating system may be any one or more computer operating systems that implement business processes through processes (processes), such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer comprises applications such as a browser, an address book, word processing software, instant messaging software and the like. Further, the embodiment of the present application is not particularly limited to the specific structure of the execution body of the method provided by the embodiment of the present application, as long as the communication can be performed by the method provided according to the embodiment of the present application by running the program recorded with the code of the method provided by the embodiment of the present application, and for example, the execution body of the method provided by the embodiment of the present application may be a terminal device or a network device, or a functional module in the terminal device or the network device that can call the program and execute the program.
Furthermore, various aspects or features of the application may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques. The term "article of manufacture" as used herein encompasses a computer program accessible from any computer-readable device, carrier, or media. For example, computer-readable media can include, but are not limited to, magnetic storage devices (e.g., hard disk, floppy disk, or magnetic strips, etc.), optical disks (e.g., compact disk, CD, digital versatile disk, DIGITAL VERSATILE DISC, DVD, etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory, EPROM), cards, sticks, key drives, etc. Additionally, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media capable of storing, containing, and/or carrying instruction(s) and/or data.
With the rise of the internet of things (Internet of things, IOT), a large number of intelligent terminal devices are put into use. The Internet of things combines various Internet of things devices with the Internet to form a huge network, so that the interconnection and intercommunication of people, machines and objects at any time and any place are realized.
In particular, smart home appliances have been taken into thousands of households. For example, the functions of remote control, data reporting, device related data issuing and the like of the internet of things device can be conveniently realized through interaction among an Application (APP), an IOT cloud platform and the internet of things device.
Because of the limitation of hardware, the internet of things equipment often uses limited application protocols (Costrained Application Protocal, coAP)/message queue telemetry transport (Message Queuing Telemetry Transport, MQTT) and other internet of things protocols in the interaction process with the IOT cloud platform. And establishing a communication path with the IOT cloud platform through establishing a transmission control protocol (Transmission Control Protocol, TCP) long connection, ensuring the activity of the communication path through a timing heartbeat mechanism, and supporting the remote control capability of the IOT cloud platform and the Internet of things equipment.
It should be noted that, the internet of things device based on mobile cellular connection needs to maintain a connection with the server. But the internet of things equipment and the server remain connected to occupy the base station resources. Because of the limited resources of the base station and the regular base station, when the mobile internet of things equipment communicates with the server, the base station can allocate an internet protocol (Internet Protocol, IP) address to the internet of things equipment, if no data is transmitted for a certain time, the base station can cancel the allocation of the IP address to the internet of things equipment and release the resources to other demands, so that the internet of things equipment timing and the server are required to establish communication to keep a communication channel clear, and the timing is named as a heartbeat period. The short heartbeat period can ensure that the information of the service layer can be reached at any time, but the server is excessively loaded, and the power consumption is increased; if the heartbeat period is too long, connection failure between the Internet of things equipment and the server can be caused, and at the moment, the Internet of things equipment must initiate connection again to acquire IP address allocation from the base station, so that communication efficiency can be reduced, and too high power consumption of the server and the Internet of things equipment can be caused.
The heartbeat cycle can also be understood as that the internet of things device sends a data packet to the IOT cloud platform every other period of time, the IOT cloud platform is informed that the IOT cloud platform is still online, the IOT cloud platform and the internet of things device interact every other period of time to judge whether the link is effective or not, and some possibly necessary data are transmitted. It is often not guaranteed whether a TCP socket connection is continuously active after the connection is established, and applications on both sides will periodically send heartbeat packets to ensure that the connection is active. Because the data packets are transmitted according to a certain time interval and are similar to heartbeat, the data packets transmitted by the internet of things equipment are called heartbeat packets, and the time between transmitting the two heartbeat packets is called a heartbeat period. And judging whether the Internet of things equipment is in an offline state or not by periodically sending heartbeat packets between the Internet of things equipment and the IOT cloud platform.
However, when the internet of things device does not send the heartbeat packet to the IOT, the internet of things device cannot be described as being in an offline state, and the internet of things device also needs to have a timeout period, so that the accuracy of the online state of the internet of things device always has an error of 2% -3%.
In general, a timeout period refers to the time of three heart cycles. In other words, after the internet of things device fails to send the heartbeat packet, the internet of things device still continues to try to send the heartbeat packet for three times, so that the internet of things device also needs to wait for the time of three heartbeat cycles at the IOT cloud platform end, and if the time of the three heartbeat cycles is waited, the terminal device is finally judged to be in an offline state. Therefore, the accuracy of the online state of the terminal device always has an error.
The method for detecting the heartbeat of the internet of things device in the related art is specifically described below with reference to fig. 1.
Fig. 1 shows an interaction schematic diagram among an internet of things device, an IOT cloud platform and a terminal device in the related art. As shown in fig. 1, the internet of things device may send a heartbeat packet to the IOT cloud platform in a heartbeat period to indicate whether the IOT cloud platform is in an online state or not, and the IOT cloud platform may periodically receive the heartbeat packet sent by the internet of things device, determine whether the physical network device is in an offline state according to a heartbeat timeout time, and the IOT cloud platform may present the offline state of the internet of things device on an APP of a terminal device bound to the internet of things device, where a user may query the offline state of the internet of things device through the APP.
It should be noted that, the heartbeat signaling from the internet of things device to the IOT cloud platform is defined in the CoAP/MQTT protocol, and the internet of things device can keep alive at regular time according to the heartbeat period.
It should be further noted that, when the IOT cloud platform determines whether the internet of things device is in an online state, the existing heartbeat cycle generally obtains a suggested value from an operator, or performs an experiment on the basis, and then sets according to the experimental value. However, the rules of the base station in the cellular network may change with time, location, upgrade and transformation of the operator equipment, service evolution, and other factors affecting the heartbeat cycle. Therefore, under the existing heartbeat period, the IOT cloud platform needs to judge that the internet of things equipment is in an offline state based on the timeout period, and when the IOT cloud platform feeds back the internet of things equipment to the APP, a certain error exists in the offline state, and the user is finally caused to acquire the internet of things equipment from the APP in the offline state inaccurately.
In summary, the current IOT cloud platform determines the offline state of the terminal device based on the online timeout time of the internet of things device, when the internet of things device sends a heartbeat packet to the IOT cloud platform, and when the packet loss occurs, the IOT cloud platform can continue to wait for three heartbeat cycles and refresh the offline state of the internet of things device, which finally results in inaccurate accuracy of the online state of the current device. Therefore, a detection scheme capable of rapidly detecting whether the internet of things is online is needed.
In view of the above, the application provides a heartbeat detection method for an internet of things device, wherein when an internet of things platform does not receive heartbeat data sent by the internet of things device within a preset time length after receiving the heartbeat data for the last time, the method actively sends the heartbeat data to the internet of things device; and determining that the Internet of things equipment is in an online state or an offline state according to the heartbeat data sending result, wherein the Internet of things equipment is in the online state when the heartbeat data is sent successfully, and the Internet of things equipment is in the offline state when the second heartbeat data is sent successfully. In the method, when the Internet of things platform does not receive the heartbeat packet of the Internet of things device in the heartbeat period, the Internet of things platform starts an active detection mechanism to judge whether the Internet of things device is on line or not, and the Internet of things device can be judged to be in an off-line state after waiting for the timeout time.
Before introducing the heartbeat detection method of the internet of things equipment provided by the application, a system architecture and an application scene to which the method is applicable are described first. Fig. 2 shows a schematic diagram of an architecture of a heartbeat detection system of an internet of things device according to an embodiment of the present application.
As shown in fig. 2, the system comprises an internet of things platform, internet of things equipment and terminal equipment, wherein the internet of things platform comprises an equipment gateway, equipment shadow and heartbeat data big data.
The terminal device refers to a device in which a service application is installed, and may also be referred to as a device in which a client is installed. The user can access the Internet of things platform through a client installed on the terminal equipment or access the Internet of things platform through the service server, and the user can view the Internet of things equipment in communication connection with the Internet of things platform through the client, view service data reported by the Internet of things equipment, and can also issue control commands and the like to the Internet of things equipment through the client.
The terminal device according to the embodiment of the present application may be a device that provides voice and/or data connectivity to a user, a handheld device with a wireless connection function, or other processing device connected to a wireless modem. The wireless terminals may communicate with one or more core networks via a radio access network (Radio Access Network, RAN), which may be mobile terminals such as mobile phones (or "cellular" phones) and computers with mobile terminals, e.g., portable, pocket, hand-held, computer-built-in or vehicle-mounted mobile devices that exchange voice and/or data with the radio access network. Such as Personal communication services (Personal Communication Service, PCS) phones, cordless phones, session Initiation Protocol (SIP) phones, wireless local loop (Wireless Local Loop, WLL) stations, personal digital assistants (Personal DIGITAL ASSISTANT, PDA) and the like. A wireless Terminal may also be referred to as a system, subscriber Unit (Subscriber Unit), subscriber Station (Subscriber Station), mobile Station (Mobile Station), remote Station (Remote Station), access Point (Access Point), remote Terminal (Remote Terminal), access Terminal (ACCESS TERMINAL), user Terminal (User Terminal), terminal Device, user Agent (User Agent), user Device (User Equipment), or User Equipment (User Equipment), and the application is not limited in particular.
The internet of things device refers to an access device with a sensor detection function or an intelligent function in the internet of things, such as a device supporting a temperature detection sensor or a household internet of things device (can be an intelligent home system formed by a plurality of devices), for example, a small intelligent switch, an intelligent ammeter, an intelligent water meter, an intelligent electric lamp, a large intelligent television, an intelligent water fountain, an intelligent air conditioner, an intelligent floor heating device, an intelligent projector, an intelligent washing machine or an intelligent electric cooker and the like used in the life of a user.
The internet of things platform is connected with the internet of things equipment, supports the internet of things equipment to report service data, provides the service data for users, or receives control commands issued by the users to the internet of things equipment. The internet of things platform is also in communication connection with a network application or a service application built in the terminal equipment. For example, in the smart home system scenario, if the device a in the smart home system wants to interact with the device B in the smart home system, the interaction needs to be implemented through the internet of things platform forwarding.
Optionally, as shown in fig. 2, in the heartbeat detection system of the internet of things provided by the present application, after the internet of things device and the internet of things platform are connected, the internet of things device may send relevant information to itself, for example: the method comprises the steps that equipment information of the Internet of things equipment, region information of the Internet of things equipment and network information of the Internet of things equipment are sent to an Internet of things platform, and then the Internet of things platform determines the heartbeat cycle of the Internet of things equipment and determines whether to start a heartbeat active detection mechanism according to at least one of the information.
The device gateway on the internet of things platform can receive the related information of the internet of things sent by the internet of things device, then analyze the related protocol and send the related protocol to the device shadow, and the device shadow can inquire the heartbeat period under the current scene and whether the internet of things platform starts a heartbeat active detection mechanism from the device heartbeat database.
Therefore, the system provided by the application can determine the heartbeat period of the Internet of things equipment and whether to start the heartbeat active detection mechanism and store the heartbeat period through the IOT according to the related information of the Internet of things equipment, and when the IOT does not receive the heartbeat packet of the terminal equipment in the heartbeat period, the IOT starts the active detection mechanism to judge whether the terminal equipment is on line or not, and the terminal equipment can be judged to be in an off-line state without waiting for the timeout time.
The heartbeat detection method of the Internet of things provided by the embodiment of the application is described in detail below with reference to the accompanying drawings.
Fig. 3 is a schematic flowchart illustrating a heartbeat detection method 300 of an internet of things device according to an embodiment of the present application from a device interaction perspective. As shown in fig. 3, the method 300 shown in fig. 3 may include steps S310 to S370. The various steps in method 300 are described in detail below in conjunction with FIG. 3.
It should be understood that, in the embodiment of the present application, the method 300 is described taking the internet of things platform, the internet of things device, and the terminal device as the execution bodies of the execution method 300 as an example. By way of example and not limitation, the execution subject of the execution method 300 may also be a chip applied in an internet of things platform, an internet of things device, and a terminal device.
S310, the first Internet of things device sends related information of the first Internet of things device to an Internet of things platform, wherein the related information comprises one or more of the following items: the method comprises the steps of equipment information of first Internet of things equipment, region information of the first Internet of things equipment or network information of the first Internet of things equipment.
It should be noted that the first internet of things device refers to any one of a plurality of internet of things devices communicatively connected to the internet of things platform.
Since the existing heartbeat cycle is generally obtained from an operator as a recommended value, or experiments are performed on the basis of the recommended value, and then the heartbeat cycle is set according to the experimental value. However, the base station rule in the cellular network may change the heartbeat period due to the influence of factors such as time, location, upgrading and reconstruction of operator equipment, service evolution and the like, so that the IOT cloud platform can only judge that the terminal equipment is in an offline state based on a timeout period under the existing heartbeat period, and finally, the accuracy of the online state of the terminal equipment is caused to have errors.
Therefore, in the embodiment of the application, the first internet of things device can acquire the target heartbeat cycle according to the related information of the first internet of things device, and based on the target heartbeat cycle and the heartbeat maintenance of the internet of things platform, the internet of things platform can rapidly determine the offline state of the first internet of things device based on the target heartbeat cycle.
For example, when the first internet of things device is a smart refrigerator, the heartbeat cycle of the batch of smart refrigerators of the model set by the factory is 30S, but when the batch of smart refrigerators use different scenes, the heartbeat cycle is not maintained at 30S. Suppose that at a certain place, the intelligent refrigerator has a heartbeat cycle of 40s due to the influence of the network environment. And when the internet of things platform does not receive the heartbeat data sent by the intelligent refrigerator when the period is 30s, the internet of things platform can actively send the heartbeat data to detect. However, in the current situation, the intelligent refrigerator is heartbeat data sent in a period of 40s, so that the judgment of the intelligent refrigerator in an off-line state is inaccurate.
Then, in order to obtain the target heartbeat cycle of the first physical network device, when the internet of things device is connected with the internet of things platform, relevant information of the first internet of things device can be sent to the internet of things platform, and the internet of things platform is utilized to determine the target heartbeat cycle.
The related information of the first internet of things device includes: device information of the first internet of things device, such as: the device information may include a device type, a charging type, etc., such as a charging type of a smart desk lamp, a smart refrigerator, or a smart jack, etc. Of course, the internet of things device may also be other devices with a sensor detection function or an access device with an intelligent function, for example, a charging type of an intelligent sound, etc., which is not limited by the embodiment of the present application. The charging type may be plug-in or lithium battery-mounted.
The region information of the first internet of things device is: the geographic location of use of the internet of things device, for example, a specific city, a specific street in the city, or a specific cell in the street, etc. The embodiment of the application does not limit the range of the regional information of the physical network equipment.
The network information of the first internet of things device refers to: the information of the operator to which the internet of things device is connected, for example, a mobile network, a corporate network, a telecommunication network, or the like, or the network information may be information of other operators than the three major operators.
The first internet of things device can send the related information of the at least one internet of things device to the internet of things platform, and the target heartbeat cycle acquired by the internet of things platform is utilized.
S320, the Internet of things platform determines a target heartbeat cycle of the first Internet of things device based on the related information of the first Internet of things device.
In the implementation of the application, after the internet of things platform acquires the related information of the first internet of things device, the target heartbeat cycle of the current internet of things device is determined by utilizing the related information of the first internet of things device.
When the internet of things platform obtains the target heartbeat period of the current internet of things device, the time for the first internet of things device to send the heartbeat data can be determined based on the target heartbeat period. When the first Internet of things equipment loses the packet, the Internet of things platform can rapidly and accurately determine whether the first Internet of things equipment is in an on-line state or an off-line state.
In some embodiments, the internet of things platform may search for a target heartbeat period in the device heartbeat database based on the related information of the first internet of things device, and return the target heartbeat period to the first internet of things device side.
It should be noted that, the device heartbeat database has a mass data management capability, and the device heartbeat database includes a target heartbeat detection period under the condition that device information of the internet of things device is different, under the condition that region information of the internet of things device is different, or under the condition that network information of the internet of things device is different.
For example: the device heartbeat database comprises: the target heartbeat period is 10s when the equipment information of the physical network equipment is an intelligent desk lamp with plug-in type; or the target heartbeat period is 15s when the network information of the intelligent desk lamp is a telecommunication network; or the region information of the intelligent desk lamp is 20s of the target heartbeat period when Nanjing.
Also for example: the device heartbeat database comprises: when the equipment information of the physical network equipment is an intelligent desk lamp with plug-in type, the network connected with the Internet of things equipment is a telecommunication network, and the region where the Internet of things equipment is located is western security, the heartbeat cycle of the Internet of things equipment is 1min.
The device heartbeat database may further include: when the equipment information of the physical network equipment is lithium battery type intelligent desk lamp, the network connected with the Internet of things equipment is a mobile network, and the region where the Internet of things equipment is located is Nanjing, the heartbeat cycle of the Internet of things equipment is 2min.
Then, after the internet of things platform obtains the related information of the internet of things device, the related information is compared in the device heartbeat database, so that the target heartbeat period is found out.
For example, when the related information of the first internet of things device acquired by the internet of things platform is the second condition, the target heartbeat period of the internet of things device is 2min.
It will be appreciated that the target heart cycle is the result of a search in the current device heart database, and that since the results in the heart database are dynamically changing, the target heart cycle is also dynamically changing, in other words, the results of the target heart cycle are different when searched at different times.
It may be seen that, in the above example, the device heartbeat database may determine the target heartbeat period of the first internet of things device based on the device information of the first internet of things device, or the region information where the first internet of things device is located, or the network information of the first internet of things device. The target heartbeat period can also be determined based on the device information of the first internet of things device, the region information of the first internet of things device and the network information of the first internet of things device. However, the target heartbeat period determined by the single factor may not be accurate enough compared with the target heartbeat period determined by the plurality of factors, which ultimately results in determining that the first internet of things device is in an online state or an offline state.
In one possible implementation manner, the device gateway on the internet of things platform may accept information about the internet of things device sent by the first internet of things device, and illustratively, the information about the first internet of things device may be sent by a CoAP protocol. And then the device gateway receives the CoAP protocol and analyzes the CoAP protocol, so that the related information of the first internet of things is obtained, and the related information of the first internet of things can be sent through other protocols.
After the device gateway obtains the related information of the first internet of things device, the device shadow can be called, and then the device shadow inquires a target heartbeat period in the current scene from the device heartbeat database.
S330, the Internet of things platform sends a target heartbeat cycle to the first Internet of things device.
S340, the first Internet of things device sends first heartbeat data to the Internet of things platform according to the target heartbeat cycle.
In the embodiment of the application, after the internet of things platform determines the target heartbeat cycle based on the related information of the first internet of things device, the internet of things device also needs to return the target heartbeat cycle to the first internet of things device, so that the first internet of things device can send heartbeat data based on the target heartbeat cycle.
And after the first Internet of things equipment receives the target heartbeat period sent by the Internet of things platform, sending first heartbeat data to the physical network platform according to the target heartbeat period.
S350, when the Internet of things platform does not receive the first heartbeat data in the target heartbeat period, sending second heartbeat data to the first Internet of things device.
It should be understood that, under normal circumstances, the first internet of things device may keep the TCP link active according to the first heartbeat data sent by the internet of things platform at the timing of the target heartbeat period, and then the internet of things platform may receive the first heartbeat data in the target heartbeat period.
However, when the heartbeat data in the target period do not arrive at the internet of things platform on time due to the abnormality in the data link, the internet of things platform does not receive the heartbeat data in the target heartbeat period, and the internet of things platform can actively send second heartbeat data to the first internet of things device, and the validity of connection is detected, so that the first internet of things device is judged to be in an offline state.
Optionally, as a possible implementation manner, before the internet of things platform sends the second heartbeat data to the first internet of things device, the internet of things platform may determine, based on the related information of the first internet of things device, whether the first internet of things device starts the heartbeat active detection mechanism, and under the condition that the first internet of things device starts the heartbeat active detection mechanism, send the second heartbeat data to the first internet of things device again.
Specifically, after the first internet of things device sends the relevant information of the first internet of things device to the internet of things platform, the internet of things platform searches for whether the internet of things device starts a heartbeat active detection mechanism in different scenes in the device heartbeat database based on the relevant information of the first internet of things device.
It should be understood that the device heartbeat database has a mass data management capability, and includes, in addition to a target heartbeat detection period when the device information of the internet of things device is different, when the region information of the internet of things device is different, or when the network information of the internet of things device is different, whether the internet of things device starts a heartbeat active detection mechanism in different scenes. When the internet of things platform determines whether to start the heartbeat detection mechanism based on the related information of the internet of things equipment, the internet of things platform can store whether to start the heartbeat detection mechanism, and when the internet of things platform does not receive the first heartbeat data sent by the internet of things equipment in the target heartbeat period, whether to start the heartbeat active detection mechanism is determined, and under the condition that the heartbeat active detection mechanism is started, the second heartbeat data is sent to the first internet of things equipment, the validity of connection is detected, and therefore the first internet of things equipment is judged to be in an offline state.
For example: the device heartbeat database comprises: when the equipment information of the physical network equipment is an intelligent desk lamp with plug-in type, the network connected with the Internet of things equipment is a telecommunication network, and the region where the Internet of things equipment is located is western security, the heartbeat cycle of the Internet of things equipment is 1min, and an active heartbeat detection mechanism needs to be started.
It should be noted that, the internet of things platform may determine whether the first internet of things device is in a weak network based on the related information of the first internet of things device, and when the first internet of things device is in the weak network, the possibility of packet loss of the device is indicated to be greater, so that a heartbeat active detection mechanism needs to be started. When the first internet of things device is in the strong network, the device may not start the heartbeat active detection mechanism because the device is less likely to lose packets when in the strong network. Therefore, even when the internet of things platform does not receive the first heartbeat data sent by the first internet of things device in the target heartbeat period, the internet of things platform does not need to send the second heartbeat data, because the internet of things platform determines that the device has less possibility of packet loss based on the related information of the first internet of things device, the connection can be automatically restored after a period of time.
S360, judging whether the first Internet of things equipment is in an online state or an offline state according to the second heartbeat data sending result.
It is understood that when the internet of things platform sends the second heartbeat data to the first internet of things device, the first internet of things device is indicated to keep on line, and when the internet of things platform fails to send the second heartbeat data to the first internet of things device, the first internet of things device is indicated to be off line.
It should be noted that, when a plurality of internet of things devices are connected on the internet of things platform and the plurality of internet of things devices all need to start the active heartbeat detection mechanism, the internet of things platform can select the internet of things device which needs to send heartbeat data in the current state in an algorithm mode, so that resource consumption is reduced.
In one possible implementation manner, when heartbeat data sent by the first internet of things Device to the internet of things platform is lost due to a network between the first internet of things Device and the physical network platform, the Device gateway micro-service on the internet of things platform acquires the last heartbeat time of the first internet of things Device and a Device identifier (Device ID) of the internet of things Device and reports the last heartbeat time to the Device shadow micro-service on the internet of things platform. It should be understood that the Device ID is an identifier given by the internet of things platform to each internet of things Device connected to the internet of things platform.
Further, the Device shadow micro-service queries a connection image of the internet of things Device in a Device heartbeat database according to the Device ID of the first internet of things Device, if the last heartbeat time is longer than the heartbeat timeout time, queries whether the internet of things Device starts a heartbeat active detection mechanism, and if the first internet of things Device starts the heartbeat active detection mechanism, the Device gateway micro-service actively initiates a heartbeat detection signaling of connection effectiveness to the internet of things Device.
When the heartbeat data transmission of the equipment gateway micro-service to the first Internet of things equipment is successful, the first Internet of things equipment is indicated to keep on line, and when the heartbeat data transmission of the equipment gateway micro-service to the first Internet of things equipment is failed, the first Internet of things equipment is indicated to be offline.
And finally, the device gateway micro service updates the offline state of the Internet of things device to the device shadow micro service according to the active detection result, if the Internet of things device is disconnected, the connection resource is released, and if the Internet of things device is online, the connection resource is maintained.
S370, the Internet of things platform updates the first Internet of things device to the terminal device in an offline state.
And finally, the real state of the Internet of things equipment is displayed to an application program of the terminal equipment held by the user by the Internet of things platform, and the user can conveniently and rapidly know the offline state of the Internet of things equipment through the application program on the terminal equipment.
Specifically, when the internet of things platform judges that the internet of things device is online, the online state of the internet of things device is updated to the terminal device. When the Internet of things platform judges that the Internet of things equipment is offline, the offline state of the Internet of things equipment is updated to the terminal equipment, so that a user can conveniently know the offline state of the Internet of things equipment.
According to the method for detecting the heartbeat of the Internet of things, which is provided by the application, the platform of the Internet of things can be based on the related information of the equipment of the Internet of things, and the related information comprises one or more of the following items: the method comprises the steps of determining a target heartbeat period of terminal equipment and whether an active detection mechanism is started and stored according to the type of the Internet of things equipment, region information of the Internet of things equipment or network information of the Internet of things equipment, and judging whether the Internet of things equipment is on line or not by the active detection mechanism when the Internet of things platform does not receive the heartbeat data of the terminal equipment in the target heartbeat period, and judging that the Internet of things equipment is off-line without waiting for timeout time, so that the detection rate of the Internet of things equipment in the off-line state is improved.
It should be noted that, in the method 300, when the first internet of things device does not receive the first heartbeat data in the target heartbeat period, the internet of things platform sends the second heartbeat data to the first internet of things device, and of course, the internet of things platform may also send the second heartbeat data to the first internet of things device when the first heartbeat data sent by the first internet of things device is not received in a preset time length after the last heartbeat data is received; that is, the preset time length may be the target heartbeat period or other time lengths, for example, a factory heartbeat period of the first internet of things device. The embodiment of the present application is not limited in this regard.
The heartbeat detection method of the internet of things device is illustrated by taking a terminal device as a smart phone, a first internet of things device as an intelligent socket (model: a Bo-Union intelligent socket mini-HL) and an internet of things platform as an IOT cloud platform as examples in combination with fig. 4 and 5. Fig. 4 is a schematic flow chart of another example of a heartbeat detection method 400 of an internet of things device according to an embodiment of the present application, and fig. 5 is a schematic interface diagram of another example of heartbeat detection of an internet of things device.
As shown in fig. 4, the method 400 includes S410-S491:
S410, network synchronization of the smart phone and the smart socket.
A user may add an internet of things device through the smart APP, for example, by SoftAP to find a smart socket.
The Soft wireless Access Point (AP) is a technology for realizing the AP function on a smart phone by using special software through a wireless network card, and can replace the AP in a wireless network so as to reduce the cost of wireless networking.
After the APP searches the smart jack, the name and the password of the current WiFi service set identifier (SERVICE SET IDENTIFIER, SSID) are transmitted to the smart jack through the network, so that the network of the smart phone and the smart jack is synchronized.
Step S410 may refer to the interface shown in (a) of fig. 5-the interface shown in (d) of fig. 5, as shown in (a) of fig. 5, after the smart phone receives the click operation of the user, the smart phone opens the smart life APP, the user clicks the add device component on the smart life APP interface, in response to the click operation of the add device by the user, the smart phone interface switches to the interface shown in (b) of fig. 5, as shown in (b) of fig. 5, and reminds "please ensure that the internet of things device is connected to a power supply and is located near the mobile phone" on the display interface, when the internet of things device near the smart life APP scans, the internet of things device can be found based on the wireless network, and also the internet of things device can be found by manually adding or code sweeping adding.
After the APP searches the intelligent socket of the network to be distributed, the intelligent mobile phone interface is switched to the interface of the diagram (c) in fig. 5, and as shown in the diagram (c) in fig. 5, the intelligent socket icon and the intelligent socket name are the Bolian intelligent socket mini-HL are displayed on the interface, and a user can click an adding component on the interface to connect. When the APP is connected to the smart jack of the network to be configured, the network needs to be connected to the smart jack, the smart phone interface is switched to the interface of the (d) diagram in fig. 5, and as shown in the (d) diagram in fig. 5, options such as network setting, network selection, and password are displayed on the interface, and the user can click on the selected network to transmit the current service set identifier SSID name and password of the WiFi to the smart jack through the network.
S420, the intelligent socket reports relevant information of the intelligent socket to a device gateway, wherein the relevant information comprises one or more of the following: the device information of the intelligent socket, the region information of the intelligent socket and the network information of the intelligent socket.
When the intelligent socket networking is successful, related information of the intelligent socket is firstly required to be reported to a device gateway on the IOT cloud platform.
The related information includes one or more of the following: the device information of the intelligent socket, the region information of the intelligent socket and the network information of the intelligent socket. Illustratively, the relevant information of the smart socket in step S420 may be device information of the smart socket and network information of the smart socket.
Step S420 may refer to the interface shown in (e) diagram in fig. 5-the interface shown in (g) diagram in fig. 5, as shown in (e) diagram in fig. 5, the smart socket successfully checks the current network information, and as shown in (f) diagram in fig. 5, the smart socket checks the current device information, and reports the device information and the network information to the device gateway micro-service on the IOT cloud platform through the CoAP protocol, and maintains a long connection with the IOT cloud platform through the device gateway micro-service. As shown in the (g) diagram of fig. 5, the smart jack can be seen on the smart phone interface in an on-line state and can be timed and counted down by the APP.
It should be understood that in the example of fig. 5, the internet of things device connected to the smart phone through the smart life APP is a smart desk lamp, and of course, other internet of things devices may be bound in the smart life APP. For example: as shown in fig. 5 (g), a mosquito killer or a fish lamp, etc.
And S430, the device gateway reports the relevant information of the intelligent socket to the device shadow.
And the device gateway micro-service on the IOT cloud platform analyzes the CoAP protocol, analyzes the device information and the network information of the intelligent socket, and invokes the device shadow micro-service.
S440, the device shadow calls a device heartbeat database to inquire a target heartbeat period of the intelligent socket and whether an active detection mechanism is started.
The device shadow micro-service queries a target heartbeat period suitable for the intelligent socket in the current scene in a device heartbeat database and whether to start a heartbeat active detection mechanism.
It should be understood that, in the current scenario, the device information of the smart jack and the network information of the smart jack may be specifically referred to the description in step S320, and will not be described herein.
S450, the device shadow sends the inquired target heartbeat cycle of the intelligent socket to the device gateway or not when the active detection mechanism is started.
S460, the device gateway sends the target heartbeat cycle to the intelligent socket.
And returning the inquired target heartbeat cycle to the Internet of things equipment, keeping long connection between the intelligent socket and the Internet of things platform, and keeping message communication with the equipment gateway according to the heartbeat cycle returned by the Internet of things platform. And displaying the inquired heartbeat period and whether to start an active detection mechanism on the intelligent life APP for the user to inquire.
And S470, the intelligent socket sends the first heartbeat data to the equipment gateway based on the target heartbeat cycle.
And S480, when the equipment gateway does not receive the heartbeat data packet in the target heartbeat period, the equipment gateway inquires the last time of sending the heartbeat packet by the intelligent socket.
And S490, if the heartbeat is overtime, the device shadow inquires whether to start a heartbeat initiative detection mechanism in a device heartbeat database.
And S491, when the intelligent socket starts the heartbeat active detection mechanism, the equipment gateway actively transmits second heartbeat data to the intelligent socket, when the second heartbeat data packet is successfully transmitted, the intelligent socket is in an on-line state, and when the second heartbeat data packet is not successfully transmitted, the intelligent socket is in an off-line state.
The user can check whether the intelligent platform side is started or not and how much the device heartbeat cycle is through the APP. As shown in the (h) diagram in fig. 5, after a user clicks the intelligent platform side active detection component on the APP, the interface shown in the (h) diagram in fig. 5 is switched to the interface shown in the (i) diagram in fig. 5, and the active detection mechanism of the internet of things equipment side and the heartbeat cycle of the intelligent socket are displayed on the interface shown in the (i) diagram in fig. 5 for 50s.
Fig. 6 shows an interface schematic diagram of an intelligent socket on an APP in an offline state, when an heartbeat data packet sent by the intelligent socket to the IOT cloud platform is overtime, the IOT cloud platform actively sends the heartbeat data packet to the intelligent socket to actively detect the intelligent socket in the offline state, when the heartbeat data packet sent by the IOT cloud platform fails, the intelligent socket is indicated to be in the offline state, as shown in the (a) diagram in fig. 6, a switch icon of the intelligent socket indicated by a dotted line is not turned on, when the heartbeat data packet sent by the IOT cloud platform succeeds, the intelligent socket is indicated to be in the online state, as shown in the (b) diagram in fig. 6, the switch icon of the intelligent socket indicated by the dotted line is turned on, and a user can quickly acquire the intelligent socket in the offline state on the APP.
In summary, fig. 4 to fig. 6 specifically describe that after the intelligent socket reports relevant information of the intelligent socket to the IOT cloud platform, the IOT cloud platform determines, based on the relevant information of the intelligent socket, a target heartbeat period of the intelligent socket in a current scenario and whether to start a heartbeat active detection mechanism, and sends the target heartbeat period to the intelligent socket, the intelligent socket keeps heartbeat connection with the IOT cloud platform based on the target heartbeat period, when the IOT cloud platform does not receive first heartbeat data sent by the intelligent socket in the target heartbeat period, and the IOT cloud platform detects that the intelligent socket needs to start the heartbeat active detection mechanism, the IOT cloud platform actively sends second heartbeat data to the intelligent socket, when the second heartbeat data is sent successfully, the IOT cloud platform indicates that the intelligent socket is in an online state, and when the second heartbeat data is sent failed, the IOT cloud platform indicates that the intelligent socket is in an offline state. According to the method, the IOT cloud platform actively transmits the heartbeat data after not receiving the heartbeat data, so that the offline state of the intelligent socket can be rapidly acquired, the offline state of the intelligent socket is judged without waiting for the timeout time (3 heartbeat cycles), and the accuracy of judging the offline state of the intelligent socket is improved.
In the method for detecting the heartbeat of the equipment of the Internet of things, the equipment heartbeat database can be updated, for example, according to the equipment information of the Internet of things which is automatically set by a user, the equipment information of the Internet of things in the equipment heartbeat database is updated in real time.
Specifically, the user can autonomously set the heartbeat cycle of the internet of things device on the terminal device and whether to start the heartbeat active detection mechanism, and the internet of things platform sends a request to the internet of things device according to the heartbeat cycle of the internet of things device set in the terminal device and whether to start the heartbeat active mechanism, wherein the request is used for requesting related information of the internet of things device, and the related information comprises one or more of the following items: the method comprises the steps that equipment information of the Internet of things equipment, region information where the Internet of things equipment is located and network information of the Internet of things equipment, the Internet of things equipment sends relevant information of the Internet of things equipment to an Internet of things platform based on a request of the Internet of things platform, and then the Internet of things platform updates the portrait of the Internet of things equipment in the Internet of things platform based on the relevant information of the Internet of things equipment, a heartbeat period of the Internet of things equipment and whether a heartbeat active detection mechanism is started or not.
The method for updating the heartbeat database of the equipment provided by the embodiment of the application is described in detail below with reference to the accompanying drawings.
It will be appreciated that updating the device heartbeat database includes two meanings: the first method refers to that related information of a certain internet of things device does not exist in the device heartbeat database, and then the types of the internet of things device in the device heartbeat database can be expanded based on the following method. The second means that the related information of a certain internet of things device originally exists in the heartbeat database is set, and then the related information of the internet of things device can be updated based on the following method.
Fig. 7 is a schematic flow chart diagram illustrating a method 700 of updating a device heartbeat database provided by an embodiment of the present application from a device interaction perspective. As shown in fig. 7, the method 700 shown in fig. 7 may include steps S710 to S750. The various steps in method 700 are described in detail below in conjunction with fig. 7.
It should be understood that, in the embodiment of the present application, the method 700 is described by taking the internet of things platform, the internet of things device, and the terminal device as the execution bodies of the execution method 700. By way of example, but not limitation, the execution subject of the execution method 700 may also be a chip applied in an internet of things platform, an internet of things device, and a terminal device.
S710, the terminal equipment acquires a heartbeat period of the second internet equipment set by the user and whether an active detection mechanism is started.
It should be noted that the second internet of things device is any one of a plurality of internet of things devices communicatively connected to the internet of things platform. The second internet of things device may be the same device as the first internet of things device, or may be a different device from the first internet of things device.
In the embodiment of the application, the user can set the heartbeat cycle of the Internet of things device on the terminal device according to the self requirement or the environment where the second Internet of things device is located, and whether to start the active detection mechanism.
For example, when the second internet device is an intelligent sweeping robot, the user wants to ensure whether the intelligent sweeping robot is always in a sweeping state, for a shorter heartbeat period can be set, and an active detection mechanism is started, so that the user can be basically guaranteed to know that the intelligent sweeping robot is in an offline state at the first time.
For example, when the second internet device is an intelligent desk lamp with a lithium battery, and the area where the intelligent desk lamp is located and the connected network state are good, the user can properly set a longer heartbeat cycle and does not need to start the heartbeat active detection mechanism in order to reduce the power consumption of the intelligent desk lamp.
In some embodiments, the terminal device may select an internet of things device to be set, and the terminal device may further obtain state data of the internet of things device stored on the internet of things platform. And then, the terminal equipment stores the heartbeat cycle and the active detection mechanism of the Internet of things equipment set by the user in the current state data in a personalized way.
Optionally, an application program installed on the terminal device may select an internet of things device to be set, and obtain, through the application program on the terminal device, state data of the internet of things device stored in a device shadow on the internet of things platform. Then, the application program on the terminal equipment sets the heartbeat cycle and the active detection mechanism of the Internet of things equipment according to the individuation in the current state data.
S720, the internet of things platform sends a request message to the second internet of things device based on information set by a user on the terminal device, wherein the request message is used for requesting related information of the second internet of things device, and the related information comprises one or more of the following: device information of the second internet-of-things device, region information in which the second internet-of-things device is located, or network information of the second internet-of-things device.
In one possible implementation manner, the terminal device may upload the heartbeat cycle of the internet of things set by the user and whether to start the heartbeat active detection mechanism to the device shadow micro-service on the platform of the internet of things.
Furthermore, the device shadow micro-service can synchronously update the heartbeat period of the second internet-connected device and whether to start the heartbeat initiative detection mechanism into the device heartbeat database.
After the internet of things platform obtains the heartbeat cycle of the internet of things device set on the terminal device and whether to start the active detection mechanism, the internet of things platform needs to obtain the type information of the second internet of things device, the region information where the second internet of things device is located or the network information of the second internet of things device, so that the information of the second internet of things device in the device heartbeat database is perfected, and therefore the internet of things platform can send a request message to the second internet of things device, and the message is used for requesting the second internet of things device to report the related information of the internet of things.
S730, the second internet of things device sends relevant information of the second internet of things device to the internet of things platform based on the request message of the internet of things platform.
And after the second internet of things device receives the request message sent by the internet of things platform, the second internet of things device sends the related information of the second internet of things device to the internet of things platform.
The related information includes one or more of the following: device information of the second internet-of-things device, region information in which the second internet-of-things device is located, or network information of the second internet-of-things device.
And S740, the internet of things platform updates the information of the internet of things device in the device heartbeat database according to the related information sent by the second internet of things device, the heartbeat period of the second internet of things device and whether to start an active detection mechanism.
And finally, the internet of things platform updates the information of the internet of things in the equipment heartbeat database based on the received related information sent by the second internet of things equipment, the heartbeat period of the internet of things equipment stored on the internet of things platform and set by the user, and whether an active detection mechanism is started.
And S750, when the heartbeat cycle of the second internet of things device in the internet of things platform is changed, the internet of things platform sends the updated heartbeat cycle to the second internet of things device.
When the second internet of things device and the first internet of things device are the same devices, based on the setting information of the user, the heartbeat period of the second internet of things device in the internet of things platform is changed, and then the internet of things platform can send the updated heartbeat period to the second internet of things device, so that the second internet of things device is in communication connection with the internet of things platform based on the heartbeat period set by the user.
In some embodiments, when the originally stored heartbeat period of the second internet of things device in the device heartbeat database changes, the device shadow micro-service in the internet of things platform issues the latest heartbeat period of the internet of things device to the device gateway micro-service in the internet of things platform.
Further, the device gateway microservice transmits the latest heartbeat cycle of the internet of things device to the internet of things device through the CoAP protocol, and the internet of things device can be kept connected with the internet of things platform according to the latest heartbeat cycle.
According to the method for updating the equipment heartbeat database provided by the method 700, the relevant information of the equipment of the Internet of things in the equipment heartbeat database can be expanded based on the autonomous setting of the user, or the heartbeat period of the equipment of the Internet of things can be updated based on the autonomous setting of the user and whether the active detection mechanism is started, so that personalized setting of the equipment of the Internet of things can be realized, more heartbeat periods of the equipment of the Internet of things in different scenes can be collected and whether the active detection mechanism is started or not in the mode, and then when the platform of the Internet of things returns the target heartbeat period from the equipment heartbeat database to the equipment of the Internet of things, the data are more accurate, and the accuracy of the detection of the equipment of the Internet of things in an offline state is further improved.
The method for updating the heartbeat database of the equipment is illustrated by taking a terminal equipment as a smart phone, an internet of things equipment as an intelligent socket (model: a Bo-Union intelligent socket mini-HL) and an internet of things platform as an IOT cloud platform as examples with reference to fig. 8 and 9. Fig. 8 is a schematic flow chart of another method 800 for updating a device heartbeat database, and fig. 9 is a schematic diagram of an interface for user-personalized setting of parameters of a smart jack.
As shown in fig. 8, the method 800 includes S810-S891:
S810, the smart phone sends query information to the shadow of the device, wherein the query information is used for querying the current state of the smart socket.
After the user selects the intelligent socket equipment with online distribution network through the intelligent life APP, the intelligent mobile phone sends query information to the equipment shadow on the equipment IOT cloud platform, and the query information is used for querying the current state of the intelligent socket equipment.
The device shadow returns state data of the intelligent socket device to the intelligent mobile phone based on query information sent by the intelligent mobile phone.
S820, the smart phone acquires a heartbeat period set by a user and whether to start a heartbeat active detection mechanism.
And the user sets the heartbeat cycle and the active detection mechanism of the intelligent socket device on the device detail page in a personalized way.
As shown in fig. 9 (a), after a user selects a smart socket device with online distribution through a smart life APP, the smart phone interface is switched from the interface shown in fig. 9 (a) to the interface shown in fig. 9 (b), the interface shown in fig. 9 (b) is a device detail page, a setup button is set in the upper right corner of the device detail page in a personalized manner, after the user clicks the personalized setup button, the smart phone interface is switched from the interface shown in fig. 9 (b) to the interface shown in fig. 9 (c), the interface shown in fig. 9 (c) is a setup interface, and after the user clicks the cloud-side active detection button, the smart phone interface is switched from the interface shown in fig. 9 (c) to the interface shown in fig. 9 (d), the interface shown in fig. 9 (d) is a setup interface for cloud-side active detection, on which the user can set a cloud-side active detection state and a heartbeat period of the device.
For example, the cloud side active detection state set by the user is on, and the heartbeat period of the set device is 120s.
S830, the smart phone sends a heartbeat period set by a user to the shadow of the device and whether to start a heartbeat initiative detection mechanism.
After acquiring the heartbeat period set by the user and whether the cloud side starts a heartbeat active detection mechanism, the intelligent mobile phone sends the information to the shadow micro-service of the equipment of the IOT cloud platform.
And S840, the device gateway sends request information to the intelligent socket, wherein the request information is used for requesting related information of the intelligent socket.
After the IOT cloud platform receives the heartbeat cycle set by the user and whether the cloud side starts the heartbeat active detection mechanism, related information of the smart socket needs to be acquired, so that a device gateway on the IOT cloud platform sends request information to the smart socket, and the request information is used for requesting the related information of the smart socket.
S850, the intelligent socket sends relevant information of the intelligent socket to the equipment gateway based on the request information.
After receiving the request information sent by the equipment gateway, the intelligent socket sends at least one of equipment information of the intelligent socket, region information of the intelligent socket or network information of the intelligent socket to the equipment gateway.
S860, the device gateway sends information about the smart socket to the device shadow.
And S870, the device shadow updates the heartbeat period of the user device, whether to start a heartbeat initiative detection mechanism and related information of the intelligent socket to a device heartbeat database.
Based on the received related information sent by the intelligent socket, the heartbeat period of the intelligent socket set by the user and whether an active detection mechanism is started, the IOT cloud platform updates the information of the intelligent socket in the equipment heartbeat database.
S880, the device shadow sends the heartbeat cycle set by the user to the gateway device.
And S890, the gateway equipment sends the heartbeat cycle set by the user to the intelligent socket.
S891, the intelligent socket is connected with the equipment gateway in a heartbeat mode based on a heartbeat period set by a user.
The IOT cloud platform sends the heartbeat period set by the user to the IOT equipment, so that the IOT equipment can keep heartbeat connection with the IOT cloud platform based on the heartbeat period set by the user.
In summary, fig. 8-9 specifically describe that the smart socket may expand relevant information of the smart socket in the device heartbeat database based on the autonomous setting of the user, or may update the heartbeat cycle of the smart socket and whether to start the active detection mechanism based on the autonomous setting of the user, so that personalized setting of the smart socket may be implemented, and by this way, more heartbeat cycles of the smart socket in different scenes may be collected and whether to start the active detection mechanism may be started, so that the data of the smart socket when the smart socket returns the target heartbeat cycle from the device heartbeat database to the internet of things device is more accurate, thereby further improving the accuracy of offline state detection of the internet of things device.
It should be understood that the above description is only intended to assist those skilled in the art in better understanding the embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application. It will be apparent to those skilled in the art from the foregoing examples that various equivalent modifications or variations are possible, for example, some steps of the methods described above may not be necessary, or some steps may be newly added, etc. Or a combination of any two or more of the above. Such modifications, variations, or combinations are also within the scope of embodiments of the present application.
It should also be understood that the manner, the case, the category, and the division of the embodiments in the embodiments of the present application are merely for convenience of description, should not be construed as a particular limitation, and the features in the various manners, the categories, the cases, and the embodiments may be combined without contradiction.
It should also be understood that the various numbers referred to in the embodiments of the present application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of the present application. The sequence numbers of the above-mentioned processes do not mean the sequence of execution sequence, and the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
It should also be understood that the foregoing description of embodiments of the present application focuses on highlighting differences between the various embodiments and that the same or similar elements not mentioned may be referred to each other and are not repeated herein for brevity.
The embodiment of the method for detecting the heartbeat of the internet of things device according to the embodiment of the present application is described above with reference to fig. 3 to fig. 9, and the system for detecting the heartbeat of the internet of things device according to the embodiment of the present application is described below, and fig. 10 shows a schematic diagram of an example of the system for detecting the heartbeat of the internet of things device according to the embodiment of the present application, where the system for detecting the heartbeat of the internet of things device shown in the drawing includes: terminal equipment, thing networking cloud platform and thing networking equipment.
The terminal device comprises: the application APP (Application) interacts with the internet of things platform through an interface provided by the internet of things platform, and issues a control instruction or receives device data forwarded by the platform. By way of example, the application APP (Application) may be a smart life APP running on a User's terminal device, receiving User instructions through a User Interface (UI), and presenting the User with the internet of things device in an offline state.
The platform of thing networking includes: IOT Core Service (IOT Core Service) and IOT ANALYTICS SERVICE (IOT data Service).
Wherein, the IOT core service comprises: device shadow, rules engine, device registry, device authentication, device gateway, message broker, etc.
Device shadow: each device has only one device shadow, and the device can acquire and set the device shadow through the MQTT to synchronize the state, and is used for storing the device reporting state and the configuration expected to be issued by the application program, and decoupling is applied to the terminal device. The method is generally used for scenes such as unstable network, incapability of real-time communication of devices, repeated request of one device at the same time and the like. In the embodiment of the application, the device shadow is responsible for mirroring local state data of the Internet of things device on the Internet of things platform, wherein the mirroring comprises a switching state, an off-line state and the like of the Internet of things device.
Rule engine: the method is that a user can configure certain rules on the platform of the Internet of things, and after judging that the conditions meet the rules, the platform can execute corresponding actions to meet the user requirements, and customized business scenes such as scene linkage, alarm and the like are flexibly constructed.
And (3) a device gateway: and supports MQTT, coAP, HTTP (HyperText Transfer Protocol), HTTP2 and other multi-protocol access. In the embodiment of the application, the device is responsible for maintaining a long connection channel with the Internet of things device, carrying the heartbeat processing of the Internet of things device, the maintenance of device connection and the like.
The MQTT is a message publishing/subscribing transmission protocol based on a client-server, can keep long connection and realizes multi-to-multi asynchronous communication; coAP: the method is a client-server single-to-single protocol and has the characteristics of light weight and low power consumption.
The message broker includes: publishers (publishers), proxies (Broker) and subscribers (subscribers) in the MQTT protocol. Wherein, the publisher and subscriber of the message are clients, the message proxy is a server, and the message publisher can be subscriber at the same time. The MQTT client can publish information, subscribe information, unsubscribe or delete information and disconnect the connection with the server; the MQTT server may receive the network connection of the client, the information published by the client, the subscription and unsubscribe requests of the client, and forward the message subscribed by the client.
The IOT data service comprises: internet of things device AIOps data collection (device reporting specification), internet of things device WiseData data collection (device reporting specification), device behavior portraits, device connection portraits, and device Profile specification.
The equipment is connected with the portrait: the device connection portrait is mainly used for describing related information of connected devices. For example, the device connection image of the smart socket may include device information of the smart socket, region information where the smart socket is located, network information of the smart socket, and a heartbeat period of the internet of things device, whether to start a heartbeat active detection mechanism, and the like.
Device Profile specification: developed (written) by the user to describe the capabilities and features that the access device possesses. By defining the Profile, the user builds an abstract model corresponding to the equipment on the platform of the internet of things, so that the platform can understand information (namely equipment capability) such as services, attributes, commands and the like supported by the equipment.
The internet of things device comprises: edge computing, hiLink module level device access specifications, device software development kits (Software Development Kit, SDKs), auspicious cloud capability clients SDKs.
Edge calculation: the devices used to acquire and analyze information cannot always be network or application dependent and if one of them becomes problematic, the entire system will fail. For this reason, such devices offer a different capability, namely edge computing functionality, namely the capability of analyzing the process at the edge of the solution (i.e. the device itself), which allows the device to perform some operations and computations in an off-line state without requiring a connection to the network.
HiLink module-level device access specifications include: wireless short-range lan communications such as: BT/BLE, wifi, zigBee, eMTC, wireless long range wide area network communication: NB-IOT, 2G/3G/4G, LTE-V, etc., and the Internet of things equipment interacts with the Internet of things platform through the networks.
The device SDK includes: c SDK, JS SDK, and Mobile SDK.
Client SDK: typically, a software engineer builds a set of development tools for application software for a particular software package, software framework, hardware platform, operating system, etc., such as: C/C++, JAVA, DNKeeper, GRS, etc.
According to the method, the terminal equipment, the Internet of things platform and the Internet of things equipment can be divided into functional modules. For example, each function may be divided into each functional module, or two or more functions may be integrated into one processing module. The integrated modules described above may be implemented in hardware. It should be noted that, in this embodiment, the division of the modules is schematic, only one logic function is divided, and another division manner may be implemented in actual implementation.
It should be noted that, the relevant content of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
The platform and the device for the internet of things provided by the embodiment of the application are used for executing any method for detecting the heartbeat of the device for the internet of things provided by the embodiment of the method, so that the same effect as the implementation method can be achieved. In the case of employing an integrated unit, the internet of things platform or the internet of things device may include a processing module, a storage module, and a communication module. The processing module can be used for controlling and managing actions of the Internet of things platform or the Internet of things equipment. For example, the method may be used for supporting the internet of things platform or the internet of things device to execute the steps executed by the processing unit. Memory modules may be used to support storage of program code, data, and the like. And the communication module can be used for supporting communication between the Internet of things platform or the Internet of things equipment and other equipment.
Wherein the processing module may be a processor or a controller. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital Signal Processing (DSP) and a combination of microprocessors, and the like. The memory module may be a memory. The communication module can be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip and other equipment which interact with other electronic equipment.
Fig. 11 is a schematic block diagram of a communication apparatus 1100 according to an embodiment of the present application, where the communication apparatus 1100 may correspond to the internet of things platform, the internet of things device, or be applied to a chip or a component of the internet of things platform and the internet of things device described in each embodiment of the method 300 to the method 800, and each module or unit in the communication apparatus 1100 is configured to perform each action or process performed by the internet of things platform and the internet of things device described in each embodiment of the method 300 to the method 800, respectively.
As shown in fig. 11, the communication apparatus 1100 includes a transceiving unit 1110 and a processing unit 1120. The transceiver 1110 is configured to perform specific signal transceiving under the driving of the processing unit 1120.
In some embodiments:
The transceiver unit 1110: and the second heartbeat data is sent to the first Internet of things equipment when the first heartbeat data sent by the first Internet of things equipment is not received by the Internet of things platform within the preset time length after the last heartbeat data is received.
Processing unit 1120: and the method is used for determining that the first Internet of things equipment is in an online state or an offline state according to the second heartbeat data transmission result, and the first Internet of things equipment is in the online state when the second heartbeat data transmission is successful and in the offline state when the second heartbeat data transmission is failed.
According to the communication device provided by the application, when the first heartbeat period sent by the first Internet of things equipment is not received in the heartbeat period, the first Internet of things equipment is not required to be in an online state or an offline state after waiting for a timeout period (three heartbeat periods) as in the prior art, but the second heartbeat data is actively sent to the first Internet of things equipment, when the second heartbeat data can be sent successfully, the first Internet of things equipment is online, and when the second heartbeat data is sent successfully, the second Internet of things equipment is offline, so that the first Internet of things equipment can be determined in the offline state at the first time under the condition that the first Internet of things equipment loses packets, and the accuracy rate of online state detection of the Internet of things equipment is improved.
Optionally, the transceiver unit 1110: the method is also used for acquiring related information of the first Internet of things device, wherein the related information comprises one or more of the following: the method comprises the steps of equipment information of first Internet of things equipment, region information of the first Internet of things equipment and first Internet of things equipment network information;
Optionally, the processing unit 1120: and the target heartbeat cycle of the first Internet of things equipment is determined according to the related information of the first Internet of things equipment, the target heartbeat cycle is sent to the first Internet of things equipment, and the preset time period is the target heartbeat cycle.
Optionally, the processing unit 1120: and the heartbeat detection system is also used for determining that the first Internet of things equipment starts a heartbeat active detection mechanism according to the related information of the first Internet of things equipment.
Optionally, the processing unit 1120: and the target heartbeat period of the first Internet of things device is queried in the device heartbeat database according to the related information of the first Internet of things device.
Optionally, the processing unit 1120: and the device heartbeat database is used for inquiring the first Internet of things device to start a heartbeat active detection mechanism according to the related information of the first Internet of things device.
Optionally, the transceiver unit 1110: and the method is also used for acquiring user setting information, and the user setting information comprises the following steps: the heartbeat cycle of the second internet equipment set by the user and/or whether the second internet equipment set by the user starts an active detection mechanism;
Optionally, the processing unit 1120: the method is also used for sending request information to the second internet-of-things equipment, wherein the request information is used for requesting related information of the second internet-of-things equipment;
Optionally, the relevant information of the second internet-connected device is received, and the relevant information of the second internet-connected device and the user setting information are added to the device heartbeat database.
In some embodiments:
the transceiver unit 1110: the method comprises the steps of sending relevant information of first Internet of things equipment to an Internet of things platform, wherein the relevant information comprises one or more of the following: the method comprises the steps of equipment information of first Internet of things equipment, region information of the first Internet of things equipment and network information of the first Internet of things equipment;
Receiving a target heartbeat period sent by a first Internet of things platform, wherein the target heartbeat period is determined according to related information of first Internet of things equipment;
The method comprises the steps of sending first heartbeat data to a first Internet of things platform according to a target heartbeat period;
And receiving second heartbeat data sent by the first Internet of things platform, wherein the second heartbeat data is sent when the first heartbeat data is not received by the Internet of things platform in a target period.
According to the communication device provided by the application, the heartbeat period suitable for the first Internet of things equipment in the scene can be determined by sending the related information of the first Internet of things equipment to the Internet of things platform, the first Internet of things equipment sends the heartbeat data to the Internet of things platform based on the target heartbeat period, and when the Internet of things platform does not receive the first heartbeat data sent by the first Internet of things equipment in the target heartbeat period, the second heartbeat data is sent to the first Internet of things equipment, so that the waste of air interface resources is avoided, and the equipment power consumption is reduced.
Optionally, the transceiver unit 1110: and the first heartbeat data receiving module is also used for receiving the second heartbeat data sent by the internet of things platform when the first internet of things device starts the active detection mechanism.
Optionally, the transceiver unit 1110: the method is also used for receiving request information sent by the Internet of things platform, the request information is used for requesting related information of second Internet of things equipment, and the related information of the second Internet of things equipment comprises one or more of the following items: device information of the second internet-of-things device, region information of the second internet-of-things device, and network information of the second internet-of-things device;
Optionally, the transceiver unit 1110: and the method is also used for sending the related information of the second internet of things device to the internet of things platform based on the request information.
Further, the communication device 1100 may further include a storage unit, and the transceiver unit 1110 may be a transceiver, an input/output interface, or an interface circuit. The storage unit is used for storing instructions executed by the transceiver unit 1110 and the processing unit 1120. The transceiver unit 1110, the processing unit 1120, and the storage unit are coupled to each other, the storage unit stores instructions, the processing unit 1120 is configured to execute the instructions stored in the storage unit, and the transceiver unit 1110 is configured to perform specific signal transceiving under the driving of the processing unit 1120.
It should be appreciated that, for the specific process of executing the above corresponding steps by each unit in the communication apparatus 1100, reference is made to the foregoing descriptions related to the internet of things device and the internet of things platform in connection with the methods 300 to 800 and the related embodiments in fig. 3 to 8, and for brevity, the description is omitted here.
It is to be understood that the transceiver unit 1110 may be a transceiver, an input/output interface, or an interface circuit. The memory unit may be a memory. The processing unit 1120 may be implemented by a processor. Fig. 12 shows a schematic block diagram of another example communication apparatus 1200 provided by an embodiment of the present application. As shown in fig. 12, the communication device 1200 may include a processor 1210, a memory 1220, a transceiver 1230, and a bus system 1240. The various components of the communications device 1200 are coupled together by a bus system 1240, where the bus system 1240 may include a power bus, a control bus, a status signal bus, and the like, in addition to a data bus. But for clarity of illustration, the various buses are labeled as bus system 1240 in fig. 12. For ease of illustration, fig. 12 is only schematically drawn.
The communications apparatus 1100 shown in fig. 11 or the communications apparatus 1200 shown in fig. 12 can implement the steps performed by the internet of things device and the internet of things platform in the foregoing embodiments of the methods 300 to 800. Similar descriptions can be made with reference to the descriptions in the corresponding methods previously described. In order to avoid repetition, a description thereof is omitted.
It should also be appreciated that the communication apparatus 1100 shown in fig. 11 or the communication apparatus 1200 shown in fig. 12 may be an internet of things device or an internet of things platform.
The embodiment of the present application also provides a chip system, as shown in fig. 13, which includes at least one processor 1301 and at least one interface circuit 1302. The processor 1301 and the interface circuit 1302 may be interconnected by wires. For example, interface circuit 1302 may be used to receive signals from other devices. For another example, interface circuit 1302 may be used to send signals to other devices (e.g., processor 1301). Illustratively, the interface circuit 1302 may read instructions stored in the memory and send the instructions to the processor 1301. When executed by the processor 1301, the instructions may cause the internet of things device or the internet of things platform to perform the steps performed by any of the internet of things devices or the internet of things platform in the above embodiments. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
It should also be understood that the division of the units in the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And the units in the device can be all realized in the form of software calls through the processing element; or can be realized in hardware; it is also possible that part of the units are implemented in the form of software, which is called by the processing element, and part of the units are implemented in the form of hardware. For example, each unit may be a processing element that is set up separately, may be implemented as integrated in a certain chip of the apparatus, or may be stored in a memory in the form of a program, and the functions of the unit may be called and executed by a certain processing element of the apparatus. The processing element, which may also be referred to herein as a processor, may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each unit above may be implemented by an integrated logic circuit of hardware in a processor element or in the form of software called by a processing element. In one example, the unit in any of the above apparatuses may be one or more integrated circuits configured to implement the above methods, for example: one or more Application Specific Integrated Circuits (ASICs), or one or more digital signal processors (DIGITAL SIGNAL processors, DSPs), or one or more field programmable gate arrays (field programmable GATE ARRAY, FPGAs), or a combination of at least two of these integrated circuit forms. For another example, when the units in the apparatus may be implemented in the form of a scheduler of processing elements, the processing elements may be general-purpose processors, such as a central processing unit (central processing unit, CPU) or other processor that may invoke a program. For another example, the units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The embodiment of the application also provides a device which is contained in the Internet of things equipment or the Internet of things platform and has the function of realizing the behavior of the Internet of things equipment or the Internet of things platform in any embodiment. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes at least one module or unit corresponding to the functions described above.
The application also provides the Internet of things equipment or the Internet of things platform, which comprises the device provided by the embodiment of the application.
The embodiment of the application also provides a computer readable storage medium for storing computer program codes, and the computer program comprises instructions for executing the steps of executing the display interface in the internet of things device or the internet of things platform in any of the embodiments of the application. The readable medium may be read-only memory (ROM) or random access memory (random access memory, RAM), to which embodiments of the application are not limited.
The application also provides a computer program product comprising instructions that, when executed, cause an internet of things device or an internet of things platform to perform the step of heartbeat detection of the internet of things device in any of the embodiments described above.
The embodiment of the application also provides a chip, which comprises: a processing unit, which may be, for example, a processor, and a communication unit, which may be, for example, an input/output interface, pins or circuitry, etc. The processing unit can execute the computer instructions to enable the internet of things device or the internet of things platform to execute any one of the heartbeat detection methods of the internet of things device provided by the embodiment of the application.
Optionally, the computer instructions are stored in a storage unit.
Alternatively, the storage unit is a storage unit in the chip, such as a register, a cache, etc., and the storage unit may also be a storage unit in the terminal located outside the chip, such as a ROM or other type of static storage device that can store static information and instructions, a random RAM, etc. The processor mentioned in any of the above may be a CPU, microprocessor, ASIC, or one or more integrated circuits for controlling the execution of the program of the electronic device projection display method. The processing unit and the storage unit may be decoupled and respectively disposed on different physical devices, and the respective functions of the processing unit and the storage unit are implemented by wired or wireless connection, so as to support the system chip to implement the various functions in the foregoing embodiments. Or the processing unit and the memory may be coupled to the same device.
The internet of things device or the internet of things platform, the device, the computer readable storage medium, the computer program product or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects that can be achieved by the device or the platform, the device, the computer readable storage medium, the computer program product or the chip can refer to the beneficial effects in the corresponding method provided above, and are not repeated herein.
The embodiment of the application also provides a graphical user interface on the electronic equipment, the electronic equipment is provided with a display screen, a camera, a memory and one or more processors, the one or more processors are used for executing one or more computer programs stored in the memory, and the graphical user interface comprises the graphical user interface displayed when the electronic equipment executes the steps executed by the Internet of things equipment or the Internet of things platform in any embodiment.
It will be appreciated that the electronic device or the like may include hardware structures and/or software modules that perform the functions described above. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The embodiment of the application can divide the functional modules of the electronic device and the like according to the method example, for example, each functional module can be divided corresponding to each function, and two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely illustrative of specific embodiments of the present application, and the scope of the present application is not limited thereto, but any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. The method for detecting the heartbeat of the Internet of things equipment is characterized by being applied to an Internet of things platform, wherein the Internet of things platform is in communication connection with the Internet of things equipment, and the method comprises the following steps:
When the internet of things platform does not receive first heartbeat data sent by first internet of things equipment within a preset time length after last heartbeat data is received, sending second heartbeat data to the first internet of things equipment;
And determining that the first Internet of things equipment is in an online state or an offline state according to the second heartbeat data transmission result, wherein the first Internet of things equipment is in the online state when the second heartbeat data transmission is successful, and the first Internet of things equipment is in the offline state when the second heartbeat data transmission is failed.
2. The method according to claim 1, wherein the method further comprises:
Acquiring related information of first Internet of things equipment, wherein the related information comprises one or more of the following: the device information of the first Internet of things device, the region information of the first Internet of things device and the network information of the first Internet of things device;
Determining a target heartbeat cycle of the first Internet of things device according to the related information of the first Internet of things device, and sending the target heartbeat cycle to the first Internet of things device, wherein the preset time period is the target heartbeat cycle.
3. The method of claim 2, wherein prior to sending second heartbeat data to the first internet of things device, the method further comprises:
And determining that the first Internet of things equipment starts a heartbeat active detection mechanism according to the related information of the first Internet of things equipment.
4. The method of claim 2, wherein the internet of things platform stores a device heartbeat database, and wherein the determining the target heartbeat period of the first internet of things device according to the related information of the first internet of things device comprises:
And inquiring a target heartbeat period of the first Internet of things device in the device heartbeat database according to the related information of the first Internet of things device.
5. The method of claim 3, wherein the internet of things platform includes a device heartbeat database, and the determining that the first internet of things device starts a heartbeat active detection mechanism according to the related information of the first internet of things device includes:
And inquiring the first Internet of things equipment in the equipment heartbeat database according to the related information of the first Internet of things equipment to start a heartbeat active detection mechanism.
6. The method of any of claims 2-5, wherein the target heartbeat period in the device heartbeat database and whether the first internet of things device turns on a heartbeat active detection mechanism are user-set.
7. The method of claim 6, wherein the method further comprises:
Obtaining user setting information, wherein the user setting information comprises: the heartbeat cycle of the second internet-of-things device set by the user and/or whether the second internet-of-things device set by the user starts an active detection mechanism;
transmitting request information to the second internet-of-things equipment, wherein the request information is used for requesting related information of the second internet-of-things equipment;
And receiving the related information of the second internet-of-things device, and adding the related information of the second internet-of-things device and the user setting information to the device heartbeat database.
8. The method for detecting the heartbeat of the internet of things equipment is characterized by being applied to first internet of things equipment, wherein the first internet of things equipment is in communication connection with an internet of things platform, and the method comprises the following steps:
sending related information of the first internet of things device to the internet of things platform, wherein the related information comprises one or more of the following: the device information of the first Internet of things device, the region information of the first Internet of things device and the network information of the first Internet of things device;
Receiving a target heartbeat period sent by the first Internet of things platform, wherein the target heartbeat period is determined according to the related information of the first Internet of things device;
Sending first heartbeat data to the first Internet of things platform according to the target heartbeat period;
And receiving second heartbeat data sent by the first internet of things platform, wherein the second heartbeat data is sent when the first heartbeat data is not received by the internet of things platform in the target period.
9. The method of claim 8, wherein the receiving the second heartbeat data sent actively by the internet of things platform comprises:
and when the first Internet of things device starts an active detection mechanism, receiving second heartbeat data sent by the Internet of things platform.
10. The method according to claim 8 or 9, characterized in that the method further comprises:
Receiving request information sent by the internet of things platform, wherein the request information is used for requesting related information of second internet of things equipment, and the related information of the second internet of things equipment comprises one or more of the following: the equipment information of the second internet-of-things equipment, the region information of the second internet-of-things equipment and the network information of the second internet-of-things equipment;
And based on the request information, sending the related information of the second internet of things device to the internet of things platform.
11. The method according to any of claims 8-10, wherein the target heart cycle is user-set.
12. The system for detecting the heartbeat of the Internet of things equipment is characterized by comprising an Internet of things platform and the Internet of things equipment:
The internet of things platform being for performing the method of any of claims 1-7, the internet of things device being for performing the method of any of claims 8-11.
13. A communication device comprising means for performing the steps of the method according to any of claims 1-7 or means for performing the steps of the method according to any of claims 8-11.
14. A communication apparatus, the apparatus comprising at least one processor coupled with at least one memory:
The at least one processor configured to execute the computer program or instructions in the at least one memory to cause the communication device to perform the method of any one of claims 1-7 or to perform the method of any one of claims 8-11.
15. A computer readable storage medium, having stored therein a computer program or instructions which, when read and executed by a computer, cause the computer to perform the method of any of claims 1-7 or to perform the method of any of claims 8-11.
16. A chip, comprising: a processor for performing the method of any one of claims 1-7 or for performing the method of any one of claims 8-11.
CN202211378432.7A 2022-11-04 2022-11-04 Method, system and communication device for detecting heartbeat of Internet of things equipment Pending CN117997807A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211378432.7A CN117997807A (en) 2022-11-04 2022-11-04 Method, system and communication device for detecting heartbeat of Internet of things equipment
PCT/CN2023/127338 WO2024093851A1 (en) 2022-11-04 2023-10-27 Internet of things device heartbeat detection method and system, and communication apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211378432.7A CN117997807A (en) 2022-11-04 2022-11-04 Method, system and communication device for detecting heartbeat of Internet of things equipment

Publications (1)

Publication Number Publication Date
CN117997807A true CN117997807A (en) 2024-05-07

Family

ID=90901706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211378432.7A Pending CN117997807A (en) 2022-11-04 2022-11-04 Method, system and communication device for detecting heartbeat of Internet of things equipment

Country Status (2)

Country Link
CN (1) CN117997807A (en)
WO (1) WO2024093851A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111031565B (en) * 2019-11-25 2023-01-24 青岛海信智慧生活科技股份有限公司 Method and device for identifying off-line state of ZigBee device
CN111181804B (en) * 2019-12-20 2022-01-28 中移(杭州)信息技术有限公司 Intelligent device offline state automatic detection method and device, electronic device and medium
CN111884875A (en) * 2020-07-17 2020-11-03 青岛易来智能科技股份有限公司 Offline device determination method and device
CN113596884B (en) * 2021-08-19 2023-11-03 深圳创维数字技术有限公司 Device state monitoring method, device state monitoring apparatus, and readable storage medium

Also Published As

Publication number Publication date
WO2024093851A1 (en) 2024-05-10

Similar Documents

Publication Publication Date Title
EP3934291A1 (en) Method and device for providing connectivity to terminal in order to use edge computing service
CN115315931B (en) Dynamic service discovery and offloading framework for edge-computing based cellular network systems
JP6470770B2 (en) Network node availability estimation based on historical data
US11388265B2 (en) Machine-to-machine protocol indication and negotiation
CN107196964B (en) System and method for implementing multi-band service discovery
CN105612805A (en) Communication method, communication system and relevant device of wearable device
US20180310141A1 (en) Group Multicast Method, Group Creation Method, and Mobile Network Platform
US20150081768A1 (en) Server, terminal and data pushing method
JP6629345B2 (en) Device and method for adding M2M service
CN104283743A (en) Home network equipment and proxy service discovering method
US20170251428A1 (en) Methods and Nodes for M2M Communication
CN112533177A (en) Method, device, apparatus and medium for providing and discovering moving edge calculation
US20170171698A1 (en) Near Field Discovery Method, User Equipment, and Storage Medium
KR101200168B1 (en) Method and System for Measuring Quality of Wireless Internet Service by Using Mobile Communication Terminal
CN101686081A (en) Method for reestablishing synchronous connection, device and system thereof
CN117997807A (en) Method, system and communication device for detecting heartbeat of Internet of things equipment
CN111178572A (en) Agricultural machinery reservation method and device, electronic equipment and storage medium
CN111865639B (en) Method and device for collecting information of snmp service equipment and electronic equipment
WO2023213134A1 (en) Data reporting method, apparatus, and system
KR101194639B1 (en) Method and Mobile Communication Terminal for Measuring Quality of Wireless Internet Service by Using Shared Memory
CN117440406A (en) Processing method and device
CN116074928A (en) Communication method, device and terminal equipment
KR20080014489A (en) Method and mobile communication terminal for measuring quality of wireless internet service by using message handler
CN117750394A (en) Target information and information acquisition method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination