A method, system and electronic device for determining the online status of a device

CN119254664BActive Publication Date: 2026-08-07HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-04-24
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

当网关设备与云服务器断开连接时,终端设备获取到的智能设备的在线状态可能是不准确的,导致终端设备对智能设备的控制产生错误,影响用户的使用体验

Benefits of technology

[0036] Understandably, the beneficial effects that the technical solutions provided in the third to fifth aspects above can achieve can be referred to the beneficial effects in the first aspect and any of its optional implementation methods, and will not be repeated here.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254664B_ABST
    Figure CN119254664B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, in particular to a method, system and electronic device for determining the online state of a device. The method comprises the following steps: in the case that a master device and a first gateway have established a first communication connection and the first gateway is not connected to an external network, the master device acquires first state information from the first gateway, wherein the first communication connection comprises a communication connection between the master device and the first gateway through a local area network, the first state information comprises the communication connection state between the first gateway and at least one first sub-device, and the first sub-device is a sub-device associated with the first gateway; and the master device determines the device state of the first sub-device based on the first state information and the communication connection state between the master device and the first gateway. The method, system, electronic device and storage medium for determining the online state of a device provided by the application can improve the accuracy of the terminal device in acquiring the online state of a device and improve the use experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, system, and electronic device for determining the online status of a device. Background Technology

[0002] As users' demand for smart living continues to increase, the variety of smart devices on the market (such as smart curtains, smart lights, smart switches, smart air conditioners, smart printers, etc.) is also increasing, replacing traditional devices and providing convenience for users' lives.

[0003] When controlling smart devices, users can use terminal devices to control various smart devices connected to the gateway device via a cloud server. Before controlling the smart devices, users need to check whether each smart device is online through the terminal device.

[0004] Currently, the online status of smart devices is reported by the gateway device to the cloud server, and then by the cloud server to the terminal device. When the gateway device disconnects from the cloud server, the online status of the smart device obtained by the terminal device may be inaccurate, leading to errors in the terminal device's control of the smart device and affecting the user experience. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a method, system, and electronic device for determining the online status of a device, which can improve the accuracy of terminal devices in obtaining the online status of devices and enhance the user experience.

[0006] To achieve the above objectives, in a first aspect, this application provides a method for determining the online status of a device, comprising: when a master device has established a first communication connection with a first gateway and the first gateway is not connected to an external network, the master device obtains first status information from the first gateway, wherein the first communication connection includes a communication connection between the master device and the first gateway via a local area network, and the first status information includes the communication connection status between the first gateway and at least one first sub-device, wherein the first sub-device is a sub-device associated with the first gateway; the master device determines the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway, wherein: when a communication connection has been established between the first gateway and the first sub-device, if the master device has established a first communication connection with the first gateway, the master device determines that the first sub-device is in a near-field online state; when a communication connection has been established between the first gateway and the first sub-device, if the master device has established a second communication connection with the first gateway, the master device determines that the first sub-device is in a far-field online state, wherein the second communication connection includes a server-side communication connection between the master device and the first gateway via an external network.

[0007] In this embodiment, when the first gateway is disconnected from the external network or cannot connect to the external network, the master device can directly establish a first communication connection with the first gateway through the local area network and directly obtain the first status information from the first gateway. Simultaneously, the master device can determine the device status of the first sub-device based on the communication connection status between the master device and the first gateway, as well as the first status information. In this way, the master device can determine the device status of the first sub-device even when the master device and the first gateway are disconnected from the external network, reducing reliance on the external network when confirming the device status of the first sub-device. This allows for timely updates to the device status of the first sub-device, improving the accuracy of determining the device status and thus enhancing the user experience. Furthermore, when the first sub-device is online, it can distinguish between near-field and far-field online states, enabling the master device to control the first sub-device via near-field or far-field connections.

[0008] In one optional implementation, before determining the device status of the first sub-device, the method further includes: if the master device and the first gateway have established a second communication connection, the master device obtains the first status information reported by the first gateway from the server. In this way, when the master device and the first gateway can establish a connection through an external network server, the master device can directly obtain the first status information reported by the server, thus eliminating the need to obtain the first status information from the first gateway again. This reduces the workload of the first gateway in obtaining the first status information and consequently reduces resource consumption.

[0009] In one optional implementation, after the master device obtains the first status information from the first gateway, the method further includes: if the master device and the first gateway have not established a communication connection, the master device determines that the first sub-device is in an offline state. Thus, even if the master device and the first gateway have not established a communication connection, it can be determined that the first sub-device is in an offline state.

[0010] In one optional implementation, after the master device obtains the first status information from the first gateway, it further includes: if the first gateway and the first sub-device have not established a communication connection, the master device determines that the first sub-device is in an offline state. Thus, even if the first gateway and the first sub-device have not established a communication connection, it can be determined that the first sub-device is in an offline state.

[0011] In one optional implementation, when the master device has established a second communication connection with the first gateway, but has not established a first communication connection with the first gateway, in response to the establishment of a first communication connection between the master device and the first gateway, the master device adds a near-field online status to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. Thus, when the master device has established a second communication connection with the first gateway, the first target sub-device has a far-field online status. In this case, if the master device adds a first communication connection with the first gateway, it can add a near-field online status to the first sub-device, thereby facilitating control of the first sub-device.

[0012] In one alternative implementation, when the master device and the first gateway have not established a communication connection, in response to the establishment of a first communication connection between the master device and the first gateway, the master device obtains the first status information from the first gateway. Thus, when the master device and the first gateway can establish a connection via an external network server, the master device can directly obtain the first status information reported by the server, thereby eliminating the need to obtain the first status information from the first gateway again. This reduces the workload of the first gateway in obtaining the first status information and consequently reduces resource consumption.

[0013] In one optional implementation, if the master device and the first gateway have not established a second communication connection, in response to the establishment of a second communication connection between the master device and the first gateway, the master device adds a far-field online status to the first target sub-device, which includes the first sub-device that has established a communication connection with the first gateway. Thus, when the communication connection status between the first gateway and the master device changes from unconnected to having a second communication connection established, a far-field online status can be added to the first target sub-device to facilitate control of the first sub-device.

[0014] In one optional implementation, when the master device establishes a first communication connection and a second communication connection with the first gateway device, in response to the master device disconnecting the second communication connection with the first gateway, the master device adds a far-field offline state to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. When the master device establishes the first communication connection and the first gateway device, the first target sub-device has a far-field online state and a near-field online state. The master device can control the first sub-device through far-field or near-field communication, and the master device can determine and update the online state of the first sub-device through near-field or far-field communication. If the master device disconnects the second communication connection with the first gateway, it indicates that the first gateway is far-field offline. The master device can add a far-field offline state to the first target sub-device, thereby avoiding the master device controlling the first sub-device through far-field communication and avoiding the master device confirming and updating the online state of the first sub-device through far-field communication.

[0015] In one optional implementation, when the master device establishes a first communication connection and a second communication connection with the first gateway device, in response to the master device disconnecting the first communication connection with the first gateway, the master device adds a near-field offline state to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. When the master device establishes the first communication connection and the first gateway device, the first target sub-device has a far-field online state and a near-field online state. The master device can control the first sub-device through far-field or near-field communication, and the master device can determine and update the online state of the first sub-device through near-field or far-field communication. If the master device disconnects the first communication connection with the first gateway, it indicates that the first gateway is near-field offline. The master device can add a near-field offline state to the first target sub-device, thereby preventing the master device from controlling the first sub-device through near-field communication and preventing the master device from confirming and updating the online state of the first sub-device through near-field communication.

[0016] In one optional implementation, when the master device establishes a second communication connection with the first gateway device but not the first communication connection, in response to the master device disconnecting the second communication connection with the first gateway, the master device adds a far-field offline status to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. When the master device establishes a second communication connection with the first gateway device, the first target sub-device has a far-field online status, and the master device can control the first sub-device remotely and determine and update the online status of the first sub-device remotely. If the master device disconnects the second communication connection with the first gateway, it indicates that the first gateway is far-field offline. The master device can add a far-field offline status to the first target sub-device, thereby preventing the master device from controlling the first sub-device remotely and from confirming and updating the online status of the first sub-device remotely.

[0017] In one optional implementation, when the master device establishes a first communication connection with the first gateway device but not a second communication connection, in response to the master device disconnecting the first communication connection with the first gateway, the master device adds a near-field offline state to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. When the master device establishes a first communication connection with the first gateway device, the first target sub-device has a near-field online state, and the master device can control the first sub-device via near-field communication, as well as determine and update the online state of the first sub-device via near-field communication. If the master device disconnects the first communication connection with the first gateway, it indicates that the first gateway is near-field offline. The master device can add a near-field offline state to the first target sub-device, thereby preventing the master device from controlling the first sub-device via near-field communication and preventing the master device from confirming and updating the online state of the first sub-device via near-field communication.

[0018] In one optional implementation, if the master device and the server have not established a communication connection, in response to the establishment of a communication connection, the master device sends a first request message to the server; the master device receives a first response message sent by the server in response to the first request message, the first response message including first status information. This ensures that the device status list can be updated promptly after the master device reconnects to the network or powers on.

[0019] In one optional implementation, the master device includes a LinkSvc service. The master device obtains first status information from a first gateway, including: the LinkSvc service sending a synchronization message to the first gateway, the synchronization message including a synchronized first status message; and the LinkSvc service receiving the first status message sent by the first gateway. This allows the LinkSvc service to directly obtain the first status information from the first gateway.

[0020] In one optional implementation, before determining the device status of the first sub-device, the method further includes: if a second communication connection has been established between the master device and the first gateway, the LinkSvc service obtains a notification message sent by the server, the notification message including the first status information. In this way, the LinkSvc service can obtain the first status information from the server.

[0021] In one optional implementation, the device status of the first sub-device is determined based on the first status information and the communication connection status between the master device and the first gateway. This includes: if the link service LinkSvc has established a communication connection between the first gateway and the first sub-device, and if the master device has established a first communication connection with the first gateway, then the link service LinkSvc determines that the first sub-device is in a near-field online state. Thus, the link service LinkSvc can determine that the first sub-device is in a near-field online state based on the conditions that the first gateway and the first sub-device have established a communication connection and the master device has established a first communication connection with the first gateway.

[0022] In one optional implementation, the device status of the first sub-device is determined based on the first status information and the communication connection status between the master device and the first gateway. This includes: if the link service LinkSvc has established a communication connection between the first gateway and the first sub-device, and if the master device has established a second communication connection with the first gateway, then the link service LinkSvc determines that the first sub-device is in a far-field online state. Thus, the link service LinkSvc can determine that the first sub-device is in a far-field online state based on both the establishment of a communication connection between the first gateway and the first sub-device and the establishment of a second communication connection between the master device and the first gateway.

[0023] In one optional implementation, after the master device obtains the first status information, the method further includes: the LinkSvc service determining that the first sub-device is offline if the master device and the first gateway have not established a communication connection. Thus, the LinkSvc service can determine that the first sub-device is offline even if the master device and the first gateway have not established a communication connection.

[0024] In one optional implementation, after the master device obtains the first status information, the method further includes: the LinkSvc service determining that the first sub-device is offline if the first gateway and the first sub-device have not established a communication connection. Thus, the LinkSvc service can determine that the first sub-device is offline even if the first gateway and the first sub-device have not established a communication connection.

[0025] In one optional implementation, the master device further includes a device management module (DM), and the method further includes: a link service (LinkSvc) obtaining the historical status of the first sub-device; the link service (LinkSvc) determining whether the current device status of the first sub-device is the same as its historical status; if the current device status of the first sub-device is different from its historical status, the link service (LinkSvc) sending a device status update message to the device management module (DM), the device status update message including the current device status of the first sub-device; and the device management module (DM) updating the device status of the first sub-device based on the status update message. Thus, after the master device determines the device status of the first sub-device, it also needs to determine whether to update the device status of the first sub-device based on its historical status, so as to display the latest device status list to the user in real time, enabling the user to control the first sub-device using the master device.

[0026] In one optional implementation, the master device further includes a device management module (DM), and the method further includes: when the master device and the server have not established a communication connection, the device management module (DM) sends a second request message to the link service (LinkSvc) in response to the establishment of a communication connection between the master device and the server; the link service (LinkSvc) responds to the second request message by sending a first request message to the server; and the link service (LinkSvc) receives a first response message sent by the server in response to the first request message, the first response message including first status information. In this way, the device status list can be updated promptly after the master device reconnects to the network or powers on.

[0027] Secondly, this application also provides a device online status determination system, including: a master device, a first gateway, and at least one first sub-device, wherein the first sub-device is a sub-device associated with the first gateway; the master device is configured to: obtain first status information from the first gateway when the master device and the first gateway have established a first communication connection and the first gateway is not connected to the external network, wherein the first communication connection includes a communication connection between the master device and the first gateway via a local area network, and the first status information includes the communication connection status between the first gateway and at least one first sub-device; the master device is further configured to: determine the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway, wherein: when the first gateway and the first sub-device have established a communication connection, if the master device and the first gateway have established a first communication connection, the master device is configured to determine that the first sub-device is in a near-field online state; when the first gateway and the first sub-device have established a communication connection, if the master device and the first gateway have established a second communication connection, the master device is configured to determine that the first sub-device is in a far-field online state, wherein the second communication connection includes a server-side communication connection between the master device and the gateway via the external network.

[0028] In this embodiment, when the first gateway is disconnected from the external network or cannot connect to the external network, the master device can directly establish a first communication connection with the first gateway through the local area network and directly obtain the first status information from the first gateway. Simultaneously, the master device can determine the device status of the first sub-device based on the communication connection status between the master device and the first gateway, as well as the first status information. In this way, the master device can determine the device status of the first sub-device even when the master device and the first gateway are disconnected from the external network, reducing reliance on the external network when confirming the device status of the first sub-device. This allows for timely updates to the device status of the first sub-device, improving the accuracy of determining the device status and thus enhancing the user experience. Furthermore, when the first sub-device is online, it can distinguish between near-field and far-field online states, enabling the master device to control the first sub-device via near-field or far-field connections.

