Equipment state reporting method, system and device, equipment and storage medium
By polling the status of IoT devices on the central control device side and reporting it to the cloud server according to the network connection status, the server polling pressure problem caused by the huge number of IoT devices is solved, and a more efficient device status reporting is achieved.
Patent Information
- Application Number
- CN202411771688.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-04
AI Technical Summary
Due to the huge number of IoT devices, servers are under great pressure when determining the device status of each IoT device through polling.
By polling the Internet of Things devices in the LAN on the central control device side, and determining the status of the device is reported based on the network connection status, the device status is reported to the cloud server, reducing the polling pressure of the cloud server.
It effectively reduces the polling pressure and time of cloud servers and improves the efficiency of device status reporting.
Smart Images

Figure CN119629225A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, system, device, equipment and storage medium for reporting device status. Background Art
[0002] With the continuous advancement of science and technology, smart home technology has emerged. Smart home technology refers to the use of information technology and Internet of Things (IoT) technology to connect traditional IoT devices with the Internet, thereby realizing automated, intelligent and convenient home management and control systems.
[0003] In order to achieve the purpose of remote monitoring of IoT devices, the server needs to know whether the device status of the IoT device is online or offline. At present, the device status of IoT devices is determined by the server polling the IoT devices. Specifically, the server can send a heartbeat packet to the IoT device once at the arrival of each heartbeat cycle. If a response packet returned by the IoT device is received within the heartbeat cycle, it can be determined that the IoT device is online; if no response packet returned by the IoT device is received within the heartbeat cycle, it can be determined that the IoT device is offline. However, due to the large number of IoT devices, when the server determines the device status of each IoT device by polling, the number of IoT devices that need to be polled is too large, resulting in greater pressure on the server. Summary of the invention
[0004] The present application provides a device status reporting method, system, apparatus, device and storage medium to solve the problem that the server is under great pressure when determining the device status of each IoT device due to the excessive number of IoT devices.
[0005] In view of the above technical problems, the technical solution of this application is solved by the following embodiments:
[0006] An embodiment of the present application provides a method for reporting device status, which is applied to a central control device, including: determining the device status of the Internet of Things device by polling the Internet of Things device in a local area network; detecting the network connection status between the local area network and the Internet; determining a status reporting device corresponding to the network connection status; and sending the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to a cloud server in the Internet.
[0007] Among them, the determining of the status reporting device corresponding to the network connection status includes: if the network connection status is a disconnected state, establishing a communication connection with a user terminal connected to the local area network and determining the user terminal as the status reporting device; if the network connection status is a normal connection state, determining the communication module used to connect the local area network and the Internet as the status reporting device.
[0008] Among them, sending the device status of the Internet of Things device to the status reporting device so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet includes: if the status reporting device corresponding to the network connection status is a user terminal, sending the device status of the Internet of Things device to the user terminal so that the user terminal reports the device status of the Internet of Things device to the cloud server through the data network; if the status reporting device corresponding to the network connection status is a communication module, after receiving the first-level heartbeat packet from the cloud server forwarded by the communication module, sending the device status of the Internet of Things device to the communication module so that the communication module reports the device status of the Internet of Things device to the cloud server through the Internet.
[0009] An embodiment of the present application also provides a method for reporting device status, which is applied to a cloud server, and includes: receiving the device status of an Internet of Things device reported by a status reporting device; wherein the device status of the Internet of Things device is sent by a central control device in a local area network to the status reporting device; determining the network connection status between the local area network and the Internet; and updating the device status information corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
[0010] Wherein, determining the network connection status between the local area network and the Internet includes: if it is determined that the status reporting device is a user terminal accessing the local area network, then determining that the network connection status is a disconnected state; if it is determined that the status reporting device is a communication module for connecting the Internet and the local area network, then determining that the network connection status is a normal connection state.
[0011] Among them, determining the network connection status between the local area network and the Internet includes: sending a first-level heartbeat packet to the central control device in the local area network through the communication module; if a first-level response packet returned by the central control device is received, determining that the network connection status is a normal connection status; otherwise, sending a second-level heartbeat packet to the Internet of Things device through the communication module; if a second-level response packet returned by the Internet of Things device through the communication module is not received, determining that the network connection status is disconnected.
[0012] The embodiment of the present application also provides a device status reporting system, which includes: an Internet of Things device, a central control device, a status reporting device and a cloud server; wherein the Internet of Things device, the central control device and the status reporting device are connected to the same local area network, and the cloud server is connected to the Internet; the central control device determines the device status of the Internet of Things device by polling the Internet of Things devices in the local area network; detects the network connection status between the local area network and the Internet; determines the status reporting device corresponding to the network connection status; sends the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet; the cloud server receives the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; determines the network connection status between the local area network and the Internet; and updates the device status information corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
[0013] The embodiment of the present application also provides a device status reporting device, which is set in the central control device and includes: a first determination module, which is used to determine the device status of the Internet of Things device by polling the Internet of Things device in the local area network; a detection module, which is used to detect the network connection status between the local area network and the Internet; a second determination module, which is used to determine the status reporting device corresponding to the network connection status; a reporting module, which is used to send the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet; the device status reporting device set in the cloud server includes: a receiving module, which is used to receive the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; a third determination module, which is used to determine the network connection status between the local area network and the Internet; an update module, which is used to update the device status information corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
[0014] An embodiment of the present application also provides a device for reporting device status, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: execute a device status reporting program stored in the memory to implement any of the above-mentioned device status reporting methods executed on the central control device, or to implement any of the above-mentioned device status reporting methods executed on the cloud server.
[0015] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed to implement any of the above-mentioned methods for reporting the device status executed on the central control device, or to implement any of the above-mentioned methods for reporting the device status executed on the cloud server.
[0016] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application determines the device status of the IoT device by polling the IoT device in the local area network on the central control device side; detects the network connection status between the local area network and the Internet; determines the status reporting device corresponding to the network connection status; sends the device status of the IoT device to the status reporting device, so that the status reporting device reports the device status of the IoT device to the cloud server in the Internet. The central control device of the embodiment of the present application polls the device status of each IoT device and uses the status reporting device corresponding to the current network connection status to centrally report to the cloud server. The cloud server can obtain the device status of each IoT device in the local area network where the central control device is located by polling the central control device. There is no need for the cloud server to poll a large number of IoT devices, which reduces the polling pressure of the cloud server and shortens the polling time of the cloud server. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0020] Figure 1 This is a structural diagram of a device status reporting system according to an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a method for reporting device status executed in a central control device according to an embodiment of the present application;
[0022] Figure 3 This is a flowchart of a method for reporting device status executed on a cloud server according to an embodiment of the present application;
[0023] Figure 4 A flowchart of the steps of determining the network connection status according to an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a smart home application scenario according to an embodiment of the present application;
[0025] Figure 6 A structural diagram of a device status reporting apparatus provided in a central control device according to an embodiment of the present application;
[0026] Figure 7 A structural diagram of a device status reporting apparatus provided in a cloud server according to an embodiment of the present application;
[0027] Figure 8 The present invention is a structural diagram of a device for reporting device status according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0029] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0030] The present application embodiment provides a device status reporting system. Figure 1 , which is a structural diagram of a device status reporting system according to an embodiment of the present application.
[0031] The device status reporting system includes: an Internet of Things device, a central control device, a status reporting device and a cloud server; wherein the Internet of Things device, the central control device and the status reporting device are connected to the same local area network, and the cloud server is connected to the Internet.
[0032] Furthermore, the local area network includes but is not limited to: a local area network composed of IoT devices in a home, and a local area network composed of IoT devices in a building. The central control device can be a separate device, or one of the IoT devices in the local area network can be selected as the central control device.
[0033] Furthermore, the types of status reporting devices include: communication modules and user terminals. The types of communication modules include, but are not limited to: WiFi modules, routers, and network access point devices. Among them, the communication module is used to build a local area network. In a local area network, at least one central control device is included, and each central control device corresponds to at least one IoT device. In order to make the embodiments of the present application easier to understand, the following is an explanation based on the case of a local area network. For the case of multiple local area networks, other local area networks can refer to the embodiments of the present application to perform device status reporting.
[0034] The central control device determines the device status of the IoT device by polling the IoT device in the local area network; detects the network connection status between the local area network and the Internet; determines the status reporting device corresponding to the network connection status; sends the device status of the IoT device to the status reporting device, so that the status reporting device reports the device status of the IoT device to the cloud server in the Internet.
[0035] The cloud server receives the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; determines the network connection status between the local area network and the Internet; and updates the historical device status corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
[0036] Furthermore, the types of network connection status include: disconnected status and normal connection status. The disconnected status indicates that the local area network and the Internet are disconnected. The normal connection status indicates that the connection between the local area network and the Internet is normal.
[0037] Furthermore, the status reporting device is a communication module or a user terminal in a local area network. The user terminal can communicate with a cloud server in the Internet through a data network. The communication module is used to connect the local area network and the Internet, and can directly communicate with the cloud server through the Internet. When the network connection state is a disconnected state, the status reporting device is a user terminal. When the network connection state is a normal connection state, the status reporting device is a communication module.
[0038] In the embodiment of the present application, a distributed system is constructed through a central control device, and the central control device determines the device status of each IoT device by polling and reports the device status of each IoT device in a centralized manner, which can avoid the problem of excessive polling pressure on the cloud server caused by the cloud server polling a large number of IoT devices, reduce the polling pressure on the server, and shorten the polling time of the cloud server. Furthermore, in order to avoid the problem of disconnection between the local area network and the Internet where the cloud server is located, when the network connection status between the local area network and the Internet is a normal connection status, the device status of the IoT device can be reported to the cloud server through the communication module, and when the network connection status between the local area network and the Internet is a disconnected status, the device status of the IoT device can be reported to the cloud server through the user terminal. Based on this, the normal update of the device status of the IoT device in the cloud server can be guaranteed.
[0039] The following describes the steps performed by the central control device and the cloud server respectively.
[0040] The present application embodiment provides a method for reporting device status executed in a central control device. Figure 2 , which is a flow chart of a method for reporting device status executed in a central control device according to an embodiment of the present application.
[0041] Step S210, determining the device status of the IoT device by polling the IoT device in the local area network.
[0042] After the central control device and each IoT device are respectively connected to the communication module, a local area network can be formed; the central control device can establish a network connection with each IoT device in the local area network, and poll each IoT device to determine the device status of each IoT device.
[0043] The types of device status include: online status and offline status. Among them, an IoT device in online status means that the IoT device can receive and execute control instructions issued by the cloud server. An IoT device in offline status means that the IoT device cannot receive and execute control instructions issued by the cloud server.
[0044] Specifically, the duration of the secondary heartbeat cycle is pre-set. When each secondary heartbeat cycle comes, the central control device can send a secondary heartbeat packet to one of the IoT devices; if a secondary response packet returned by the IoT device is received in the secondary heartbeat cycle, the device state of the IoT device is determined to be online; if no secondary response packet returned by the IoT device is received in the secondary heartbeat cycle, the device state of the IoT device is determined to be offline.
[0045] Step S220, detecting the network connection status between the local area network and the Internet.
[0046] The types of network connection states include: disconnected state and normal connection state.
[0047] The disconnected state indicates that the local area network and the Internet are disconnected, that is, the communication module and the cloud server are disconnected and cannot communicate. In the embodiment of the present application, in the disconnected state, that is, when the local area network and the Internet are disconnected, the communication module can work normally. Among them, in the disconnected state, the communication module can work normally, which may be caused by the loosening of the network cable of the communication module, resulting in the communication module being unable to connect to the Internet.
[0048] The normal connection status means that the LAN and the Internet are connected normally, that is, the connection between the communication module and the cloud server is normal and has not been disconnected, and normal communication is possible.
[0049] Specifically, the central control device can send a network connection status inquiry message to the communication module; and receive a network connection status response message returned by the communication module; the network connection status response message carries whether the network connection status is a disconnected state or a normal connection state. Alternatively, when the network connection status is a normal connection state, the central control device can receive a first-level heartbeat packet sent by the cloud server through the communication module at every preset time period. If the first-level heartbeat packet sent by the cloud server through the communication module is not received, the network connection status is determined to be a disconnected state; if the first-level heartbeat packet sent by the cloud server through the communication module is received, the network connection status is determined to be a normal connection state.
[0050] Step S230, determining a status reporting device corresponding to the network connection status.
[0051] If the network connection state is a disconnected state, a communication connection is established with a user terminal connected to the local area network and the user terminal is determined as the state reporting device.
[0052] If the network connection state is a normal connection state, a communication module used to connect the local area network and the Internet is determined as the state reporting device.
[0053] Step S240: sending the device status of the IoT device to the status reporting device, so that the status reporting device reports the device status of the IoT device to the cloud server in the Internet.
[0054] If the status reporting device corresponding to the network connection status is a user terminal, the device status of the Internet of Things device is sent to the user terminal, so that the user terminal reports the device status of the Internet of Things device to the cloud server through the data network.
[0055] If the status reporting device corresponding to the network connection status is a communication module, then after receiving the first-level heartbeat packet forwarded by the communication module from the cloud server, the device status of the Internet of Things device is sent to the communication module, so that the communication module reports the device status of the Internet of Things device to the cloud server through the Internet.
[0056] In an embodiment of the present application, there may be multiple IoT devices in the local area network where the central control device is located. The central control device may send the device states corresponding to the multiple IoT devices to the state reporting device, so that the state reporting device reports the device states corresponding to the multiple IoT devices to the cloud server. Alternatively, the central control device may send the device states corresponding to the IoT devices with device state switching among the multiple IoT devices to the state reporting device, so that the state reporting device reports the device states corresponding to the IoT devices with device state switching to the cloud server. The device state switching refers to the device state of the IoT device switching from an offline state to an online state, or from an online state to an offline state.
[0057] Furthermore, the central control device can store the device status corresponding to each IoT device determined in the previous polling; determine each IoT device with device status switching based on the device status corresponding to each IoT device determined in the previous polling and the device status corresponding to each IoT device determined in this polling; send the device status corresponding to each IoT device with device status switching to the status reporting device, so that the status reporting device reports the device status corresponding to each IoT device with device status switching to the cloud server.
[0058] In an embodiment of the present application, the central control device can generate a device status list; the device status request is used to record the device status corresponding to multiple IoT devices respectively or the device status of IoT devices with device status switching among multiple IoT devices; the central control device can send the device status list to the status reporting device, so that the status reporting device reports the device status list to the cloud server.
[0059] In the embodiment of the present application, since the central control device can be a device separately set up in the local area network or an Internet of Things device in the local area network, when the central control device determines the device status of the Internet of Things device by polling the Internet of Things device in the local area network, it can determine the device status of the central control device itself, and report the device status of the central control device itself together with the device status of other Internet of Things devices to the cloud server through the status reporting device; after receiving the device status of the central control device, the cloud server can update the device status information corresponding to the central control device.
[0060] In an embodiment of the present application, the central control device determines the device status of the IoT device by polling the IoT devices in the local area network; detects the network connection status between the local area network and the Internet; determines the status reporting device corresponding to the network connection status; sends the device status of the IoT device to the status reporting device, so that the status reporting device reports the device status of the IoT device to the cloud server in the Internet. The central control device in the embodiment of the present application polls the device status of each IoT device and uses the status reporting device corresponding to the current network connection status to centrally report to the cloud server. The cloud server can obtain the device status of each IoT device in the local area network where the central control device is located by polling the central control device. There is no need for the cloud server to poll a large number of IoT devices, which reduces the polling pressure of the cloud server and shortens the polling time of the cloud server.
[0061] Based on the above-mentioned method for reporting the device status executed in the central control device, the embodiment of the present application also provides a method for reporting the device status executed in the cloud server. Figure 3 , which is a flow chart of a method for reporting device status executed on a cloud server according to an embodiment of the present application.
[0062] Step S310, receiving the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device.
[0063] The status reporting device may be a user terminal or a communication module accessing a local area network.
[0064] In an embodiment of the present application, the cloud server can receive device states corresponding to multiple IoT devices in a local area network reported by a status reporting device, or device states corresponding to IoT devices with device state switching among the multiple IoT devices.
[0065] Furthermore, the cloud server may receive a device status list reported by a status reporting device; the device status request is used to record the device statuses corresponding to a plurality of IoT devices respectively or the device statuses of IoT devices with device status switching among a plurality of IoT devices.
[0066] Step S320, determining the network connection status between the local area network and the Internet.
[0067] In one embodiment, the cloud server can determine the network connection status by identifying the type of the status reporting device. Specifically, if it is determined that the status reporting device is a user terminal connected to the local area network, the network connection status is determined to be a disconnected state. If it is determined that the status reporting device is a communication module for connecting the Internet and the local area network, the network connection status is determined to be a normal connection state.
[0068] In another method, the cloud server can poll the central control device and the IoT device through the Internet to determine the network connection status. This method will be described later, so it will not be repeated again.
[0069] Step S330: updating device status information corresponding to the IoT device according to the device status of the IoT device and the network connection status.
[0070] The device status information includes at least the following information: the device status of the IoT device and the source information of the device status report. The source information of the device status report is: the device information of the status reporting device or the network connection status.
[0071] The cloud server stores the device status information corresponding to the IoT devices in the local area network in the storage space; updates the stored device status corresponding to the IoT device according to the device status corresponding to the IoT device received this time; and updates the device status reporting source information corresponding to the IoT device according to the current network connection status.
[0072] In an embodiment of the present application, after updating the device status information corresponding to the IoT device, the cloud server can send the device status corresponding to the IoT device to the user terminal so that the user can view the device status corresponding to the IoT device through the user terminal.
[0073] In the embodiment of the present application, the cloud server receives the control parameter information corresponding to the IoT device sent by the user terminal, generates the control instruction corresponding to the IoT device according to the control parameter information; queries the device status information corresponding to the IoT device; when the device status of the IoT device is determined to be online according to the device status information, determines the instruction issuing device according to the device status reporting source information corresponding to the IoT device; sends the control instruction to the IoT device through the instruction issuing device. The control parameter information is used to adjust the operating parameters of the IoT device; when the device status of the IoT device is determined to be offline according to the device status information, sends a notification that the IoT device has gone offline to the user terminal.
[0074] Furthermore, sending the control instruction to the Internet of Things device through the instruction issuing device includes: sending the control instruction to the instruction issuing device, so that the instruction issuing device directly sends the control instruction to the Internet of Things device, or, so that the instruction issuing device sends the control instruction to the central control device, and the central control device sends the control instruction to the Internet of Things device.
[0075] Furthermore, when the source information of the device status report is a communication module or a normal connection state, the communication module is determined as an instruction issuing device, and the control instruction is sent to the Internet of Things device through the communication module; when the source information of the device status report is a user terminal or a disconnected state, the user terminal is determined as an instruction issuing device, and the control instruction is sent to the Internet of Things device through the user terminal.
[0076] For example: a user wants to adjust the cooling temperature of the air conditioner and adjust the cooling temperature of the air conditioner to 20°C in the user terminal. The user terminal can send the information that the cooling temperature of the air conditioner is adjusted to 20°C (control parameter information) to the cloud server. The cloud server generates a control instruction based on the control parameter information and queries the device status information corresponding to the air conditioner. If the device status of the air conditioner is online and the source information of the device status report is the communication module, the control instruction is sent to the air conditioner through the communication module.
[0077] The following describes the process of determining the network connection status by polling the central control device and the IoT device. Figure 4 , which is a flow chart of the steps of determining the network connection status according to an embodiment of the present application.
[0078] Step S410, sending a level one heartbeat packet to a central control device in a local area network through a communication module.
[0079] Step S420, determining whether a first-level response packet returned by the central control device through the communication module is received; if yes, executing step S430; if not, executing step S440.
[0080] Step S430: If a first-level response packet returned by the central control device is received, it is determined that the network connection state is a normal connection state.
[0081] Step S440: If the first-level response packet returned by the central control device is not received, a second-level heartbeat packet is sent to the Internet of Things device through the communication module.
[0082] If the central control device corresponds to multiple IoT devices, the secondary heartbeat packets are sent to the multiple IoT devices respectively through the communication module. Furthermore, the secondary heartbeat packets can be sent to the multiple IoT devices respectively through the communication module in a polling manner.
[0083] Step S450, determine whether a secondary response packet returned by the IoT device through the communication module is received; if yes, execute step S460; if not, execute step S470.
[0084] Step S460: If a secondary response packet is received from the IoT device through the communication module, the IoT device in the local area network is polled through the communication module to determine the device status of the IoT device and update the device status information corresponding to the IoT device.
[0085] If a secondary response packet is received from an IoT device, it means that the LAN and the Internet can communicate normally, but the central control device fails. The central control device can be temporarily bypassed to poll each IoT device in the LAN, determine the device status of each IoT device, and update the device status information of each IoT device.
[0086] The types of central control device failures include: the central control device is damaged, the central control device is reset and network configuration has not been completed. After the central control device failure is eliminated, the central control device can normally pass the secondary response packet returned by the communication module.
[0087] In this case, the device status reporting source information in the device status information may be a communication module or a normal connection status.
[0088] Step S470: If the secondary response packet returned by the IoT device through the communication module is not received, it is determined that the network connection state is a disconnected state.
[0089] If the secondary response packet returned by the IoT device is not received, it means that the local area network and the Internet cannot communicate normally. Furthermore, in the case where the central control device corresponds to multiple IoT devices, if the secondary response packet returned by the multiple IoT devices through the communication module is not received, it is determined that the network connection state is disconnected.
[0090] In order to make the embodiments of the present application easier to understand, the method for reporting the device status of the embodiments of the present application is described below in conjunction with a specific smart home application scenario.
[0091] like Figure 5 , which is a schematic diagram of a smart home application scenario according to an embodiment of the present application.
[0092] In the smart home application scenario, the device status reporting system includes: cloud server, WiFi module (ie: communication module), user terminal, home host (ie: central control device) and Internet of Things device (ie: Internet of Things device).
[0093] Among them, a communication module is used to form a local area network, and a local area network includes at least one central control device. The number of IoT devices corresponding to each central control device is at least one. Furthermore, in the smart home application scenario, the WiFi module, each home host, and each IoT device corresponding to each home host are connected to the same local area network.
[0094] In the smart home application scenario, IoT devices support WiFi protocol, Message Queuing Telemetry Transport (MQTT) protocol, and Bluetooth Low Energy (BLE) protocol for communication, and can be configured and controlled as well as issue instructions through the user terminal application (APP). The home host can communicate normally with IoT devices, and the home host has the authority to report the device status of IoT devices to the cloud server. The home host and all IoT devices can be configured through the WiFi module and can view device information through the APP.
[0095] When the WiFi module is normal, the WiFi module can connect to the local area network and the Internet normally, so that all devices can connect to the Internet normally.
[0096] When the WiFi module is normal, the device status of the home host and the device status of other IoT devices are pushed through the home host. Specifically, because the cloud server checks whether the IoT device is online by polling, when the number of IoT devices is too large, the pressure of the cloud server sending a first-level heartbeat packet to each IoT device one by one is too large, and the time cost of waiting for each IoT device to return a first-level response packet is large. The embodiment of the present application uses a home host to build a distributed system, takes the home host as a key node in the distributed system, and uses the home host to poll the device status of each IoT device and store it in the storage space of the home host. When the IoT device, the home host, and the WiFi module can all access the Internet normally, the polling message (first-level heartbeat packet) of the cloud server will be sent to the home host through the WiFi module, and the home host will report the device status of the IoT device stored in the storage space to the cloud server, so that the cloud server can update the device status information of the IoT device using the received device status of the IoT device. After the cloud server completes the update, it can send the updated device status of the IoT device to the user terminal so that the user can view the current device status of the IoT device. Furthermore, in order to improve the reporting efficiency, the home host may report only the device status of the IoT devices whose device status has changed to the cloud server through the WiFi module.
[0097] In the case of an abnormal WiFi module, the WiFi module cannot normally connect to the LAN and the Internet, and the LAN and the Internet are disconnected, so that all devices in the LAN cannot connect to the Internet. Furthermore, the abnormal WiFi module may be caused by the disconnection of the network cable of the WiFi module, etc. The WiFi module can work normally, but cannot connect to the Internet. At this time, the WiFi module, the home host and the IoT device corresponding to the home host constitute a local LAN.
[0098] In the case of an abnormal WiFi module, both the home host and the IoT device can communicate normally with the WiFi module. At this time, the home host can be used as an offline home host, and the home host and the IoT device can communicate through the BLE protocol. When the home host and the IoT device can communicate normally, the home host marks the device status of the IoT device in the device status list as "online", but at this time, since the cloud server has not received the first-level response packet pushed from the key node (home host), the cloud server will traverse the IoT devices under the home host separately, that is, poll each IoT device corresponding to the central control device. If no response packet is received, these IoT devices can be marked as "offline" first. At this time, if the user terminal is connected to the local area network, when the user opens the preset APP in the user terminal, the user terminal can establish a communication connection with the home host through offline authentication. The home host reports the device status of the IoT device stored in the storage space to the user terminal. The user terminal uses mobile phone traffic to report the device status of the IoT device to the cloud server. The cloud server marks the device data reported by this type, that is, the user terminal reports the device status of the IoT device because the WiFi module cannot connect to the Internet, and the device status of the IoT device is reported through data traffic. Furthermore, in order to improve reporting efficiency, the home host may report only the device status of the IoT devices whose device status has changed to the cloud server through the user terminal.
[0099] In the smart home application scenario, assuming that each family has several air conditioners, multiple smart sockets, multiple smart switches, a refrigerator, washing machine and many other appliances, then each family needs to report dozens or even hundreds of device states. At this time, centrally reporting the device status of each IoT device through the home host can effectively reduce the order of magnitude of reported device states and effectively reduce the polling pressure and polling time of the cloud server.
[0100] The present application also provides a device status reporting device set in a central control device. Figure 6 , which is a structural diagram of a device status reporting apparatus provided in a central control device according to an embodiment of the present application.
[0101] The device status reporting device provided in the central control device includes:
[0102] The first determination module 610 is used to determine the device status of the IoT device by polling the IoT devices in the local area network.
[0103] The detection module 620 is used to detect the network connection status between the local area network and the Internet.
[0104] The second determination module 630 is used to determine the status reporting device corresponding to the network connection status.
[0105] The reporting module 640 is used to send the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet.
[0106] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.
[0107] The present application also provides a device status reporting device set in a cloud server. Figure 7 , which is a structural diagram of a device status reporting apparatus set in a cloud server according to an embodiment of the present application.
[0108] The device status reporting device provided in the cloud server includes:
[0109] The receiving module 710 is used to receive the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device.
[0110] The third determining module 720 is used to determine the network connection status between the local area network and the Internet.
[0111] The updating module 730 is used to update the device status information corresponding to the IoT device according to the device status of the IoT device and the network connection status.
[0112] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.
[0113] The present application also provides a device for reporting device status, such as Figure 8 , which is a structural diagram of a device for reporting device status according to an embodiment of the present application.
[0114] The device status reporting device includes: a processor 810 , a communication interface 820 , a memory 830 and a communication bus 840 . The processor 810 , the communication interface 820 , and the memory 830 communicate with each other via the communication bus 840 .
[0115] The memory 830 is used to store computer programs.
[0116] In one embodiment of the present application, the processor 810, when executing the program stored in the memory 830, implements the device status reporting method provided by any of the aforementioned method embodiments and executed in the central control device, including: determining the device status of the Internet of Things device by polling the Internet of Things devices in the local area network; detecting the network connection status between the local area network and the Internet; determining the status reporting device corresponding to the network connection status; sending the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet.
[0117] Among them, the determining of the status reporting device corresponding to the network connection status includes: if the network connection status is a disconnected state, establishing a communication connection with a user terminal connected to the local area network and determining the user terminal as the status reporting device; if the network connection status is a normal connection state, determining the communication module used to connect the local area network and the Internet as the status reporting device.
[0118] Among them, sending the device status of the Internet of Things device to the status reporting device so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet includes: if the status reporting device corresponding to the network connection status is a user terminal, sending the device status of the Internet of Things device to the user terminal so that the user terminal reports the device status of the Internet of Things device to the cloud server through the data network; if the status reporting device corresponding to the network connection status is a communication module, after receiving the first-level heartbeat packet from the cloud server forwarded by the communication module, sending the device status of the Internet of Things device to the communication module so that the communication module reports the device status of the Internet of Things device to the cloud server through the Internet.
[0119] In another embodiment of the present application, the processor 810, when executing the program stored in the memory 830, implements the device status reporting method provided by any of the aforementioned method embodiments and executed on the cloud server, including: receiving the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; determining the network connection status between the local area network and the Internet; and updating the device status information corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
[0120] Wherein, determining the network connection status between the local area network and the Internet includes: if it is determined that the status reporting device is a user terminal accessing the local area network, then determining that the network connection status is a disconnected state; if it is determined that the status reporting device is a communication module for connecting the Internet and the local area network, then determining that the network connection status is a normal connection state.
[0121] Among them, determining the network connection status between the local area network and the Internet includes: sending a first-level heartbeat packet to the central control device in the local area network through the communication module; if a first-level response packet returned by the central control device is received, determining that the network connection status is a normal connection status; otherwise, sending a second-level heartbeat packet to the Internet of Things device through the communication module; if a second-level response packet returned by the Internet of Things device through the communication module is not received, determining that the network connection status is disconnected.
[0122] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the device status reporting method performed on the central control device as provided in any of the aforementioned method embodiments or the steps of the device status reporting method performed on the cloud server as provided in any of the aforementioned method embodiments are implemented. Since the device status reporting method performed on the central control device and the device status reporting method performed on the cloud server have been described in detail above, the details not fully described in the description of this embodiment can be referred to the relevant descriptions in the aforementioned embodiments, and will not be repeated here.
[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0125] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0126] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for reporting device status, characterized in that: Applied in central control equipment, including: Determine the device status of the IoT device by polling the IoT device in the local area network; Detecting the network connection status between the local area network and the Internet; Determine a status reporting device corresponding to the network connection status; The device status of the Internet of Things device is sent to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet.
2. The method according to claim 1, characterized in that: The determining of a status reporting device corresponding to the network connection status includes: If the network connection state is a disconnected state, establishing a communication connection with a user terminal connected to the local area network and determining the user terminal as the state reporting device; If the network connection state is a normal connection state, a communication module used to connect the local area network and the Internet is determined as the state reporting device.
3. The method according to claim 2, characterized in that The sending the device status of the Internet of Things device to the status reporting device so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet includes: If the status reporting device corresponding to the network connection status is a user terminal, sending the device status of the IoT device to the user terminal, so that the user terminal reports the device status of the IoT device to the cloud server through the data network; If the status reporting device corresponding to the network connection status is a communication module, then after receiving the first-level heartbeat packet forwarded by the communication module from the cloud server, the device status of the Internet of Things device is sent to the communication module, so that the communication module reports the device status of the Internet of Things device to the cloud server through the Internet.
4. A method for reporting device status, characterized in that: Applications in cloud servers include: Receive the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; Determining a network connection status between the local area network and the Internet; According to the device status of the Internet of Things device and the network connection status, the device status information corresponding to the Internet of Things device is updated.
5. The method according to claim 4, characterized in that Determining the network connection status between the local area network and the Internet includes: If it is determined that the status reporting device is a user terminal accessing the local area network, determining that the network connection status is a disconnected state; If it is determined that the status reporting device is a communication module for connecting the Internet and the local area network, then the network connection status is determined to be a normal connection status.
6. The method according to claim 4, characterized in that Determining the network connection status between the local area network and the Internet includes: Sending a primary heartbeat packet to the central control device in the local area network through the communication module; If a first-level response packet returned by the central control device is received, it is determined that the network connection state is a normal connection state; otherwise, a second-level heartbeat packet is sent to the Internet of Things device through the communication module; If the secondary response packet returned by the IoT device through the communication module is not received, it is determined that the network connection state is disconnected.
7. A device status reporting system, characterized in that: The device status reporting system includes: an Internet of Things device, a central control device, a status reporting device and a cloud server; wherein the Internet of Things device, the central control device and the status reporting device are connected to the same local area network, and the cloud server is connected to the Internet; The central control device determines the device status of the IoT device by polling the IoT device in the local area network; detects the network connection status between the local area network and the Internet; determines the status reporting device corresponding to the network connection status; sends the device status of the IoT device to the status reporting device, so that the status reporting device reports the device status of the IoT device to the cloud server in the Internet; The cloud server receives the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; determines the network connection status between the local area network and the Internet; and updates the device status information corresponding to the Internet of Things device according to the device status of the Internet of Things device and the network connection status.
8. A device for reporting device status, characterized in that: The device status reporting device set in the central control device includes: A first determination module is used to determine the device status of the Internet of Things device by polling the Internet of Things device in the local area network; A detection module, used to detect the network connection status between the local area network and the Internet; A second determining module, used to determine a status reporting device corresponding to the network connection status; A reporting module, used to send the device status of the Internet of Things device to the status reporting device, so that the status reporting device reports the device status of the Internet of Things device to the cloud server in the Internet; The device status reporting device set in the cloud server includes: A receiving module, used to receive the device status of the Internet of Things device reported by the status reporting device; wherein the device status of the Internet of Things device is sent by the central control device in the local area network to the status reporting device; A third determination module is used to determine the network connection status between the local area network and the Internet; The updating module is used to update the device status information corresponding to the IoT device according to the device status of the IoT device and the network connection status.
9. A device for reporting device status, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: execute a device status reporting program stored in the memory to implement the device status reporting method of any one of claims 1 to 3 executed in the central control device, or to implement the device status reporting method of any one of claims 4 to 6 executed in the cloud server.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement the device status reporting method executed on the central control device according to any one of claims 1-3, or to implement the device status reporting method executed on the cloud server according to any one of claims 4-6.
Citation Information
Patent Citations
Method, device, terminal and system for reporting offline information of Internet-of-Things equipment
CN111769978A
State reporting method, device and equipment and computer readable storage medium
CN112910740A
Method and system for monitoring state of Internet of Things equipment, and medium
CN113923142A
Data collection method, communication device and communication system
CN116633782A
Method and system for maintaining information and state of smart home equipment
CN118611999A