[0029] In one optional implementation, the master device is further configured to: after obtaining the first status information from the first gateway, determine that the first sub-device is in an offline state if no communication connection is established between the master device and the first gateway. Thus, it can be determined that the first sub-device is offline even if no communication connection is established between the master device and the first gateway.

[0030] In one optional implementation, the master device is further configured to: after obtaining the first status information from the first gateway, determine that the first sub-device is in an offline state if the first gateway and the first sub-device have not established a communication connection. Thus, it can be determined that the first sub-device is in an offline state even if the first gateway and the first sub-device have not established a communication connection.

[0031] In one optional implementation, the master device is further configured to: when the master device has established a second communication connection with the first gateway, and the master device has not established a first communication connection with the first gateway, in response to the establishment of a first communication connection between the master device and the first gateway, add a near-field online state to the first target sub-device. The first target sub-device includes the first sub-device that has established a communication connection with the first gateway. Thus, when the master device has established a second communication connection with the first gateway, the first target sub-device has a far-field online state. In this case, if the master device adds a first communication connection with the first gateway, it can add a near-field online state to the first sub-device, thereby facilitating the control of the first sub-device.

[0032] In one optional implementation, the master device is further configured to: when the master device and the first gateway have not established a second communication connection, in response to the establishment of a second communication connection between the master device and the first gateway, add a far-field online status to the first target sub-device, wherein the first target sub-device includes a first sub-device that has established a communication connection with the first gateway. Thus, when the communication connection status between the first gateway and the master device changes from unconnected to having a second communication connection established, a far-field online status can be added to the first target sub-device to facilitate control of the first sub-device.

[0033] Thirdly, this application also provides an electronic device, including: a display screen, a memory, and one or more processors; the display screen, the memory, and the processors are coupled; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method for determining the online status of the device as described in the first aspect above.

[0034] Fourthly, this application also provides a computer-readable storage medium, characterized in that it includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method for determining the online status of the device as described in the first aspect above.

[0035] Fifthly, this application also provides a computer program product, characterized in that, when the computer program product is run on a computer, it causes the computer to perform the method for determining the online status of a device as described in the first aspect above.

[0036] Understandably, the beneficial effects that the technical solutions provided in the third to fifth aspects above can achieve can be referred to the beneficial effects in the first aspect and any of its optional implementation methods, and will not be repeated here. Attached Figure Description

[0037] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a structural block diagram of an intelligent device control system provided in this embodiment;

[0039] Figure 2 This is a schematic diagram of a user controlling a smart device using a mobile phone, as provided in this embodiment.

[0040] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0041] Figure 4 This is a schematic diagram of the layered architecture of the software system of the electronic device provided in the embodiments of this application;

[0042] Figure 5 This is a structural block diagram of a device online status determination system provided in this embodiment;

[0043] Figure 6 This is the first flowchart of the method for determining the online status of a device provided in this embodiment;

[0044] Figure 7 This is a schematic diagram illustrating a first gateway querying first status information provided in this embodiment;

[0045] Figure 8 This is the second flowchart of the method for determining the online status of a device provided in this embodiment;

[0046] Figure 9 This is the third flowchart of the method for determining the online status of a device provided in this embodiment;

[0047] Figure 10 This is the fourth flowchart of the method for determining the online status of a device provided in this embodiment;

[0048] Figure 11 This is the fifth flowchart of the method for determining the online status of a device provided in this embodiment;

[0049] Figure 12 This is the sixth flowchart of the method for determining the online status of a device provided in this embodiment;

[0050] Figure 13 This is the seventh flowchart of the method for determining the online status of a device provided in this embodiment;

[0051] Figure 14 This is the eighth flowchart of the method for determining the online status of a device provided in this embodiment;

[0052] Figure 15 This is the ninth flowchart of the method for determining the online status of a device provided in this embodiment;

[0053] Figure 16 This is the tenth flowchart of the method for determining the online status of a device provided in this embodiment;

[0054] Figure 17 This is the eleventh flowchart of the method for determining the online status of a device provided in this embodiment;

[0055] Figure 18 This is the twelfth flowchart of the method for determining the online status of a device provided in this embodiment;

[0056] Figure 19 This is the thirteenth flowchart of the method for determining the online status of a device provided in this embodiment;

[0057] Figure 20 This is the fourteenth flowchart of the method for determining the online status of a device provided in this embodiment;

[0058] Figure 21 This is a structural block diagram of a chip system provided in this embodiment. Detailed Implementation

[0059] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are all within the protection scope of this application.

[0060] In the following description, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0061] Furthermore, in this application, directional terms such as "upper," "lower," "inner," and "outer" are defined relative to the indicated placement of the components in the accompanying drawings. It should be understood that these directional terms are relative concepts, used for relative description and clarification, and can change accordingly depending on the placement of the components in the accompanying drawings.

[0062] Smart devices are devices that can use various modern technologies to automate and intelligently control traditional electrical appliances, equipment, and systems, and can be remotely monitored and operated via the Internet. Examples include smart TVs, smart speakers, smart projectors, smart lights, smart curtains, smart printers, smart switches, and smart air conditioners.

[0063] As people's demand for smart living continues to increase, the variety of smart devices on the market is also growing. This allows users to replace traditional devices with smart devices and utilize terminal devices, gateways, and other components to create a control system for these smart devices, enabling them to control the devices.

[0064] Figure 1 This is a structural block diagram of an intelligent device control system provided in this embodiment.

[0065] like Figure 1As shown, the intelligent device control system includes a terminal device 11, a gateway 12, a first intelligent device 13, a second intelligent device 14, a scene cloud 15, a device cloud 16, an over-the-air (OTA) server 17, and a developer website 18.

[0066] Terminal device 11 is the main control device in the intelligent device control system, and can also be called the master device. End users can use terminal device 11 to perform operations such as discovery, registration, control, status reporting, and OTA (Over-The-Air) updates on the first intelligent device 13 and the second intelligent device 14. Terminal device 11 can be a mobile phone, tablet, computer, smartwatch, or other similar devices. Terminal device 11 can directly control the first intelligent device 13 and / or the second intelligent device 14, and can also connect to the Internet and control the first intelligent device 13 and / or the second intelligent device 14 via the Internet.

[0067] The first smart device 13 and the second smart device 14 can be different smart devices. For example, the first smart device 13 can be a smart TV, smart speaker, smart projector, smart light, smart curtains, smart printer, smart switch, and smart air conditioner, etc. The second smart device 14 is similar, and will not be described in detail here. It is understood that the number and types of smart devices in the smart device control system can be selected according to the actual situation, and are not limited in this embodiment.

[0068] The manufacturer of the first smart device 13 may be the same as or different from the manufacturer of the terminal device 11, and the manufacturer of the second smart device 14 may be the same as or different from the manufacturer of the terminal device 11. The manufacturers of the first smart device 13 and the second smart device 14 may be the same as or different from the manufacturer of the terminal device 11. The following explanation will be based on the example where the manufacturer of the first smart device 13 is the same as the manufacturer of the terminal device 11, and the manufacturer of the second smart device 14 is different from the manufacturer of the terminal device 11.

[0069] When the manufacturer of the first smart device 13 is the same as that of the terminal device 11, the first smart device 13 and the terminal device 11 can have the same proprietary communication protocol built in. In this way, the first smart device 13 and the terminal device 11 can communicate with each other using wireless communication technology through the proprietary communication protocol, thereby enabling the terminal device 11 to directly control the first smart device 13.

[0070] Specifically, after the first intelligent device 13 establishes a communication connection with the terminal device 11, the first intelligent device 13 can report its online status to the terminal device 11. If the online status reported by the first intelligent device 13 to the terminal device 11 is online, the terminal device 11 can directly perform near-field control on the first intelligent device 13; if the online status reported by the first intelligent device 13 to the terminal device 11 is offline, the terminal device 11 cannot control the first intelligent device 13.

[0071] When the manufacturer of the second smart device 14 is different from that of the terminal device 11, the second smart device 14 may not have the same proprietary communication protocol as the terminal device 11 built in. Therefore, the second smart device 14 and the terminal device 11 cannot directly communicate using wireless communication technology. In this case, the second smart device 14 can establish a communication connection with the terminal device 11 through the gateway 12 and the Internet, thereby facilitating the terminal device 11's control of the second smart device 14.

[0072] Optionally, wireless communication technologies include, but are not limited to: wireless local area networks (WLAN), wireless fidelity (Wi-Fi) networks, Bluetooth (BT), 5th generation mobile networks (or 5th generation wireless systems, abbreviated as 5G), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc.

[0073] As a core device connecting smart devices and the Internet, gateway 12 can convert the communication protocols used by the first smart device 13 and the second smart device 14 mounted on gateway 12 into Internet standard protocols, enabling the first smart device 13 and the second smart device 14 to connect to the Internet. In this way, second smart devices 14 from different manufacturers can establish communication connections with terminal device 11 through gateway 12 and the Internet, thereby facilitating the control of second smart devices 14 by terminal device 11.

[0074] Furthermore, when the communication protocol used by the second smart device 14 is different from the standard protocol of the Internet, the second smart device 14 cannot directly connect to the Internet. In this case, the second smart device 14 can access the Internet through the gateway 12, thereby enabling the terminal device 11 to use the gateway 12 to realize the perception and control of the second smart device 14. The second smart device 14 can also report its own attributes to the Internet through the gateway 12.

[0075] Exemplarily, the gateway 12 can be an industrial control gateway 12, an Internet of Things gateway 12, a smart home gateway 12, a cloud gateway 12, etc. designed based on a Programmable Logic Controller (PLC). The type and function of the gateway 12 can be selected according to specific uses, and are not limited in this embodiment.

[0076] In the intelligent device control system, the scenario cloud 15, the device cloud 16, and the OTA server 17 can be different modules of the cloud server built on the Internet platform. The cloud server can be used to implement the communication connection between the gateway 12 and the terminal device 11, so as to realize the communication connection between the intelligent device mounted on the gateway 12 device and the terminal device 11.

[0077] The scenario cloud 15 can provide functions such as data storage, analysis, processing, and application services for Internet of Things applications. The scenario cloud 15 can establish a communication connection with the terminal device 11. In this way, the terminal device 11 can upload the scenario editing definition to the scenario cloud 15, where the scenario editing definition includes the set control scenario. Or, the terminal device 11 can also obtain the scenario download and display from the scenario cloud 15, so that the terminal device 11 can realize the linkage control of the intelligent device in the specified scenario through the scenario cloud 15.

[0078] Exemplarily, when the first intelligent device 13 is a smart lamp and the second intelligent device 14 is a smart speaker, the terminal device 11 can set the linkage forms such as turning off the smart speaker while turning off the smart lamp, or turning on the smart speaker while turning off the smart lamp, or turning off the smart speaker while turning on the smart lamp in the control scenario.

[0079] The device cloud 16 can support various types of Internet of Things devices to access the cloud server, and users can conveniently manage the registration, authentication, access of the devices, as well as the remote monitoring and control of the Internet of Things devices by using the device cloud 16. In this way, the control instructions sent by the terminal device 11 can be conveyed to each sub-device through the device cloud 16 to realize the control and management of the sub-devices.

[0080] The OTA server 17 is a server used for remotely updating the firmware and software of Internet of Things devices, and can provide functions such as remotely updating firmware and software updates for Internet of Things devices, thus saving a large amount of labor and time costs.

[0081] According to the above description, in the intelligent device control system as Figure 1 shown, the terminal device 11 can receive and respond to the operations of the terminal user, and use the cloud server and the gateway 12 to realize the control of the first intelligent device 13 and the second intelligent device 14.

[0082] In some embodiments, both the first smart device 13 and the second smart device 14 can be connected to the device cloud 16 via the gateway 12. Since the device cloud 16 can establish communication connections with the scene cloud 15 and the terminal device 11, the terminal device 11 can remotely control the first smart device 13 and the second smart device 14 via the device cloud 16 and the gateway 12, or the terminal device 11 can also remotely control the first smart device 13 and the second smart device 14 via the scene cloud 15, the device cloud 16, and the gateway 12.

[0083] Specifically, the first smart device 13 can report its online status to the gateway 12. The gateway 12 can then report the online status of the first smart device 13 to the device cloud 16. The device cloud 16 then reports the online status of the first smart device 13 to the terminal device 11 and the scene cloud 15. In this way, the user can understand the online status of the first smart device 13 through the terminal device 11. The online status of the first smart device 13 includes online and offline states. When the first smart device 13 is online, the terminal device 11 can control it; when the first smart device 13 is offline, the terminal device 11 cannot control it.

[0084] In one example, if the first smart device 13 is online, the terminal device 11 can control the first smart device 13 through the device cloud 16 and the gateway 12.

[0085] In another example, if the first smart device 13 is online, the terminal device 11 can control the scene of the first smart device 13 through the scene cloud 15, the device cloud 16 and the gateway 12.

[0086] Furthermore, the device cloud 16 is also connected to the OTA server 17, which in turn is connected to the gateway 12. When a developer needs to update the version of the first smart device 13, the developer can upload the OTA version package to the developer website 18. The developer website 18 then uploads the OTA version package to the OTA server 17. The OTA server 17 can then send the OTA version package to the first smart device 13 and the second smart device 14, which are associated with the gateway 12, through the gateway 12. The device cloud 16 can request the OTA server 17 to check the version of the first smart device 13, and the OTA server 17 will then return the version information of the first smart device 13 to the device cloud 16.

[0087] Alternatively, when the developer needs to configure the first smart device 13, the developer can upload the profile configuration file and / or the Prdld third-party device type configuration file to the developer website 18. The developer website 18 will then upload the profile configuration file and / or the Prdld third-party device type configuration file to the device cloud 16, and the device cloud 16 will then perform the configuration operation on the first smart device 13.

[0088] When the manufacturer of the first smart device 13 or the second smart device 14 is the same as the manufacturer of the terminal device 11, the profile configuration file can be used for configuration. When the manufacturer of the first smart device 13 or the second smart device 14 is different from the manufacturer of the terminal device 11, the Prdld third-party device type configuration file can be used for configuration.

[0089] In summary, when the smart device manufacturer and the terminal device have the same proprietary communication protocol built in, the terminal device can control the smart device. However, when the smart device manufacturer and the terminal device do not have the same proprietary communication protocol built in, the smart device can only establish a communication connection with the terminal device through a gateway or cloud server in order for the terminal device to control the smart device.

[0090] The following section takes the application scenario of a smart device control system, with terminal device 11 being a mobile phone and home as an example, to further introduce the control of smart devices.

[0091] Figure 2 This is a schematic diagram of a user controlling a smart device using a mobile phone, as provided in this embodiment.

[0092] like Figure 2 As shown, users can control smart devices using their mobile phones. Specifically, on the main interface 21 of the phone (e.g., ... Figure 2 As shown in (a), various types of application icons can be displayed, such as clock icons, calendar icons, gallery icons, memo icons, file manager icons, video icons, smart space icons, etc. The main screen of the phone can also display a status bar, which may include: one or more signal strength indicators for mobile communication signals, one or more signal strength indicators for Wi-Fi signals, battery level indicators for electronic devices, time indicators, etc.

[0093] The phone can receive and respond to the user's click on the Smart Space icon, launch the Smart Space application (APP), and display as shown below. Figure 2 The Smart Space APP interface 24 is shown in (b) above. The Smart Space APP interface 24 can display the number of smart devices that the user has added to "My Home", information about each smart device, and other function icons.

[0094] The information of a smart device includes its icon, name, location, and online status. The name of the smart device can be user-defined or provided by the manufacturer; this embodiment does not limit the name of the smart device. The function icons in the Smart Space APP interface 24 may include, but are not limited to, home icons, store icons, smart icons, my icons, and add device icons.

[0095] Specifically, Figure 2 As shown in (b), the TV in the living room is online and located in the living room; the TV in the master bedroom is online and located in the master bedroom; the TV in the second bedroom is online and located in the second bedroom; the speakers in the living room are offline and located in the living room; the speakers in the master bedroom are offline and located in the master bedroom; the speakers in the second bedroom are offline and located in the second bedroom; the smart projector is offline and located in the living room; and the router is online and located in the living room. For each smart device, those that are online can be controlled, while those that are offline cannot be controlled.

[0096] For example, when a user wants to control the TV in the living room, the mobile phone can respond to the user's click on the TV icon, and the control phone can jump from the Smart Space APP interface to the TV screen 24 hours later. Figure 2 The living room TV control interface 25 is shown in (c). The living room TV control interface 25 displays operable options for the living room TV. These operable options may include, but are not limited to, power on / off, volume up, and volume down. The mobile phone can respond to the user's clicks on the operable options and control the living room TV to execute the corresponding commands. For example, when the user clicks power off, the mobile phone can control the living room TV to turn off.

[0097] exist Figure 2 In the Smart Space APP interface 24 shown in (b), in response to the user swiping up on the interface, the Smart Space APP interface can also display as follows: Figure 2 The diagram (d) shows the smart scenes and their number. A smart scene can be a first control scene, a second control scene, and a third control scene, set by the user according to their needs, to jointly control multiple smart devices. For example, the user can name the first control scene "Leaving Home" and set it to turn off the TVs, speakers, and projectors in all rooms of the house. The mobile phone can receive and respond to the user's click on the first control scene and, according to the settings of the first control scene, turn off the TVs, speakers, and projectors in each room.

[0098] In the process described above where users control smart devices using their mobile phones, the phone can only control smart devices that are currently online. For example... Figure 2 As shown in (b), the TV in the living room, the TV in the master bedroom, the TV in the second bedroom, and the router are currently online and can be controlled by mobile phone. The speakers in the living room, the speakers in the master bedroom, the speakers in the second bedroom, and the smart projector are currently offline and cannot be controlled by mobile phone.

[0099] Depend on Figure 1 It is understood that the online status of smart devices displayed on the Smart Space app on the mobile phone is reported from the gateway to the device cloud, and then from the device cloud to the scene cloud and the mobile phone, thus enabling the Smart Space app interface to display the online status of each smart device 24 / 7. During the reporting process of smart device online status, the mobile phone and the cloud server need to maintain a connection, as do the cloud server and the gateway. However, when the cloud server's network configuration, firewall configuration, routing settings, or the cloud service provider causes a connection failure, the mobile phone and the gateway may be unable to connect to the cloud server. If either the mobile phone or the gateway loses connection to the cloud server, the online status of the smart devices cannot be reported to the mobile phone, resulting in potentially incorrect online status displayed on the phone.

[0100] In one example, Figure 2 As shown in (b), the living room speaker is currently offline. If the living room speaker is connected to the gateway, and the gateway is connected to the cloud server, the living room speaker will then be back online. However, if the mobile phone loses internet access and cannot connect to the cloud server, the cloud server cannot report the change from offline to online status to the mobile phone, and will continue to display the living room speaker as offline, preventing the user from controlling the living room speaker via the mobile phone.

[0101] In another example, Figure 2 As shown in (b), the living room TV is currently online. If the living room TV disconnects from the gateway, it should then be offline. However, if the mobile phone loses internet access and disconnects from the cloud server, or if the gateway disconnects from the cloud server, the cloud server cannot report the change from online to offline status to the mobile phone, and will continue to display the living room TV as online. If the user attempts to control the living room TV using their mobile phone at this time, the TV will not respond to the control operation, resulting in the user's control operation failing and affecting the user experience.

[0102] To address the aforementioned issues, this application provides a method for determining the online status of a device. This method can determine the online status of a smart device even when the terminal device or gateway is disconnected from the external network server, thereby improving the accuracy of the terminal device in obtaining the online status of the smart device and enhancing the user experience.

[0103] The method for determining the online status of a device provided in this embodiment can be applied to electronic devices. In some embodiments, the electronic device may be a mobile phone, tablet computer, handheld computer, personal computer (PC), ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, and other electronic devices. This application embodiment does not impose any special limitation on the specific type of electronic device.

[0104] For example, taking a mobile phone as an electronic device, Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0105] Reference Figure 3 As shown, the electronic device may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, antenna 1, antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a sensor module 380, a display screen 393, a subscriber identification module (SIM) card interface 394, and a camera 395, etc. The sensor module 380 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.

[0106] Processor 310 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.

[0107] A controller can be the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0108] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 310 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0109] In some embodiments, the processor 310 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0110] The external memory interface 320 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of electronic devices. The external non-volatile memory communicates with the processor 310 through the external memory interface 320 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0111] Internal memory 321 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 310 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The NVM can also store executable programs and user and application data, and can be pre-loaded into the RAM for direct read and write operations by the processor 310.

[0112] The charging management module 340 is used to receive charging input from a power supply device (such as a charger, laptop power supply, etc.). The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 340 can receive charging input from the wired charger via a USB interface 330. In some wireless charging embodiments, the charging management module 340 can receive wireless charging input via the wireless charging coil of the electronic device.

[0113] While charging the battery 342, the charging management module 340 can also supply power to the electronic device through the power management module 341. Specifically, the battery 342 can be composed of multiple batteries connected in series. The power management module 341 is used to connect the battery 342, the charging management module 340, and the processor 310.

[0114] The power management module 341 connects the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, providing power to the processor 310, internal memory 321, display screen 393, camera 395, and wireless communication module 360. The power management module 341 can also monitor parameters such as battery voltage, current, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 341 may also be located within the processor 310.

[0115] The wireless communication function of electronic devices can be achieved through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem, and baseband processor.

[0116] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0117] The mobile communication module 350 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use in electronic devices. The mobile communication module 350 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 350 can be housed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 350 and at least some modules of the processor 310 can be housed in the same device.

[0118] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device or displays an image or video through the display screen 393. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 310 and may be housed in the same device as the mobile communication module 350 or other functional modules.

[0119] The wireless communication module 360 ​​can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 360 ​​can be one or more devices integrating at least one communication processing module. The wireless communication module 360 ​​receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 310. The wireless communication module 360 ​​can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0120] The audio module 370 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module 370 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 370 may be located in the processor 310, or some functional modules of the audio module 370 may be located in the processor 310.

[0121] In some embodiments, an electronic device may include one or N cameras 395, where N is a positive integer greater than 1. In this application embodiment, the type of camera 395 can be distinguished based on hardware configuration and physical location. For example, a camera located on the side of the electronic device's display screen 393 can be called a front-facing camera, and a camera located on the back cover of the electronic device can be called a rear-facing camera; another example is that a camera with a short focal length and a wide field of view can be called a wide-angle camera, while a camera with a long focal length and a narrow field of view can be called a regular camera. Here, focal length and field of view are relative concepts and are not specifically limited by parameters. Therefore, wide-angle cameras and regular cameras are also relative concepts, and can be specifically distinguished based on physical parameters such as focal length and field of view.

[0122] Electronic devices implement display functions through a GPU, a display screen 393, and an application processor. The GPU is a microprocessor for image editing, connected to the display screen 393 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0123] Electronic devices can achieve shooting functions through ISP, camera 395, video codec, GPU, display 393, and application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information. In this embodiment, the GPU's functions are used during the frame rendering process of each image frame to achieve better display effects and performance in the final displayed image.

[0124] The Information Service Provider (ISP) is used to process data fed back from the camera 395. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 395. The camera 395 is used to capture still images or videos.

[0125] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when an electronic device is selecting a frequency, a DSP can perform a Fourier transform on the frequency energy.

[0126] Display screen 393 is used to display images, videos, etc. Display screen 393 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 393, where N is a positive integer greater than 1.

[0127] In this embodiment of the application, the display screen 393 can be used to display pages required by the electronic device (e.g., wizard pages (including highlight recommendation pages and external module access pages), etc.), and display images captured by any one or more cameras 395 in the interface.

[0128] The SIM card interface 394 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 394 to make contact with and detach from the electronic device. The electronic device can support one or more SIM card interfaces. The SIM card interface 394 supports Nano SIM cards, Micro SIM cards, and other SIM cards. Multiple cards can be inserted into the same SIM card interface 394 simultaneously. The SIM card interface 394 is also compatible with external memory cards. The electronic device interacts with the network through the SIM card to achieve functions such as calls and data communication. One SIM card corresponds to one user number.

[0129] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0130] Of course, this is understandable. Figure 3 The illustration shown is merely an example when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet, handheld computer, PC, PDA, wearable device (such as a smartwatch, smart bracelet), or other similar device, the structure of the electronic device may include more advanced features. Figure 3 The fewer structures shown can also include more than Figure 3 The structures shown are not limited here.

[0131] It is understandable that, generally speaking, the implementation of electronic device functions requires not only hardware support but also software cooperation. The software system of electronic devices can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiment uses a layered architecture... Taking the system as an example, the software structure of the electronic device is illustrated.

[0132] Figure 4 This is a schematic diagram of the layered architecture of the software system of the electronic device provided in this application embodiment. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces (e.g., APIs).

[0133] In some examples, refer to Figure 4As shown in this embodiment, the software of the electronic device is divided into five layers, from top to bottom: the application layer, the framework layer (or application framework layer), the system library and Android runtime, the HAL layer (hardware abstraction layer), and the driver layer (or kernel layer). The system library and Android runtime can also be referred to as the native framework layer or the native layer.

[0134] The application layer can include a series of applications. For example... Figure 4 As shown, the application layer can include applications (APPs) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, SMS, call, and smart space.

[0135] In this embodiment, the smart space can control smart devices associated with the gateway and also confirm the online status of the smart devices.

[0136] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes predefined functions or services. For example, the application framework layer may include an activity manager, window manager, content provider, audio service, view system, phone manager, resource manager, notification manager, package manager, etc., but this embodiment does not impose any limitations on these.

[0137] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0138] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.

[0139] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images. In some embodiments, the view system may also include or initiate a rendering thread to perform operations such as drawing framebuffers.

[0140] A phone manager is used to provide communication functionality for electronic devices. For example, a phone manager can manage the call status of a calling application (including initiation, connection, and termination).

[0141] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0142] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0143] Package manager in The package manager is used to manage application packages. It allows applications to obtain detailed information about installed applications and their services, permissions, etc. The package manager is also used to manage events such as application installation, uninstallation, and upgrades.

[0144] The system library can include multiple functional modules, such as the surface manager and media libraries. The surface manager manages the display subsystem and provides 2D and 3D layer blending for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0145] The Hardware Abstraction Layer (HAL) is the interface layer between the operating system kernel and the hardware circuitry, designed to abstract the hardware. It hides the platform-specific hardware interface details, providing the operating system with a virtual hardware platform that is hardware-independent and portable across multiple platforms. The HAL provides a standard interface that exposes device hardware functionality to the higher-level Java API framework (i.e., the framework layer). The HAL contains multiple library modules, each implementing an interface for a specific type of hardware component, such as: audio HAL, Bluetooth HAL, camera HAL (also known as camera HAL or camera hardware abstraction module), and sensors HAL (or i-sensor service).

[0146] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, battery drivers, etc., but this application does not limit this. Specifically, the sensor driver can include the driver for each sensor included in the electronic device, such as an ambient light sensor driver. For example, the ambient light sensor driver can, in response to an indication or instruction from the sensor module to acquire detection data, promptly send the detection data from the ambient light sensor to the sensing module.

[0147] Figure 5 This is a structural block diagram of a device online status determination system provided in this embodiment.

[0148] like Figure 5 As shown, the device online status determination system provided in this embodiment includes a main device 51, an external network server 52, a first gateway 53, and at least one first sub-device 54, wherein the first sub-device 54 is a sub-device associated with the first gateway 53.

[0149] In this embodiment, the main device 51 can be an electronic device such as a mobile phone, tablet, computer, or smart wearable device, which can communicate with the gateway device and the external network server 52, and obtain and control the online status of the sub-devices associated with the gateway device through the gateway device and / or the external network server 52.

[0150] For example, the master device 51 may include, Figure 2 The Smart Space APP 511 shown in (a) is used to control the sub-device. The Smart Space APP 511 may include the application body (APP body 5111), middleware 5112, and Link Service (LinkSvc) 5113.

[0151] Middleware 5112 may include a Device Management (DM) module and a Profile module to implement the management and configuration functions of the master device 51. Among them, DM can realize remote monitoring, configuration, maintenance and management of other devices connected to the master device 51.

[0152] LinkSvc 5113 may include sub-modules such as device discovery, device connection, device networking, and device transmission, thereby enabling the master device 51 to provide functions such as connection, communication, or data transmission between the master device 51 and other devices.

[0153] Since a master device 51 can typically establish a communication connection with at least one gateway device, the first gateway 53 is one of the gateway devices that can establish a communication connection with the master device 51.

[0154] Furthermore, the sub-device can be any smart device capable of being associated with the gateway device. Since a gateway device can typically be associated with at least one sub-device, there is at least one first sub-device 54. In other words, there is at least one first sub-device 54 mounted on the first gateway 53.

[0155] It is worth noting that when the master device 51 can establish communication connections with multiple gateway devices, and each gateway device can be associated with multiple sub-devices, the method by which the master device 51 determines the online status of each sub-device through the gateway devices can be the same. Therefore, in this embodiment, the system and method for determining the online status of devices are introduced using the first gateway 53 and the first sub-device 54 as examples.

[0156] Specifically, the first sub-device 54 can establish a connection with the first gateway 53 through communication protocols such as Bluetooth (BT), Bluetooth Low Energy (BLE), Wi-Fi, or Zigbee.

[0157] In one example, when the first gateway 53 is not connected to the external network, the master device 51 and the first gateway 53 can establish a first communication connection. In this case, the first gateway 53 is in a far-field offline and near-field online state. The first communication connection includes the master device 51 and the first gateway 53 being able to communicate via a local area network, so that the first gateway 53 can directly establish a communication connection with the master device 51.

[0158] It is worth noting that when the main device 51 and the first gateway 53 can establish a first communication connection, it indicates that the main device 51 and the first gateway 53 are on the same local area network (LAN) and both can connect to that LAN. If the main device 51 and the first gateway 53 are not on the same LAN, then the main device 51 and the first gateway 53 cannot establish a first communication connection. Alternatively, if the main device 51 and the first gateway 53 are already on the same LAN, but either of them is in a powered-off state or cannot connect to the LAN, then the main device 51 and the first gateway 53 also cannot establish a first communication connection.

[0159] For example, when the first gateway 53 and the master device 51 are connected to the same local area network at the same time, the first gateway 53 can establish a communication connection with the master device 51 through the Constrained Application Protocol (COAP).

[0160] For example, the first gateway 53 may include a Link Software Development Kit (LinkSDK) module 531, which can establish a communication connection with the LinkSvc service 5113 via COAP. It is understood that the first gateway 53 may also establish a communication connection with the master device 51 via other communication protocols.

[0161] Combination Figure 2 As shown in (b) above, specifically, the process by which the master device 51 and the first gateway 53 establish the first communication connection for the first time can be as follows:

[0162] When the master device 51 is a mobile phone, it can respond to the user clicking the "+" icon by sending a broadcast message to the environment in which it is located. When the first gateway 53 receives the broadcast message sent by the master device 51, it sends an authentication request to the master device 51. When the master device 51 receives the authentication request sent by the first gateway 53 and confirms that authentication is successful, it establishes a first communication connection with the first gateway 53.

[0163] It is worth noting that the broadcast message sent by the master device 51 to the environment can be triggered by the user or sent periodically by the master device 51, and this embodiment does not impose any limitations.

[0164] Please refer to it again. Figure 5 In another example, the first gateway 53 can establish a communication connection with the master device 51 through the external network server 52. In this case, the first gateway 53 is in a far-field online state. The first gateway 53 can establish a communication connection with the external network server 52 through Message Queuing Telemetry Transport (MQTT), and at the same time, the external network server 52 can establish a communication connection with the master device 51 through MQTT, thereby realizing the communication connection between the first gateway 53 and the master device 51.

[0165] Optionally, the external network server 52 serves as the internet platform for communication between the main device 51 and the first gateway 53. It can be a cloud server, a virtual private server, etc., and is not limited in this embodiment.

[0166] For example, the LinkSDK 531 of the first gateway 53 can establish a communication connection with the cloud server through COAP, and the LinkSvc 5113 of the link service can establish a communication connection with the cloud server through COAP, thereby enabling the master device 51 to establish a second communication connection with the first gateway 53.

[0167] Furthermore, when the first gateway 53 is in a far-field online state, it can also be in a near-field online state or a near-field offline state simultaneously. In other words, the second communication connection between the first gateway 53 and the master device 51 includes the first gateway 53 being in a far-field online and near-field offline state, as well as the first gateway 53 being in a far-field online and near-field online state.

[0168] In the device online status determination system provided in this embodiment, the main device 51 can establish a first communication connection with the first gateway 53, and the main device 51 can also establish a second communication connection with the first gateway 53. Thus, when the first gateway 53 disconnects from the main device 51 via the second communication connection, the main device 51 can still establish the first communication connection with the first gateway 53 through the local area network. This allows it to obtain first status information (the connection status between the first sub-device 54 and the first gateway 53) from the first gateway 53 using the first communication connection. Based on the communication connection status between the first gateway 53 and the main device 51 and the first status information, the main device 51 determines the device status of the first sub-device 54, thereby providing the user with an accurate device status for the first sub-device 54. In other words, the device online status determination system can still obtain the device status of the first sub-device 54 in a timely manner even when the first gateway 53 is disconnected from the external network, thereby improving the accuracy of the device status of the first sub-device 54 obtained by the main device 51.

[0169] As explained above, the first sub-device 54 is associated with the first gateway 53, and communication between the first sub-device 54 and the master device 51 requires the assistance of the first gateway 53. If the master device 51 needs to determine the online status of the first sub-device 54, it first needs to understand the communication connection status between the first sub-device 54 and the first gateway 53, and also needs to understand the communication connection status between the first gateway 53 and the master device 51.

[0170] Conversely, if the communication connection status between the first sub-device 54 and the first gateway 53 changes, it will affect the online status of the first sub-device 54. Similarly, a change in the communication connection status between the first gateway 53 and the master device 51 will also affect the online status of the first sub-device 54. The following describes the methods for determining the online status of the first sub-device 54 when the communication connection status between the first sub-device 54 and the first gateway 53 changes, and when the communication connection status between the first gateway 53 and the master device 51 changes, respectively.

[0171] Figure 6 This is the first flowchart of the method for determining the online status of a device provided in this embodiment.

[0172] like Figure 6 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0173] When the first gateway 53 establishes a second communication connection with the master device 51, the communication connection between the first gateway 53 and the master device 51 is in a far-field online state.

[0174] Step S101: The first sub-device 54 goes online and establishes a communication connection with the first gateway 53.

[0175] When the network connecting the first sub-device 54 and the gateway experiences fluctuations in signals such as Wi-Fi or BitTorrent, the first sub-device 54 may lose its connection with the first gateway 53. Alternatively, the first sub-device 54 may lose its connection with the first gateway 53 when its power supply or battery is depleted. Once the connection problem between the first sub-device 54 and the first gateway 53 is resolved, the first sub-device 54 can reconnect and establish a communication connection with the first gateway 53.

[0176] For example, after the first sub-device 54 comes online, it can send a request to establish a communication connection to the first gateway 53, or the first gateway 53 can send a request to establish a communication connection to the first sub-device 54. In this embodiment, the specific method of establishing a communication connection between the first sub-device 54 and the first gateway 53 is not limited.

[0177] Step S102: The first gateway 53 sends the first status information to the server 52.

[0178] The first status information includes the establishment of a communication connection between the first sub-device 54 and the first gateway 53. Thus, when the first gateway 53 establishes a communication connection with the external network server 52, the first gateway 53 can report the communication connection status between the first sub-device 54 and the first gateway 53 to the external network server 52, which in turn reports the status to the main device 51.

[0179] Step S103: Server 52 receives the first status information and sends the first notification message to LinkSvc 5113.

[0180] The first notification message includes first status information. Thus, the external network server 52 can report the communication connection status between the first sub-device 54 and the first gateway 53 to the master device 51, so that the master device 51 can determine the online status of the first sub-device 54.

[0181] Specifically, the first notification message can be notifyld: SUB_DEV_ONLN. Here, notifyld indicates that the message type is a notification message, and SUB_DEV_ONLN indicates that the first sub-device 54 has established a communication connection with the first gateway 53. It is understood that in other embodiments, the external network server 52 can also send the first status information to the master device 51 through other types of messages; this is not limited in this embodiment.

[0182] Step S104: LinkSvc 5113 obtains the first notification message sent by server 52.

[0183] As described above, LinkSvc 5113 can establish a communication connection with server 52 and transmit data. Thus, LinkSvc 5113 can receive the first notification message sent by server 52, thereby obtaining the communication connection status between the first sub-device 54 and the first gateway 53.

[0184] Step S105: The first sub-device 54 goes offline and disconnects from the first gateway 53.

[0185] As can be seen from the description of step S101 above, when a problem occurs in the communication connection between the first sub-device 54 and the first gateway 53, the first sub-device 54 will go offline and disconnect from the first gateway 53.

[0186] It is worth noting that the problem causing the first sub-device 54 to lose communication with the first gateway 53 could originate from the first gateway 53 itself, such as an error in the protocol configuration of the first gateway 53. Alternatively, the problem could also originate from the first sub-device 54, such as a power outage. Furthermore, the problem could also stem from the external environment, such as an anomaly in the network used to establish the communication connection between the first sub-device 54 and the first gateway 53.

[0187] Step S106: The first gateway 53 sends the first status information to the server 52.

[0188] The first status information includes the first sub-device 54 disconnecting from the first gateway 53. Thus, when the first gateway 53 establishes a communication connection with the external network server 52, the first gateway 53 can report the communication connection status between the first sub-device 54 and the first gateway 53 to the external network server 52, which in turn reports it to the main device 51.

[0189] Step S107: Server 52 receives the first status information and sends a second notification message to LinkSvc 5113.

[0190] The second notification message includes the first status information. Thus, the external network server 52 can report the communication connection status between the first sub-device 54 and the first gateway 53 to the master device 51, so that the master device 51 can determine the online status of the first sub-device 54.

[0191] Specifically, the second notification message can be notifyld: SUB_DEV_OFFLN. Here, notifyld indicates that the message type is a notification message, and SUB_DEV_OFFLN indicates that the first sub-device 54 has disconnected its communication connection with the first gateway 53. It is understood that in other embodiments, the external network server 52 can also send the first status information to the master device 51 through other types of messages; this is not limited in this embodiment.

[0192] Step S108: LinkSvc 5113 obtains the second notification message sent by server 52.

[0193] It is worth noting that the explanation of step S108 above can be referred to step S104 above, and will not be repeated here.

[0194] In this embodiment, there is at least one first sub-device 54 associated with the first gateway 53. When the communication connection status between the first gateway 53 and any one of the first sub-devices 54 changes, the first gateway 53 sends the ID of the first sub-device 54 and its communication connection status with the first gateway 53 to the server 52 on the external network. At this time, the first status information may only include the communication connection status of one first sub-device 54 with the first gateway 53. If the communication connection status of multiple first sub-devices 54 associated with the first gateway 53 changes, the first gateway 53 can sequentially send the communication connection status of each first sub-device 54 to the server 52 on the external network, and the server 52 will then sequentially receive and send notification information to the main device 51. In other words, in steps S101-S108 above, the first status information includes the communication connection status of one first sub-device 54 with the first gateway 53.

[0195] It is understood that the processes described in steps S101-S104 above are the process by which the first gateway 53 and the external network server 52 report to the main device 51 that the first sub-device 54 has established a communication connection with the first gateway 53. The processes described in steps S105-S108 above are the process by which the first gateway 53 and the external network server 52 report to the main device 51 that the first sub-device 54 has disconnected from the first gateway 53. In some methods for determining the online status of a device, only one of these processes may occur, or both may occur. When both processes S101-S104 and S105-S108 occur, this embodiment does not limit the order in which they occur.

[0196] When the first gateway 53 establishes a first communication connection with the main device 51, the first gateway 53 is not connected to the external network, and the first gateway 53 and the main device 51 are directly connected through the local area network. The communication connection between the first gateway 53 and the main device 51 is in a state of far-field offline and near-field online. The method for determining the online status of the device includes the following steps S109-S112.

[0197] Step S109: The first sub-device 54 goes online and establishes a communication connection with the first gateway 53; or, the first sub-device 54 goes offline and disconnects the communication connection with the first gateway 53.

[0198] It is worth noting that the explanation of step S109 can be found in steps S101 and S105 above, and will not be repeated here.

[0199] Step S110: The first gateway 53 periodically queries the first status information.

[0200] Combination Figure 5 As shown, when the master device 51 establishes a first communication connection with the first gateway 53, and the first gateway 53 is not connected to the external network, the first gateway 53 is in a far-field offline and near-field online state. The master device 51 can directly establish a communication connection with the first gateway 53, and the first gateway 53 can establish a communication connection with the first sub-device 54. The communication connection between the master device 51 and the first sub-device 54 can be achieved through the first gateway 53.

[0201] The first status information includes the communication connection status between the first gateway 53 and at least one first sub-device 54.

[0202] For example, when the first gateway 53 is not connected to the external network, the first gateway 53 can periodically query the first status information. In other words, the first gateway 53 can periodically query the communication connection status between the first sub-device 54 associated with the first gateway 53 and the first gateway 53 according to a set period. This is so that the master device 51 can determine the online status of the first sub-device 54.

[0203] Specifically, since the number of first sub-devices 54 associated with the first gateway 53 is usually quite large, the first gateway 53 can query the communication connection status between each first sub-device 54 and the first gateway 53 in batches during each query cycle.

[0204] Furthermore, when the first gateway 53 queries in batches, the number of first sub-devices 54 queried in each batch can be 5, 8, or 10, etc., which is not limited in this embodiment.

[0205] Figure 7 This is a schematic diagram of a first gateway querying first status information provided in this embodiment.

[0206] like Figure 7 As shown, exemplarily, when the first gateway 53 is not connected to the external network, the first gateway 53 begins to periodically query the first status information. If the number of first sub-devices 54 associated with the first gateway 53 is 30, and the numbers of the first sub-devices 54 are 1-30, Figure 7 The suffix of each first sub-device 54 indicates its number. In the first query cycle, the first gateway 53 can first query and store the communication connection status between the first sub-devices 54 numbered 1-10 and the first gateway 53. Then, the first gateway 53 can continue to query and store the communication connection status between the first sub-devices 54 numbered 11-20 and the first gateway 53. Finally, the first gateway 53 can continue to query and store the communication connection status between the first sub-devices 54 numbered 21-30 and the first gateway 53. In this way, within one query cycle, the first gateway 53 can batch-traverse all associated first sub-devices 54 to understand the communication connection status between each first sub-device 54 and the first gateway 53. In the next query cycle, the first gateway 53 repeats the above process to update the communication connection status between each first sub-device 54 and the first gateway 53 in a timely manner.

[0207] It is worth noting that step S109 can occur repeatedly during the process of step S110 described above. When the first gateway 53 is offline in the far field, step S110 is performed continuously.

[0208] Step S111: LinkSvc 5113 sends a synchronization message to the first gateway 53.

[0209] The synchronization message includes the first synchronization status information.

[0210] In this embodiment, when the first gateway 53 is disconnected from the external network and the first gateway 53 is connected to the master device 51 via a local area network, LinkSvc 5113 can directly request the first status information from the first gateway 53. Thus, even if the first gateway 53 disconnects its far-field connection, the master device 51 can still promptly determine the online status of the first sub-device 54, avoiding situations where the accurate online status of the first sub-device 54 cannot be obtained during the first gateway 53's network outage, thereby improving the accuracy of determining the online status of the first sub-device 54.

[0211] For example, the synchronization message can be SYNC_SUB_DEV_ONLINE. Here, SYNC (Synchronization) indicates that the message type is a synchronization message, and SUB_DEV_ONLINE indicates that the data to be synchronized is the communication connection status between the first sub-device 54 and the first gateway 53. It is understood that in other embodiments, LinkSvc 5113 may also send other messages to the first gateway 53 to request the communication connection status between the first sub-device 54 and the first gateway 53; this is not limited in this embodiment.

[0212] Step S112: The first gateway 53 receives the synchronization message and sends the first status information to LinkSvc 5113.

[0213] In this embodiment, after the first gateway 53 receives the synchronization message from the master device 51, it can send the currently queried first status information to LinkSvc 5113 based on the timed query results, so as to synchronize the communication connection status between the first sub-device 54 associated with the first gateway 53 and the first gateway 53 with the master device 51.

[0214] For example, when the first gateway 53 synchronizes the first status information with the master device 51, the first gateway 53 can send a first list to the LinkSvc 5113. The first list includes the device IDs (identification numbers) of all first sub-devices 54 associated with the first gateway 53 and their corresponding communication connection statuses with the first gateway 53. In this way, the first gateway 53 can send all the information of the first sub-devices 54 associated with the first gateway 53 to the master device 51 at once.

[0215] It is worth noting that in other embodiments, when LinkSvc 5113 sends a synchronization message to the first gateway 53, the synchronization message may include the device ID of the first sub-device 54 that needs to be provided, and the first gateway 53 sends the information of the first sub-device 54 specified by the master device 51 to the master device 51, thereby realizing the acquisition of the communication connection status between the specified first sub-device 54 and the first gateway 53.

[0216] Step S113: LinkSvc 5113 receives the first status information sent by the first gateway 53.

[0217] In this way, LinkSvc 5113 can obtain the communication connection relationship between the first sub-device 54 associated with the first gateway 53 and the first gateway 53.

[0218] As explained above, the first status information may include the communication connection status between the first gateway 53 and at least one first sub-device 54. When the communication connection status between the first sub-device 54 and the first gateway 53 changes, the first status information will also change accordingly. When determining the online status of the first sub-device 54, it is first necessary to determine the updated first status information.

[0219] Furthermore, a first communication connection or a second communication connection can be established between the master device 51 and the first gateway 53. When the communication connection methods between the master device 51 and the first gateway 53 are different, the method by which the master device 51 obtains the first status information will also differ. When the master device 51 and the first gateway 53 establish a first communication connection, i.e., the first gateway 53 is in a far-field offline and near-field online state, the communication connection status between the first gateway 53 and the first sub-device 54 can be obtained through the aforementioned steps S109-S113. When the master device 51 and the first gateway 53 establish a second communication connection, i.e., the first gateway 53 is in a far-field online and near-field online or far-field online and near-field offline state, the communication connection status between the first gateway 53 and the first sub-device 54 can be obtained through the aforementioned steps S101-S108. In this way, even when the main device 51 and the first gateway 53 cannot establish a communication connection with the external network server 52, the main device 51 can still obtain the communication connection status between the first gateway 53 and the first sub-device 54, thereby improving the accuracy of determining the online status of the first sub-device 54.

[0220] Furthermore, when the master device 51 establishes a second communication connection with the first gateway 53, regardless of whether the first gateway 53 is online in the near field, it obtains the first status information through the external network server 52, which can reduce the number of queries to the first gateway 53 and thus reduce resource consumption.

[0221] Please refer to it again. Figure 6 Methods for determining the online status of equipment also include:

[0222] Step S114: LinkSvc 5113 obtains the communication connection status between the first gateway 53 and the master device 51.

[0223] In this embodiment, after the master device 51 obtains the connection status between the first gateway 53 and the first sub-device 54, the master device 51 can obtain the communication connection status between the first gateway 53 and the master device 51 again, thereby preventing the communication connection status between the first gateway 53 and the master device 51 from changing, which would cause the master device 51 to make an incorrect judgment on the online status of the first sub-device 54.

[0224] Step S115: LinkSvc 5113 determines the device status of the first sub-device 54 based on the first status information and the communication connection status between the first gateway 53 and the master device 51.

[0225] The device status of the first sub-device 54 includes near-field online status, far-field online status, and offline status. The LinkSvc 5113 determines the device status of the first sub-device 54 based on the first status information and the communication connection between the first gateway 53 and the master device 51, as detailed in Table 1.

[0226] Table 1

[0227]

[0228] As shown in Table 1, when a communication connection is established between the first gateway 53 and the first sub-device 54, if the master device 51 and the first gateway 53 establish a first communication connection, LinkSvc 5113 can determine that the first sub-device 54 is in a near-field online state. When a communication connection is established between the first gateway 53 and the first sub-device 54, if the master device 51 and the first gateway 53 establish a second communication connection, LinkSvc 5113 can determine that the first sub-device 54 is in a far-field online state. When no communication connection is established between the first gateway 53 and the first sub-device 54, or between the first gateway 53 and the master device 51, LinkSvc 5113 can determine that the first sub-device 54 is in an offline state.

[0229] In this embodiment, according to Figure 6 As shown, when the communication connection status between the first sub-device 54 and the first gateway 53 changes, the master device 51 can directly receive the first status information pushed by the external network server 52 when the first gateway 53 is online in the far field; the master device 51 can also request the first status information from the first gateway 53 when the first gateway 53 is offline in the far field and online in the near field. In other words, when the first gateway 53 cannot connect to the external network, the master device 51 can still obtain the first status information directly from the first gateway 53 through the local area network. In this way, when determining the online status of the first sub-device 54, the dependence on the external network can be reduced, and even when the master device 51 and the first gateway 53 are disconnected from the external network, the device status of the first sub-device 54 can still be updated, thereby displaying a relatively accurate device status to the user, facilitating user control and improving the user experience.

[0230] Figure 8 This is the second flowchart of the method for determining the online status of a device provided in this embodiment.

[0231] Combination Figure 6 and Figure 8 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 6 In addition to:

[0232] Step S116: LinkSvc 5113 obtains the historical status of the first sub-device 54.

[0233] In this embodiment, after LinkSvc 5113 determines the device status of the first sub-device 54, it also needs to determine whether the device status of the first sub-device 54 needs to be updated on the main APP 5111. Therefore, LinkSvc 5113 can obtain the historical status of the first sub-device 54 stored internally to determine whether an update is needed.

[0234] Step S117: LinkSvc 5113 determines whether the current device state of the first sub-device 54 is the same as its historical state.

[0235] In this embodiment, LinkSvc 5113 determines whether an update message needs to be sent to DM and APP main body 5111 by judging whether the current device state of the first sub-device 54 is the same as the historical state.

[0236] Step S118: If the current device status of the first sub-device 54 is different from the historical status, LinkSvc 5113 sends a device status update message to DM.

[0237] The device status update message includes the current device status of the first sub-device 54.

[0238] In one example, if the current device status of the first sub-device 54 is near-field online, and the historical status is far-field online or offline, then it can be determined that the current device status of the first sub-device 54 is different from the historical status. LinkSvc 5113 sends a device status update message to DM to update the device status of the first sub-device 54 to near-field online.

[0239] In another example, if the current device status of the first sub-device 54 is far-field online, and the historical status is near-field online or offline, then it can be determined that the current device status of the first sub-device 54 is different from the historical status. LinkSvc 5113 sends a device status update message to DM to update the device status of the first sub-device 54 to far-field online.

[0240] In another example, if the current device status of the first sub-device 54 is offline, and its historical status is near-field online or far-field online, then it can be determined that the current device status of the first sub-device 54 is different from its historical status. LinkSvc 5113 sends a device status update message to DM to update the device status of the first sub-device 54 to offline.

[0241] It is worth noting that if the current device state of the first sub-device 54 is the same as its historical state, then the master device 51 does not need to update the device state of the first sub-device 54, and LinkSvc 5113 can stop sending messages to DM, and the process can end.

[0242] Step S119: Based on the status update message, DM updates the device status of the first sub-device 54.

[0243] In this embodiment, when the DM receives the status update message, it will update the device status of the first sub-device 54 to facilitate subsequent control of the first sub-device 54.

[0244] Step S120: DM determines whether it is necessary to send the device status update message of the first sub-device 54 to the APP main body 5111.

[0245] In this embodiment, the main APP 5111 only displays the device status of the first sub-device 54 as online or offline, so that the user can understand whether the main device 51 can control the first sub-device 54. When the first sub-device 54 is online, the main device 51 can respond to the user's operation and control the first sub-device 54. At this time, the DM needs to determine whether the first sub-device 54 is in the far field or near field online to determine the transmission path of the control message, thereby realizing the control of the first sub-device 54.

[0246] When the main APP 5111 displays that the first sub-device 54 is online, if the DM updates the device status of the first sub-device 54 from far-field online to near-field online, the main APP 5111 does not need to be updated; if the DM updates the device status of the first sub-device 54 from far-field online to offline or from near-field online to offline, the main APP 5111 needs to be updated.

[0247] Step S121: DM sends the device status update message of the first sub-device 54 to the APP main body 5111.

[0248] In this embodiment, when the APP main body 5111 displays the first sub-device 54 as online, but the DM updates the first sub-device 54 to offline, the DM sends a message to the APP main body 5111 updating the device status of the first sub-device 54 to offline. Alternatively, when the APP main body 5111 displays the first sub-device 54 as offline, but the DM updates the first sub-device 54 to near-field online or far-field online, the DM sends a message to the APP main body 5111 updating the device status of the first sub-device 54 to online.

[0249] It is worth noting that when the DM determines that it does not need to send the device status update message of the first sub-device 54 to the APP main body 5111, the DM needs to send a message to the APP main body 5111, and the process can end.

[0250] Step S122: The main APP 5111 updates the device status of the first sub-device 54 based on the status update message.

[0251] In this embodiment, if the APP main body 5111 receives a status update message, it will update the device status of the first sub-device 54 to display the accurate device status of the first sub-device 54 to the user.

[0252] In this embodiment, after the master device 51 determines the device status of the first sub-device 54, it also needs to determine whether the device status of the first sub-device 54 needs to be updated based on the historical status of the first sub-device 54, so as to display the latest device status list to the user in real time, so that the user can control the first sub-device 54 using the master device 51.

[0253] Figure 9 This is the third flowchart of the method for determining the online status of a device provided in this embodiment.

[0254] like Figure 9 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0255] Step S201: The first gateway 53 establishes a communication connection with the server 52.

[0256] In this embodiment, after the first gateway 53 establishes a communication connection with the server 52, the first gateway 53 can communicate with the master device 51 through the server 52. Thus, a second communication connection is established between the first gateway 53 and the master device 51, meaning the first gateway 53 is in a far-field online state.

[0257] Step S202: Server 52 sends a third notification message to LinkSvc 5113.

[0258] The third notification message includes the status that the first gateway 53 and the server 52 have established a communication connection. In this way, the server 52 can report the status of the established communication connection between the first gateway 53 and the server 52 to LinkSvc 5113, thereby enabling LinkSvc 5113 to establish a second communication connection with the first gateway 53 and determine that the first gateway 53 is in a far-field online state.

[0259] Specifically, the third notification message can be notifyld: DEV_ONLN. Here, notifyld indicates that the message type is a notification message, and DEV_ONLN indicates that the server 52 has established a communication connection with the first gateway 53. It is understood that in other embodiments, the external server 52 can also send the message indicating the establishment of a communication connection between the server 52 and the first gateway 53 to the master device 51 through other types of messages; this is not limited in this embodiment.

[0260] Step S203: LinkSvc 5113 determines the establishment of a second communication connection with the first gateway 53 based on the third notification message, and sends the online status of the first gateway 53 to DM.

[0261] In this embodiment, when LinkSvc 5113 determines that a second communication connection has been established with the first gateway 53 based on the third notification message, that is, when the first gateway 53 is in a far-field online state, LinkSvc 5113 will also send the online status of the first gateway 53 to DM so that DM can determine whether the first gateway 53 can be controlled through the server 52 when needed.

[0262] During steps S201-S203 described above, the first gateway 53 and the master device 51 establish a second communication connection. Thus, the first gateway 53 can send first status information to LinkSvc 5113 via the server 52, enabling LinkSvc 5113 to determine the device status of the first sub-device 54.

[0263] Step S204: LinkSvc 5113 traverses the first sub-device 54 associated with the first gateway 53 and obtains the first status information.

[0264] In this embodiment, since there may be multiple gateway devices connected to the main device 51, and each gateway device may be associated with more than one sub-device, the number of sub-devices that can communicate with the main device 51 is the sum of the sub-devices associated with each gateway device. When the first gateway 53 establishes a second communication connection with the main device 51, the main device 51 needs to determine which sub-devices are the first sub-devices 54. Therefore, LinkSvc 5113 needs to traverse the first sub-devices 54 associated with the first gateway 53 to determine which sub-devices the first gateway 53 can connect to and control.

[0265] When the first gateway 53 and the master device 51 have established a second communication connection, after determining the mounting relationship of the first gateway 53, LinkSvc 5113 also needs to obtain the first status information in order to determine the device status of the first sub-device 54.

[0266] Specifically, when the first gateway 53 and the master device 51 have established a second communication connection, the process of LinkSvc 5113 obtaining the first status information can be referred to steps S101-S108, which will not be repeated here.

[0267] Step S205: LinkSvc 5113 determines the first target sub-device based on the first status information.

[0268] The first target sub-device includes a first sub-device 54 that has established a communication connection with the first gateway 53.

[0269] In this embodiment, the first status information includes the communication connection status between the first gateway 53 and the first sub-device 54 associated with the first gateway 53. Among all the first sub-devices 54 associated with the first gateway 53, the sub-device that has established a communication connection with the first gateway 53 is the first target sub-device, thus facilitating the determination of the device status of the first target sub-device. Simultaneously, since the device status of the first sub-device 54 needs to consider two conditions—the communication connection status between the first sub-device 54 and the first gateway 53, and the communication connection status between the first gateway 53 and the master device 51—if either of these two conditions is not established, the first sub-device 54 can be determined to be in an offline state. Therefore, all other first sub-devices 54 that have not established a communication connection with the first gateway 53 are in an offline state.

[0270] Step S206: LinkSvc 5113 sends a message to DM to add far-field online status for the first target sub-device.

[0271] In this embodiment, steps S204-S206 are based on the premise that the first gateway 53 and the master device 51 have established a second communication connection. If the first status information shows that the first sub-device 54 has established a communication connection with the first gateway 53, then LinkSvc 5113 can determine that the first sub-device 54 is in a far-field online state. If the first status information shows that the first sub-device 54 and the first gateway 53 have not established a communication connection, then LinkSvc 5113 can determine that the first sub-device 54 is in an offline state.

[0272] Figure 10 This is the fourth flowchart of the method for determining the online status of a device provided in this embodiment.

[0273] like Figure 9 and Figure 10 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 9 In addition to this, it also includes:

[0274] Step S207: The first gateway 53 disconnects from the server 52.

[0275] In this embodiment, after the first gateway 53 establishes a communication connection with the server 52, if there are problems with the power supply, network, protocol configuration, etc. of the first gateway 53, the communication connection between the first gateway 53 and the server 52 will be disconnected.

[0276] Step S208: Server 52 sends a fourth notification message to LinkSvc 5113.

[0277] The fourth notification message includes the status that the first gateway 53 has disconnected from the server 52. This allows the server 52 to report the disconnection status between itself and the first gateway 53 to LinkSvc 5113, thus enabling LinkSvc 5113 to determine that the second communication connection with the first gateway 53 has been disconnected.

[0278] Specifically, the fourth notification message can be notifyld: DEV_OFFLN. Here, notifyld indicates that the message type is a notification message, and DEV_OFFLN indicates that the server 52 has disconnected from the first gateway 53. It is understood that in other embodiments, the external server 52 can also send a message indicating that the server 52 has disconnected from the first gateway 53 to the master device 51 using other types of messages; this is not limited in this embodiment.

[0279] Step S209: LinkSvc 5113 receives the fourth notification message, confirms that the second communication connection with the first gateway 53 has been disconnected, and sends the message that the first gateway 53 has disconnected the second communication connection with the master device 51 to DM.

[0280] In this embodiment, when LinkSvc 5113 receives the fourth notification message, it can determine that the second communication connection with the first gateway 53 has been disconnected, i.e., the first gateway 53 is in a far-field offline state. LinkSvc 5113 can report the far-field offline state of the first gateway 53 to the DM for the management and control of the DM.

[0281] Step S210: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0282] exist Figure 9In the method shown, among the first sub-devices 54 associated with the first gateway 53, the first sub-device 54 that has established a communication connection with the first gateway 53 is the first target sub-device, and it has been determined in step S206 that the first target sub-device has a far-field online state. However, when LinkSvc 5113 determines that the first gateway 53 is in a far-field offline state, it indicates that the device state of the first target sub-device associated with the first gateway 53 will also change. Therefore, it is necessary to traverse the first target sub-devices associated with the first gateway 53 again to provide a basis for subsequently adjusting the device state of the first target sub-device.

[0283] Step S211: LinkSvc 5113 sends a message to DM to add far-field offline status for the first target sub-device.

[0284] In this embodiment, when the first target sub-device is in a far-field online state, if the first gateway 53 changes from a far-field online state to a far-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, so as to facilitate the DM's management and control of the first target sub-device, and provide users with more accurate device status, thereby improving the user experience.

[0285] It is worth understanding that when the first sub-device 54 changes from a far-field online state to a far-field offline state, the online state needs to be updated to an offline state on the main APP 5111. The update of the device state of the first sub-device 54 can be referred to the above steps S116-S122, which will not be repeated here.

[0286] Figure 11 This is the fifth flowchart of the method for determining the online status of a device provided in this embodiment.

[0287] like Figure 11 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0288] Step S301: The first gateway 53 establishes a communication connection with the external network server 52.

[0289] Step S302: Server 52 sends a third notification message to LinkSvc 5113.

[0290] Step S303: LinkSvc 5113 determines the establishment of a second communication connection with the first gateway 53 based on the third notification message, and sends the online status of the first gateway 53 to DM.

[0291] Step S304: LinkSvc 5113 traverses the first sub-device 54 associated with the first gateway 53 and obtains the first status information.

[0292] Step S305: LinkSvc 5113 determines the first target sub-device based on the first status information.

[0293] Step S306: LinkSvc 5113 sends a message to DM to add far-field online status for the first target sub-device.

[0294] It is worth noting that the explanation of steps S301-S306 above can be referred to steps S201-S206, and will not be repeated here.

[0295] Step S307: The first gateway 53 sends an authentication request to LinkSvc 5113.

[0296] In this embodiment, when the first gateway 53 and the master device 51 are in the same local area network, the first gateway 53 can send an authentication request to the master device 51 to request the establishment of a first communication connection with the master device 51.

[0297] Step S308: LinkSvc 5113 receives the authentication request, completes the authentication, and establishes a first communication connection with the first gateway 53.

[0298] In this embodiment, LinkSvc 5113 can receive the authentication request sent by the first gateway 53 and complete the authentication, thereby establishing a first communication connection with the first gateway 53 so that the first gateway 53 is in a near-field online state.

[0299] Step S309: LinkSvc 5113 sends the online status of the first gateway 53 to DM.

[0300] In this embodiment, when the first gateway 53 establishes a first communication connection with the master device 51, that is, when the first gateway 53 is in near-field online, LinkSvc 5113 can send the online status of the first gateway 53 to the DM so that the DM can determine whether the first gateway 53 can be controlled by the server 52 when needed.

[0301] It is worth noting that, according to steps S301-S306 above, the first gateway 53 is in a far-field online state, and the first target sub-device is also in a far-field online state. However, according to steps S307-S309 above, the first gateway 53 is now near-field online, meaning that while the first gateway 53 and the master device 51 have established a second communication connection but not a first communication connection, the first gateway 53 establishes a second communication connection with the master device 51.

[0302] Step S310: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0303] In this embodiment, as can be seen from steps S301-S306 above, the first target sub-device has a far-field online state. When LinkSvc 5113 determines that the first gateway 53 is in a near-field online state, LinkSvc 5113 needs to add a near-field online state to the first target sub-device. Therefore, LinkSvc 5113 reconfirms the first target sub-device associated with the first gateway 53 to determine which sub-devices to add a near-field online state to.

[0304] Step S311: LinkSvc 5113 sends a message to DM to add near-field online status for the first target sub-device.

[0305] In this embodiment, when the first sub-device 54 is in a far-field online state, if the first gateway 53 adds a first communication connection with the master device 51, i.e., the first gateway 53 adds a near-field online state, LinkSvc 5113 can add a near-field online state for the first sub-device 54 and synchronize the device status of the first sub-device 54 to the DM. Thus, when the device management DM manages and controls the first sub-device 54, it can preferentially control the first sub-device 54 through the first communication connection between the first gateway 53 and the master device 51. Compared to when the DM controls the first sub-device 54 through a second communication connection between the first gateway 53 and the master device 51, the communication path of the first communication connection can directly transmit control signals to the first gateway 53 without relying on the external network server 52 for forwarding. It can also avoid control delays caused by external network latency, thereby improving the response speed of the first sub-device 54 to control signals.

[0306] Figure 12 This is the sixth flowchart of the method for determining the online status of a device provided in this embodiment.

[0307] like Figure 11 and Figure 12 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 11 In addition to this, it also includes:

[0308] Step S312: The first gateway 53 disconnects from the server 52.

[0309] In this embodiment, after the first gateway 53 establishes a communication connection with the server 52, if there are problems with the power supply, network, protocol configuration, etc. of the first gateway 53, the communication connection between the first gateway 53 and the server 52 will be disconnected.

[0310] Step S313: Server 52 sends a fifth notification message to LinkSvc 5113.

[0311] The fifth notification message includes the status that the first gateway 53 has disconnected from the server 52. This allows the server 52 to report the disconnection status between itself and the first gateway 53 to LinkSvc 5113, thus enabling LinkSvc 5113 to determine that the second communication connection with the first gateway 53 has been disconnected.

[0312] Specifically, the fifth notification message can be notifyld: DEV_OFFLN. Here, notifyld indicates that the message type is a notification message, and DEV_OFFLN indicates that the server 52 has disconnected from the first gateway 53. It is understood that in other embodiments, the external server 52 can also send a message indicating that the server 52 has disconnected from the first gateway 53 to the master device 51 using other types of messages; this is not limited in this embodiment.

[0313] Step S314: LinkSvc 5113 receives the fifth notification message, confirms that the second communication connection with the first gateway 53 is disconnected, and sends the message that the first gateway 53 has disconnected the second communication connection with the master device 51 to DM.

[0314] In this embodiment, after LinkSvc 5113 receives the fifth notification message, it can determine that the second communication connection with the first gateway 53 has been disconnected, i.e., the first gateway 53 is in a far-field offline state. LinkSvc 5113 can report the far-field offline state of the first gateway 53 to the DM for the management and control of the DM.

[0315] Step S315: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0316] exist Figure 11 In the method shown, among the first sub-devices 54 associated with the first gateway 53, the first sub-device 54 that has established a communication connection with the first gateway 53 is the first target sub-device. In step S306, it was determined that the first target sub-device is in a far-field online state, and in step S311, it was determined that the first target sub-device is in a near-field online state. However, when LinkSvc 5113 determines that the first gateway 53 is in a far-field offline state, it indicates that the device state of the first target sub-device associated with the first gateway 53 will also change. Therefore, it is necessary to iterate through the first target sub-devices associated with the first gateway 53 again to provide a basis for subsequently adjusting the device state of the first target sub-device.

[0317] Step S316: LinkSvc 5113 sends a message to DM to add far-field offline status for the first target sub-device.

[0318] In this embodiment, when the first target sub-device is in a far-field online state, if the first gateway 53 changes from a far-field online state to a far-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, thereby facilitating the DM's management and control of the first target sub-device.

[0319] Understandably, since the first communication connection between the first gateway 53 and the master device 51 remains unchanged, the near-field online status of the first target sub-device does not need to be changed. After step S316, the first target sub-device is in a far-field offline and near-field online state.

[0320] Furthermore, when the first sub-device 54 changes from far-field online and near-field online status to far-field offline and near-field online status, the device status of the first sub-device 54 is still displayed as online on the APP main body 5111. At this time, the APP main body 5111 does not need to update the device status of the first sub-device 54.

[0321] Figure 13 This is the seventh flowchart of the method for determining the online status of a device provided in this embodiment.

[0322] like Figure 11 and Figure 13 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 11 In addition to this, it also includes:

[0323] Step S317: The first gateway 53 disconnects the first communication connection with LinkSvc 5113.

[0324] In this embodiment, if the power supply, network, protocol configuration, etc. of the first gateway 53 master device 51 are damaged after the first communication connection is established, the first communication connection of the first gateway 53 master device 51 will be disconnected.

[0325] Step S318: LinkSvc 5113 sends a message to DM that the first gateway 53 has disconnected the first communication connection with the master device 51.

[0326] In this embodiment, when LinkSvc 5113 determines that the master device 51 has disconnected the first communication connection with the first gateway 53, that is, the first gateway 53 is in a near-field offline state, LinkSvc 5113 can report the near-field offline state of the first gateway 53 to DM so as to facilitate the management and control of DM.

[0327] Step S319: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0328] exist Figure 11 In the method shown, among the first sub-devices 54 associated with the first gateway 53, the first sub-device 54 that has established a communication connection with the first gateway 53 is the first target sub-device. In step S306, it was determined that the first target sub-device is in a far-field online state, and in step S311, it was determined that the first target sub-device is in a near-field online state. However, when LinkSvc 5113 determines that the first gateway 53 is in a near-field offline state, it indicates that the device state of the first target sub-device associated with the first gateway 53 will also change. Therefore, it is necessary to iterate through the first target sub-devices associated with the first gateway 53 again to provide a basis for subsequently adjusting the device state of the first target sub-device.

[0329] Step S320: LinkSvc 5113 sends a message to DM to add near-field offline status to the first target sub-device.

[0330] In this embodiment, when the first target sub-device is in a near-field online state, if the first gateway 53 changes from a near-field online state to a near-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, thereby facilitating the DM's management and control of the first target sub-device.

[0331] Understandably, since the second communication connection between the first gateway 53 and the master device 51 remains unchanged, the far-field online status of the first target sub-device does not need to be changed. After step S320, the first target sub-device is in a far-field online and near-field offline state.

[0332] Furthermore, when the first sub-device 54 changes from far-field online and near-field online status to far-field online and near-field offline status, the device status of the first sub-device 54 is still displayed as online on the APP main body 5111. At this time, the APP main body 5111 does not need to update the device status of the first sub-device 54.

[0333] It is worth noting that, based on the above... Figures 11 to 13 In the method shown, when the first sub-device 54 is in a far-field online or near-field online state, if the online state of the first gateway 53 changes, then the device state of the first sub-device 54 will also change. Furthermore... Figure 12 The method shown provides the process for the first sub-device 54 to change from a far-field online / near-field online state to a far-field offline / near-field online state. Figure 13The method shown provides a process for the first sub-device 54 to transition from a far-field online / near-field online state to a far-field online / near-field offline state. Therefore, when the first sub-device 54 needs to transition from a far-field online / near-field online state to a far-field offline / near-field offline state, it can be combined with the above-described... Figure 12 and Figure 13 The method shown will not be elaborated here.

[0334] Furthermore, when the first sub-device 54 needs to change from a far-field online / near-field online state to a far-field offline / near-field offline state, the device status of the first sub-device 54 needs to be updated from online to offline on the main APP 5111. The update of the device status of the first sub-device 54 can be referred to steps S116-S122 above, which will not be repeated here.

[0335] Figure 14 This is the eighth flowchart of the method for determining the online status of a device provided in this embodiment.

[0336] like Figure 14 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0337] Step S401: The first gateway 53 sends an authentication request to LinkSvc 5113.

[0338] Step S402: LinkSvc 5113 receives the authentication request, completes the authentication, and establishes a first communication connection with the first gateway 53.

[0339] Step S403: LinkSvc 5113 sends the online status of the first gateway 53 to DM.

[0340] It is worth noting that the explanations of steps S401-S403 above can be found in the explanations of steps S307-S309, and will not be repeated here.

[0341] Step S404: LinkSvc 5113 traverses the first sub-device 54 associated with the first gateway 53.

[0342] In this embodiment, since there may be multiple gateway devices connected to the main device 51, and each gateway device may be associated with more than one sub-device, the number of sub-devices that can communicate with the main device 51 is the sum of the sub-devices associated with each gateway device. When the first gateway 53 establishes a first communication connection with the main device 51, the main device 51 needs to determine which sub-devices are the first sub-devices 54. Therefore, LinkSvc 5113 needs to traverse the first sub-devices 54 associated with the first gateway 53 to determine which sub-devices the first gateway 53 can connect to and control.

[0343] Step S405: LinkSvc 5113 sends a synchronization message to the first gateway 53.

[0344] Step S406: The first gateway 53 receives the synchronization message and sends the first status information to LinkSvc 5113.

[0345] It is worth noting that the explanations of steps S405-S406 above can be found in the explanations of steps S111-S112, and will not be repeated here.

[0346] Step S407: LinkSvc 5113 receives the first status information sent by the first gateway 53 and determines the first target sub-device based on the first status information.

[0347] The first target sub-device includes a first sub-device 54 that has established a communication connection with the first gateway 53.

[0348] In this embodiment, the first status information includes the communication connection status between the first gateway 53 and the first sub-device 54 associated with the first gateway 53. Among all the first sub-devices 54 associated with the first gateway 53, the sub-device that has established a communication connection with the first gateway 53 is the first target sub-device, thus facilitating the determination of the device status of the first target sub-device. Simultaneously, since the device status of the first sub-device 54 needs to consider two conditions—the communication connection status between the first sub-device 54 and the first gateway 53, and the communication connection status between the first gateway 53 and the master device 51—if either of these two conditions is not established, the first sub-device 54 can be determined to be in an offline state. Therefore, all other first sub-devices 54 that have not established a communication connection with the first gateway 53 are in an offline state.

[0349] Step S408: LinkSvc 5113 sends a message to DM to add near-field online status for the first target sub-device.

[0350] In this embodiment, when the first gateway 53 and the master device 51 have established a first communication connection, if the first status information shows that the first sub-device 54 has established a communication connection with the first gateway 53, then LinkSvc 5113 can determine that the first sub-device 54 is in a near-field online state. If the first status information shows that the first sub-device 54 and the first gateway 53 have not established a communication connection, then LinkSvc 5113 can determine that the first sub-device 54 is in an offline state.

[0351] Figure 15 This is the ninth flowchart of the method for determining the online status of a device provided in this embodiment.

[0352] like Figure 14 and Figure 15As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 14 In addition to this, it also includes:

[0353] Step S409: The first gateway 53 disconnects the first communication connection with LinkSvc 5113.

[0354] Step S410: LinkSvc 5113 sends a message to DM that the first gateway 53 has disconnected the first communication connection with the master device 51.

[0355] Step S411: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0356] It is worth noting that the explanation of steps S409-S411 above can be found in steps S317-S319, and will not be repeated here.

[0357] Step S412: LinkSvc 5113 sends a message to DM to add near-field offline status for the first target sub-device.

[0358] In this embodiment, when the first target sub-device is in a near-field online state, if the first gateway 53 changes from a near-field online state to a near-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, thereby facilitating the DM's management and control of the first target sub-device.

[0359] Furthermore, when the first sub-device 54 changes from a near-field online state to a near-field offline state, the device status of the first sub-device 54 should change from online to offline on the main APP 5111. The update of the device status of the first sub-device 54 can be performed using steps S116-S122 as described above, and will not be repeated here.

[0360] Figure 16 This is the tenth flowchart of the method for determining the online status of a device provided in this embodiment.

[0361] like Figure 16 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0362] Step S501: The first gateway 53 sends an authentication request to LinkSvc 5113.

[0363] Step S502: LinkSvc 5113 receives the authentication request, completes the authentication, and establishes a first communication connection with the first gateway 53.

[0364] Step S503: LinkSvc 5113 sends the online status of the first gateway 53 to DM.

[0365] Step S504: LinkSvc 5113 traverses the first sub-device 54 associated with the first gateway 53.

[0366] Step S505: LinkSvc 5113 sends a synchronization message to the first gateway 53.

[0367] Step S506: The first gateway 53 receives the synchronization message and sends the first status information to LinkSvc 5113.

[0368] Step S507: LinkSvc 5113 receives the first status information sent by the first gateway 53 and determines the first target sub-device based on the first status information.

[0369] Step S508: LinkSvc 5113 sends a message to DM to add near-field online status for the first target sub-device.

[0370] It is worth noting that the explanation of steps S501-S508 above can be referred to the explanation of steps S401-S408, and will not be repeated here.

[0371] Step S509: The first gateway 53 establishes a communication connection with the external network server 52.

[0372] Step S510: Server 52 sends a third notification message to LinkSvc 5113.

[0373] Step S511: LinkSvc 5113 determines the establishment of a second communication connection with the first gateway 53 based on the third notification message, and sends the online status of the first gateway 53 to DM.

[0374] Step S512: LinkSvc 5113 traverses the first sub-device 54 associated with the first gateway 53 and obtains the first status information.

[0375] Step S513: LinkSvc 5113 determines the first target sub-device based on the first status information.

[0376] Step S514: LinkSvc 5113 sends a message to DM to add far-field online status for the first target sub-device.

[0377] It is worth noting that the explanation of steps S509-S514 above can be referred to steps S201-S206, and will not be repeated here.

[0378] In this embodiment, when the first sub-device 54 is in a near-field online state, if the first gateway 53 adds a second communication connection with the master device 51, i.e., the first gateway 53 adds a far-field online state, LinkSvc 5113 can add a far-field online state for the first sub-device 54 and synchronize the device status of the first sub-device 54 to the DM. Thus, when the device management DM manages and controls the first sub-device 54, it can preferentially control the first sub-device 54 through the first communication connection between the first gateway 53 and the master device 51. Compared to when the DM controls the first sub-device 54 through the second communication connection between the first gateway 53 and the master device 51, the communication path of the first communication connection can directly transmit control signals to the first gateway 53 without relying on the external network server 52 for forwarding. It can also avoid control delays caused by external network latency, thereby improving the response speed of the first sub-device 54 to control signals.

[0379] Figure 17 This is the eleventh flowchart of the method for determining the online status of a device provided in this embodiment.

[0380] like Figure 16 and Figure 17 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 16 In addition to this, it also includes:

[0381] Step S515: The first gateway 53 disconnects from the server 52.

[0382] Step S516: Server 52 sends a fifth notification message to LinkSvc 5113.

[0383] Step S517: LinkSvc 5113 receives the fifth notification message, confirms that the second communication connection with the first gateway 53 is disconnected, and sends the message that the first gateway 53 has disconnected the second communication connection with the master device 51 to DM.

[0384] Step S518: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0385] Step S519: LinkSvc 5113 sends a message to DM to add far-field offline status for the first target sub-device.

[0386] It is worth noting that the explanation of steps S515-S519 above can be referred to steps S312-S316, and will not be repeated here.

[0387] In this embodiment, when the first target sub-device is in a far-field online state, if the first gateway 53 changes from a far-field online state to a far-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, thereby facilitating the DM's management and control of the first target sub-device.

[0388] Understandably, since the first communication connection between the first gateway 53 and the master device 51 remains unchanged, the near-field online status of the first target sub-device does not need to be changed. After step S519, the first target sub-device is in a far-field offline and near-field online state.

[0389] Furthermore, when the first sub-device 54 changes from far-field online and near-field online status to far-field offline and near-field online status, the device status of the first sub-device 54 is still displayed as online on the APP main body 5111. At this time, the APP main body 5111 does not need to update the device status of the first sub-device 54.

[0390] Figure 18 This is the twelfth flowchart of the method for determining the online status of a device provided in this embodiment.

[0391] like Figure 16 and Figure 18 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment... Figure 16 In addition to this, it also includes:

[0392] Step S520: The first gateway 53 disconnects the first communication connection with LinkSvc 5113.

[0393] Step S521: LinkSvc 5113 sends a message to DM that the first gateway 53 has disconnected the first communication connection with the master device 51.

[0394] Step S522: LinkSvc 5113 traverses the first target sub-device associated with the first gateway 53.

[0395] It is worth noting that the explanation of steps S520-S522 above can be referred to steps S317-S319, and will not be repeated here.

[0396] Step S523: LinkSvc 5113 sends a message to DM to add near-field offline status to the first target sub-device.

[0397] In this embodiment, when the first target sub-device is in a near-field online state, if the first gateway 53 changes from a near-field online state to a near-field offline state, the device state of the first target sub-device will also change. At this time, LinkSvc5113 needs to adjust the device state of the first target sub-device in a timely manner according to the change in the online state of the first gateway 53, thereby facilitating the DM's management and control of the first target sub-device.

[0398] Understandably, since the second communication connection between the first gateway 53 and the master device 51 remains unchanged, the far-field online status of the first target sub-device does not need to be changed. After step S523, the first target sub-device is in a far-field online and near-field offline state.

[0399] Furthermore, when the first sub-device 54 changes from far-field online and near-field online status to far-field online and near-field offline status, the device status of the first sub-device 54 is still displayed as online on the APP main body 5111. At this time, the APP main body 5111 does not need to update the device status of the first sub-device 54.

[0400] It is worth noting that, based on the above... Figures 17 to 18 In the method shown, when the first sub-device 54 is in a far-field online or near-field online state, if the online state of the first gateway 53 changes, then the device state of the first sub-device 54 will also change. Furthermore... Figure 17 The method shown provides the process for the first sub-device 54 to change from a far-field online / near-field online state to a far-field offline / near-field online state. Figure 18 The method shown provides a process for the first sub-device 54 to transition from a far-field online / near-field online state to a far-field online / near-field offline state. Therefore, when the first sub-device 54 needs to transition from a far-field online / near-field online state to a far-field offline / near-field offline state, it can be combined with the above-described... Figure 17 and Figure 18 The method shown will not be elaborated here.

[0401] Furthermore, when the first sub-device 54 needs to change from a far-field online / near-field online state to a far-field offline / near-field offline state, the device status of the first sub-device 54 needs to be updated from online to offline on the main APP 5111. The update of the device status of the first sub-device 54 can be referred to steps S116-S122 above, which will not be repeated here.

[0402] As explained above, when the communication connection status between the first sub-device 54 and the first gateway 53 changes, or when the communication connection status between the first gateway 53 and the main device 51 changes, the device status of the first sub-device 54 will also change accordingly, requiring updates to the device status of the first sub-device 54 displayed on the main APP 5111. However, when the online status of the main device 51 changes, it is also necessary to re-acquire the online status of the first sub-device 54.

[0403] Figure 19 This is the thirteenth flowchart of the method for determining the online status of a device provided in this embodiment.

[0404] like Figure 19 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0405] Step S601: If the master device 51 and the server 52 have not established a communication connection, the DM sends a second request message to LinkSvc 5113 in response to the establishment of a communication connection between the master device 51 and the server 52.

[0406] The second request message includes a list of device statuses within the DM.

[0407] In this embodiment, when the main device 51 experiences network outages or shutdowns, if the main device 51 reconnects to the network or powers on, the DM needs to request a refresh of the device list from LinkSvc 5113 to update the device status of the first sub-device 54 in a timely manner so that it can be controlled by the user.

[0408] Step S602: In response to the second request message, LinkSvc 5113 sends a first request message to server 52.

[0409] The first request message includes a request to refresh the device status list within the LinkSvc 5113.

[0410] In this embodiment, after LinkSvc 5113 receives the second request message, it can send a first request message to the server 52 to request an update to the device status list.

[0411] Step S603: Server 52 responds to the first request message and sends a first response message to LinkSvc 5113.

[0412] The first response message includes first status information.

[0413] In this embodiment, after receiving the first request message, the server 52 can send a first response message to the LinkSvc 5113. The first response message may include the device ID of the first gateway 53, the device ID of the first sub-device 54 associated with the first gateway 53, and first status information, so that the LinkSvc 5113 can determine the device status of the first sub-device 54.

[0414] It is worth noting that the specific steps for LinkSvc 5113 to determine the device status of the first sub-device 54 can refer to the various methods provided above, and will not be repeated here.

[0415] Figure 20 This is the fourteenth flowchart of the method for determining the online status of a device provided in this embodiment.

[0416] like Figure 20 As shown, in one embodiment, the method for determining the online status of a device provided in this embodiment includes:

[0417] Step S701: When the master device 51 has established a first communication connection with the first gateway 53 and the first gateway 53 is not connected to the external network, the master device 51 obtains the first status information from the first gateway 53.

[0418] The first communication connection includes a local area network communication connection between the master device 51 and the first gateway 53. The first status information includes the communication connection status between the first gateway 53 and at least one first sub-device 54, where the first sub-device 54 is a sub-device associated with the first gateway 53.

[0419] Step S702: The master device 51 determines the device status of the first sub-device 54 based on the first status information and the communication connection status between the master device 51 and the first gateway 53.

[0420] Specifically, when a communication connection is established between the first gateway 53 and the first sub-device 54, if the master device 51 establishes a first communication connection with the first gateway 53, the master device 51 determines that the first sub-device 54 is in a near-field online state. If the master device 51 establishes a second communication connection with the first gateway 53, the master device 51 determines that the first sub-device 54 is in a far-field online state. The second communication connection includes a communication connection between the master device 51 and the first gateway 53 via a server 52 on the external network.

[0421] In this embodiment, when the first gateway 53 is disconnected from the external network or cannot connect to the external network, the master device 51 can directly establish a first communication connection with the first gateway 53 through the local area network and directly obtain the first status information from the first gateway 53. Simultaneously, the master device 51 can determine the device status of the first sub-device 54 based on the communication connection status between the master device 51 and the first gateway 53, as well as the first status information. In this way, the master device 51 can not only determine the device status of the first sub-device 54 when the master device 51 and the first gateway 53 are disconnected from the external network, thus reducing reliance on the external network when confirming the device status of the first sub-device 54, but also update the device status of the first sub-device 54 in a timely manner, improving the accuracy of determining the device status of the first sub-device 54 and thus improving the user experience. Furthermore, when the first sub-device 54 is online, it can also distinguish whether the first sub-device 54 is in a near-field online state or a far-field online state, so that the master device 51 can control the first sub-device 54 through near-field or far-field communication.

[0422] In this embodiment, the above method further includes:

[0423] Before determining the device status of the first sub-device 54, if the master device 51 has established a second communication connection with the first gateway 53, the master device 51 obtains the first status information reported by the first gateway 53 from the server 52.

[0424] It is understandable that, while the main device 51 has established a second communication connection with the first gateway 53, the main device 51 may also have established a first communication connection with the first gateway 53, or the main device 51 may not have established a first communication connection with the first gateway 53.

[0425] In this way, when the master device 51 and the first gateway 53 can establish a connection with the external network server 52, the master device 51 can directly obtain the first status information reported by the server 52, so that it does not need to obtain the first status information from the first gateway 53, thereby reducing the workload of the first gateway 53 in obtaining the first status information and thus reducing the consumption of resources.

[0426] This application provides an electronic device that may include a display screen (such as a touchscreen or a non-touchscreen), a memory, and one or more processors. The display screen, memory, and processors are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the electronic device in the above method embodiments. The structure of the electronic device can be referred to... Figure 3 The structure of the electronic device shown.

[0427] Figure 21 An embodiment provides a structural block diagram of a chip system.

[0428] This application also provides a chip system, such as... Figure 21 As shown, the chip system includes at least one processor 2101 and at least one interface circuit 2102. The processor 2101 and the interface circuit 2102 are interconnected via lines. For example, the interface circuit 2102 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 2102 can be used to send signals to other devices (e.g., the processor 2101 or the touchscreen of an electronic device). Exemplarily, the interface circuit 2102 can read instructions stored in the memory and send those instructions to the processor 2101. When the instructions are executed by the processor 2101, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete components, which are not specifically limited in this application embodiment.

[0429] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, the electronic device performs various functions or steps performed by the electronic device in the above method embodiments.

[0430] This application also provides a computer program product that, when run on a computer, causes the computer to perform various functions or steps performed by the electronic device in the above method embodiments.

[0431] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0432] It is readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.

[0433] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0434] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0435] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0436] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that those skilled in the art, after considering the specification and practicing the application disclosed herein, will readily conceive of other embodiments of this application. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary technical means in the art not disclosed in this application. The description and examples are to be considered exemplary only, and the true scope of this application is indicated by the claims.

[0437] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for determining the online status of equipment, characterized in that, This is applied to a main device, which includes a first application (APP). The first application (APP) includes an APP body, a device management module (DM), and a link service (LinkSvc). The main device communicates with the server and a first gateway through the link service (LinkSvc). The method includes: When the master device establishes a first communication connection with the first gateway and the first gateway is not connected to the external network, the LinkSvc service obtains first status information from the first gateway. The first communication connection includes the communication connection between the master device and the first gateway through a local area network. The first status information includes the communication connection status between the first gateway and at least one first sub-device. The first sub-device is a sub-device associated with the first gateway. The LinkSvc service determines the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway, wherein: If the master device establishes a first communication connection with the first gateway and the first sub-device, the LinkSvc service determines that the first sub-device is in a near-field online state. If the master device establishes a second communication connection with the first gateway and the first sub-device, and the link service LinkSvc determines that the first sub-device is in a far-field online state, the second communication connection includes the master device and the first gateway communicating with the server via the external network. The LinkSvc service obtains the historical status of the first sub-device. The LinkSvc service determines whether the current device status of the first sub-device is the same as the historical status. If the current device status of the first sub-device is different from the historical status, the LinkSvc service sends a device status update message to the device management module DM, and the device status update message includes the current device status of the first sub-device. The device management module DM updates the device status of the first sub-device based on the status update message; The device management module (DM) determines whether it is necessary to send the device update status message of the first sub-device to the main APP. When the main APP shows the first sub-device as online, and the device management module updates the first sub-device to offline, or when the main APP shows the first sub-device as offline, and the device management module updates the first sub-device to online, the device management module sends a device status update message for the first sub-device to the main APP. The main APP updates the device status of the first sub-device based on the status update message.

2. The method for determining the online status of equipment according to claim 1, characterized in that, Before determining the device status of the first sub-device, the method further includes: When the master device establishes the second communication connection with the first gateway, the master device obtains the first status information reported by the first gateway from the server.

3. The method for determining the online status of equipment according to claim 1 or 2, characterized in that, After the master device obtains the first status information from the first gateway, the method further includes: If the master device fails to establish a communication connection with the first gateway, the master device determines that the first sub-device is offline.

4. The method for determining the online status of equipment according to claim 1 or 2, characterized in that, After the master device obtains the first status information from the first gateway, it also includes: If the first gateway and the first sub-device have not established a communication connection, the master device determines that the first sub-device is offline.

5. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: When the master device has established a second communication connection with the first gateway, and the master device has not established a first communication connection with the first gateway, in response to the master device establishing the first communication connection with the first gateway, the master device adds a near-field online status to a first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

6. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: If the master device has not established a communication connection with the first gateway, in response to the master device establishing the first communication connection with the first gateway, the master device obtains the first status information from the first gateway.

7. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: If the master device does not establish the second communication connection with the first gateway, in response to the master device establishing the second communication connection with the first gateway, the master device adds a far-field online status to the first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

8. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: When the master device establishes the first communication connection and the second communication connection with the first gateway device, in response to the master device disconnecting the second communication connection with the first gateway, the master device adds a far-field offline state to the first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

9. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: When the master device establishes the first communication connection and the second communication connection with the first gateway device, in response to the master device disconnecting the first communication connection with the first gateway, the master device adds a near-field offline state to the first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

10. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: If the master device establishes the second communication connection with the first gateway device, but does not establish the first communication connection, in response to the master device disconnecting the second communication connection with the first gateway, the master device adds a far-field offline state to the first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

11. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: When the master device establishes the first communication connection with the first gateway device but does not establish the second communication connection, in response to the master device disconnecting the first communication connection with the first gateway, the master device adds a near-field offline state to the first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

12. The method for determining the online status of equipment according to claim 1, characterized in that, Also includes: If the master device and the server have not established a communication connection, in response to the master device establishing a communication connection with the server, the master device sends a first request message to the server; The master device receives a first response message sent by the server in response to the first request message, the first response message including the first status information.

13. The method for determining the online status of equipment according to claim 1, characterized in that, The LinkSvc service obtains first status information from the first gateway, including: The LinkSvc service sends a synchronization message to the first gateway, the synchronization message including synchronizing the first status message; The LinkSvc service receives the first status message sent by the first gateway.

14. The method for determining the online status of equipment according to claim 13, characterized in that, Before determining the device status of the first sub-device, the method further includes: When the master device establishes the second communication connection with the first gateway, the LinkSvc service obtains a notification message sent by the server, and the notification message includes the first status information.

15. The method for determining the online status of equipment according to claim 13, characterized in that, Determining the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway includes: If the first communication connection is established between the first gateway and the first sub-device, and the first communication connection is established between the master device and the first gateway, the LinkSvc service determines that the first sub-device is in a near-field online state.

16. The method for determining the online status of equipment according to claim 13, characterized in that, Determining the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway includes: If the first sub-device has established a communication connection with the first gateway and the first sub-device, and the master device has established a second communication connection with the first gateway, the LinkSvc service determines that the first sub-device is in a far-field online state.

17. The method for determining the online status of equipment according to claim 13, characterized in that, After the master device obtains the first status information, the method further includes: The LinkSvc service determines that the first sub-device is offline if the master device and the first gateway have not established a communication connection.

18. The method for determining the online status of equipment according to claim 13, characterized in that, After the master device obtains the first status information, the method further includes: The LinkSvc service determines that the first sub-device is offline if no communication connection is established between the first gateway and the first sub-device.

19. The method for determining the online status of equipment according to claim 13, characterized in that, The method further includes: If the main device and the server have not established a communication connection, the device management module DM shall, in response to the establishment of a communication connection between the main device and the server, send a second request message to the link service LinkSvc. In response to the second request message, the LinkSvc service sends a first request message to the server. The LinkSvc service receives a first response message sent by the server in response to the first request message, and the first response message includes the first status information.

20. A system for determining the online status of equipment, characterized in that, include: A master device, a first gateway, and at least one first sub-device, wherein the first sub-device is a sub-device associated with the first gateway; The main device includes a first application APP, which includes an application APP body, a device management module DM, and a link service LinkSvc. The main device communicates with the server through the link service LinkSvc and communicates with the first gateway through the link service LinkSvc. The master device is configured to: when the master device has established a first communication connection with the first gateway and the first gateway is not connected to the external network, obtain first status information from the first gateway through the LinkSvc service, wherein the first communication connection includes the communication connection between the master device and the first gateway through a local area network, and the first status information includes the communication connection status between the first gateway and at least one first sub-device. The master device is further configured to: determine the device status of the first sub-device based on the first status information and the communication connection status between the master device and the first gateway through the LinkSvc service, wherein: If the master device establishes a first communication connection with the first gateway and the first sub-device, and the master device establishes a first communication connection with the first gateway, the master device is configured to determine that the first sub-device is in a near-field online state. If the master device establishes a second communication connection with the first gateway and the first sub-device, and the master device establishes a second communication connection with the first gateway, the master device is configured to determine that the first sub-device is in a far-field online state. The second communication connection includes a server-side communication connection between the master device and the gateway via the external network. The master device is also configured to: obtain the historical status of the first sub-device through the LinkSvc link service; The master device is also configured to: determine whether the current device status of the first sub-device is the same as the historical status through the LinkSvc service; The master device is also configured to: if the current device status of the first sub-device is different from the historical status, send a device status update message to the device management module DM through the LinkSvc service, the device status update message including the current device status of the first sub-device; The master device is also configured to update the device status of the first sub-device based on the status update message through the device management module DM; The main device is also configured to: determine, through the device management module DM, whether it is necessary to send the device update status message of the first sub-device to the APP main body; The main device is also configured to: when the first sub-device is displayed as online in the main APP and the first sub-device is offline after being updated by the device management module DM, or when the first sub-device is displayed as offline in the main APP and the first sub-device is online after being updated by the device management module DM, send a device status update message of the first sub-device to the main APP through the device management module DM; The main device is also configured to update the device status of the first sub-device based on the status update message through the APP main body.

21. The equipment online status determination system according to claim 20, characterized in that, The master device is further configured to: after obtaining the first status information from the first gateway, determine that the first sub-device is in an offline state if the master device and the first gateway have not established a communication connection.

22. The equipment online status determination system according to claim 20, characterized in that, The master device is further configured to: after obtaining the first status information from the first gateway, determine that the first sub-device is in an offline state if the first gateway and the first sub-device have not established a communication connection.

23. The equipment online status determination system according to claim 20, characterized in that, The master device is further configured to: when the master device has established a second communication connection with the first gateway and the master device has not established a first communication connection with the first gateway, in response to the master device establishing the first communication connection with the first gateway, add a near-field online status to a first target sub-device, the first target sub-device including the first sub-device that has established a communication connection with the first gateway.

24. The equipment online status determination system according to claim 20, characterized in that, The master device is further configured to: in the event that the master device has not established the second communication connection with the first gateway, in response to the establishment of the second communication connection between the master device and the first gateway, add a far-field online status to the first target sub-device, wherein the first target sub-device includes the first sub-device that has established a communication connection with the first gateway.

25. An electronic device, characterized in that, include: The electronic device includes a display screen, a memory, and one or more processors; the display screen, the memory, and the processors are coupled; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method for determining the online status of the device as described in any one of claims 1-19.

26. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform a method for determining the online status of the device as described in any one of claims 1-19.

27. A computer program product, characterized in that, When the computer program product is run on a computer, the computer performs the method for determining the online status of a device as described in any one of claims 1-19.

Citation Information

Patent Citations

  • Method and device for identifying offline state and online state of ZigBee equipment

    CN111031565A

  • Device state prompting method and device, electronic device and storage medium

    CN114567518A

  • Communication method and device of whole-house intelligent Internet of Things

    CN116248423A