Method and system for determining online state of equipment and electronic equipment

By directly obtaining the status information of the gateway device using the LAN connection in the intelligent device system, the problem of inaccurate online status of the intelligent device is solved, and the accurate status determination and user experience improvement are achieved when the gateway device is disconnected from the external network.

CN119254664AActive Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410502186.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2025-01-03
Estimated Expiration
2044-04-24

AI Technical Summary

Technical Problem

The online status of the smart device is reported to the cloud server by the gateway device, and then reported to the terminal device by the cloud server. This results in the online status of the smart device obtained by the terminal device may be inaccurate when the gateway device is disconnected from the cloud server, which may affect the user. experience of user.

Method used

By establishing a local area network communication connection between the main device and the first gateway, the first state information is directly obtained, and the online state of the sub-device is determined based on the first state information and the communication connection state, the dependence on the external network is reduced, and the accuracy of the online state is improved. And distinguish the near-field and far-field online states for easy control.

Benefits of technology

When the gateway device is disconnected from the external network, the online status of the sub-device can be accurately determined, the dependence on the external network can be reduced, the user experience can be improved, and the near-field or far-field control smart devices can be supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254664A_ABST
    Figure CN119254664A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, in particular to a method and system for determining the online state of equipment and electronic equipment. The method comprises: when a first communication connection is established between a master device and a first gateway, and the first gateway is not connected to an external network, the master device obtains first state information from the first gateway, the first communication connection comprising communication connection between the master device and the first gateway through a local area network; the first state information comprises a 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 main device determines the device state of the first sub-device based on the first state information and the communication connection state of the main device and the first gateway. According to the method and system for determining the online state of the equipment, the electronic equipment and the storage medium provided by the invention, the accuracy of acquiring the online state of the equipment by the terminal equipment can be improved, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] As users' demand for smart life continues to increase, there are more and more types of smart devices on the market (such as smart curtains, smart lights, smart switches, smart air conditioners, smart printers, etc.) to replace traditional devices and provide convenience for users' lives.

[0003] When users control smart devices, they can use terminal devices to control each smart device mounted on the gateway device through the cloud server. Before controlling the smart devices, users need to use terminal devices to understand whether each smart device is online.

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

[0005] In order to solve the above problems, the present application provides a method, system and electronic device for determining the online status of a device, which can improve the accuracy of a terminal device in obtaining the online status of the device and improve the user experience.

[0006] In order to achieve the above-mentioned purpose, in a first aspect, the present application provides a method for determining the online status of a device, comprising: when a main device establishes a first communication connection with a first gateway and the first gateway is not connected to an external network, the main device obtains first status information from the first gateway, wherein the first communication connection includes a communication connection between the main device and the first gateway via a local area network, and the first status information includes a communication connection status 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; the main device determines the device status of the first sub-device based on the first status information and the communication connection status between the main device and the first gateway, wherein: when a communication connection is established between the first gateway and the first sub-device, if the main device establishes a first communication connection with the first gateway, the main device determines that the first sub-device is in a near-field online state; when a communication connection is established between the first gateway and the first sub-device, if the main device establishes a second communication connection with the first gateway, the main device determines that the first sub-device is in a far-field online state, and the second communication connection includes a server-side communication connection between the main 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 be connected to the external network, the main 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. At the same time, the main device can determine the device status of the first sub-device based on the communication connection status of the first gateway and the main device and the first status information. In this way, the main device can not only determine the device status of the first sub-device when the main device and the first gateway are disconnected from the external network, so as to reduce the dependence on the external network when confirming the device status of the first sub-device, so as to timely update the device status of the first sub-device, improve the accuracy of determining the device status of the first sub-device, and thus improve the user experience. At the same time, when the first sub-device is online, it can also distinguish whether the first sub-device is in a near-field online state or a far-field online state, so that the main device can control the first sub-device through the near field or the far field.

[0008] In an optional implementation, before determining the device state of the first sub-device, the method further includes: when the main device and the first gateway have established a second communication connection, the main device obtains the first state information reported by the first gateway from the server. In this way, when the main device and the first gateway can establish a connection by relying on the server of the external network, the main device can directly obtain the first state information reported by the server, and thus does not need to obtain the first state information from the first gateway, so as to reduce the workload of the first gateway in obtaining the first state information, thereby reducing the consumption of resources.

[0009] In an optional implementation, after the master device obtains the first status information from the first gateway, the method further includes: when the master device and the first gateway do not establish a communication connection, the master device determines that the first sub-device is in an offline state. In this way, when the master device and the first gateway do not establish a communication connection, it can be determined that the first sub-device is in an offline state.

[0010] In an optional implementation, after the master device obtains the first status information from the first gateway, the process further includes: when the first gateway and the first sub-device do not establish a communication connection, the master device determines that the first sub-device is in an offline state. In this way, when the first gateway and the first sub-device do not establish a communication connection, it can be determined that the first sub-device is in an offline state.

[0011] In an optional implementation, when the main device has established a second communication connection with the first gateway, and the main device has not established a first communication connection with the first gateway, in response to the main device establishing a first communication connection with the first gateway, the main device adds a near-field online state for the first target sub-device, and the first target sub-device includes a first sub-device that has established a communication connection with the first gateway. In this way, when the main device has established a second communication connection with the first gateway, the first target sub-device has a far-field online state. At this time, if the main device adds a first communication connection with the first gateway, a near-field online state can be added for the first sub-device, thereby facilitating control of the first sub-device.

[0012] In an optional implementation, when the master device and the first gateway have not established a communication connection, in response to the master device and the first gateway establishing a first communication connection, the master device obtains the first status information from the first gateway. In this way, when the master device and the first gateway can establish a connection by relying on the server of the external network, the master device can directly obtain the first status information reported by the server, and thus does not need to obtain the first status information from the first gateway, so as to reduce the workload of the first gateway in obtaining the first status information, thereby reducing the consumption of resources.

[0013] In an optional implementation, when the main device and the first gateway have not established a second communication connection, in response to the main device and the first gateway establishing a second communication connection, the main device adds a far-field online state for the first target sub-device, and the first target sub-device includes a first sub-device that has established a communication connection with the first gateway. In this way, when the communication connection state between the first gateway and the main device changes from unconnected to a state in which the second communication connection is established, a far-field online state can be added for the first target sub-device to facilitate control of the first sub-device.

[0014] In an 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, and the first target sub-device includes a first sub-device that has established a communication connection with the first gateway. When the master device establishes a first communication connection and a second communication connection with the first gateway device, the first target sub-device has a far-field online state and a near-field online state, and the master device can control the first sub-device through the far field or the near field, and the master device can determine and update the online state of the first sub-device through the near field or the far field. At this time, if the master device disconnects the second communication connection with the first gateway, it means that the first gateway is far-field offline, and the master device can add a far-field offline state to the first target sub-device, thereby avoiding the master device from controlling the first sub-device through the far field, and avoiding the master device from confirming and updating the online state of the first sub-device through the far field.

[0015] In an 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 for the first target sub-device, and the first target sub-device includes a first sub-device that has established a communication connection with the first gateway. When the master device establishes a first communication connection and a second communication connection with the first gateway device, the first target sub-device has a far-field online state and a near-field online state, and the master device can control the first sub-device through the far field or the near field, and the master device can determine and update the online state of the first sub-device through the near field or the far field. At this time, if the master device disconnects the first communication connection with the first gateway, it means that the first gateway is offline in the near field, and the master device can add a near-field offline state for the first target sub-device, thereby avoiding the master device from controlling the first sub-device through the near field, and avoiding the master device from confirming and updating the online state of the first sub-device through the near field.

[0016] In an optional implementation, when the master device establishes a second communication connection with the first gateway device and the first communication connection is not established, in response to the master device disconnecting the second communication connection with the first gateway, the master device adds a remote field offline state for the first target sub-device, and the first target sub-device includes a 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 remote field online state, the master device can control the first sub-device through the remote field, and the master device can determine and update the online state of the first sub-device through the remote field. At this time, if the master device disconnects the second communication connection with the first gateway, it means that the first gateway is remotely offline, and the master device can add a remote field offline state for the first target sub-device, thereby avoiding the master device from controlling the first sub-device through the remote field, and avoiding the master device from confirming and updating the online state of the first sub-device through the remote field.

[0017] In an optional implementation, when the master device establishes a first communication connection with the first gateway device and does not establish 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 for the first target sub-device, and the first target sub-device includes a 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, the master device can control the first sub-device through the near field, and the master device can determine and update the online state of the first sub-device through the near field. At this time, if the master device disconnects the first communication connection with the first gateway, it means that the first gateway is offline in the near field, and the master device can add a near-field offline state for the first target sub-device, thereby avoiding the master device from controlling the first sub-device through the near field, and avoiding the master device from confirming and updating the online state of the first sub-device through the near field.

[0018] In an optional implementation, when the master device and the server have not established a communication connection, in response to the master device and the server establishing 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, and the first response message includes first status information. In this way, after the master device is reconnected to the network or turned on, the device status list can be updated in time.

[0019] In an optional implementation, the master device includes a link service LinkSvc, and the master device obtains the first status information from the first gateway, including: the link service LinkSvc sends a synchronization message to the first gateway, the synchronization message includes a synchronization first status message; the link service LinkSvc receives the first status message sent by the first gateway. In this way, the link service LinkSvc can be used to directly obtain the first status information from the first gateway.

[0020] In an optional implementation, before determining the device state of the first sub-device, the method further includes: when the main device establishes a second communication connection with the first gateway, the link service LinkSvc obtains a notification message sent by the server, the notification message includes the first state information. In this way, the link service LinkSvc can obtain the first state information through the server.

[0021] In an optional implementation, based on the first status information and the communication connection status between the main device and the first gateway, determining the device status of the first sub-device includes: when the first gateway and the first sub-device have established a communication connection, if the main device and the first gateway have established a first communication connection, the link service LinkSvc determines that the first sub-device is in a near-field online state. In this way, 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 main device and the first gateway have established a first communication connection.

[0022] In an optional implementation, based on the first status information and the communication connection status between the main device and the first gateway, determining the device status of the first sub-device includes: when the first gateway and the first sub-device have established a communication connection, if the main device and the first gateway have established a second communication connection, the link service LinkSvc determines that the first sub-device is in a far-field online state. In this way, the link service LinkSvc can determine that the first sub-device is in a far-field online state based on the conditions that the first gateway and the first sub-device have established a communication connection and the main device and the first gateway have established a second communication connection.

[0023] In an optional implementation, after the master device obtains the first status information, the method further includes: the link service LinkSvc determines that the first sub-device is in an offline state when the master device does not establish a communication connection with the first gateway. In this way, when the master device does not establish a communication connection with the first gateway, the link service LinkSvc can determine that the first sub-device is in an offline state.

[0024] In an optional implementation, after the master device obtains the first status information, the method further includes: when the first gateway does not establish a communication connection with the first sub-device, the link service LinkSvc determines that the first sub-device is in an offline state. In this way, when the first gateway does not establish a communication connection with the first sub-device, the link service LinkSvc can determine that the first sub-device is in an offline state.

[0025] In an optional implementation, the main device further includes a device management module DM, and the method further includes: the link service LinkSvc obtains the historical status of the first sub-device; the link service LinkSvc 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 link service LinkSvc 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. In this way, after the main device determines the device status of the first sub-device, it is also necessary to determine whether the device status of the first sub-device needs to be updated according to the historical status of the first sub-device, so as to display the latest device status list to the user in real time, so that the user can use the main device to control the first sub-device.

[0026] In an optional implementation, the main device further includes a device management module DM, and the method further includes: when the main 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 main device and the server establishing a communication connection; the link service LinkSvc sends a first request message to the server in response to the second request message; the link service LinkSvc 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. In this way, after the main device is reconnected to the network or powered on, the device status list can be updated in time.

[0027] In a second aspect, the present application also provides a device online status determination system, comprising: a main device, a first gateway, and at least one first sub-device, the first sub-device being a sub-device associated with the first gateway; the main device is configured to: when a first communication connection is established between the main device and the first gateway and the first gateway is not connected to an external network, obtain first status information from the first gateway, wherein the first communication connection includes a communication connection between the main device and the first gateway via a local area network, and the first status information includes a communication connection status between the first gateway and at least one first sub-device; the main 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 main device and the first gateway, wherein: when a communication connection is established between the first gateway and the first sub-device, if the main device and the first gateway establish a first communication connection, the main device is configured to determine that the first sub-device is in a near-field online state; when a communication connection is established between the first gateway and the first sub-device, if the main device and the first gateway establish a second communication connection, the main device is configured to determine that the first sub-device is in a far-field online state, and the second communication connection includes a server-side communication connection between the main device and the gateway via an external network.

[0028] In this embodiment, when the first gateway is disconnected from the external network, or cannot be connected to the external network, the main 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. At the same time, the main device can determine the device status of the first sub-device based on the communication connection status of the first gateway and the main device and the first status information. In this way, the main device can not only determine the device status of the first sub-device when the main device and the first gateway are disconnected from the external network, so as to reduce the dependence on the external network when confirming the device status of the first sub-device, so as to timely update the device status of the first sub-device, improve the accuracy of determining the device status of the first sub-device, and thus improve the user experience. At the same time, when the first sub-device is online, it can also distinguish whether the first sub-device is in a near-field online state or a far-field online state, so that the main device can control the first sub-device through the near field or the far field.

[0029] In an optional implementation, the master device is further configured to: after the master device obtains the first status information from the first gateway, if the master device and the first gateway do not establish a communication connection, determine that the first sub-device is in an offline state. In this way, if the master device and the first gateway do not establish a communication connection, it can be determined that the first sub-device is in an offline state.

[0030] In an optional implementation, the master device is further configured to: after the master device obtains the first status information from the first gateway, if the first gateway and the first sub-device do not establish a communication connection, determine that the first sub-device is in an offline state. In this way, if the first gateway and the first sub-device do not establish a communication connection, it can be determined that the first sub-device is in an offline state.

[0031] In an optional implementation, the master device is further configured to: in response to the master device establishing a first communication connection with the first gateway, add a near-field online state for the first target sub-device, the first target sub-device includes a first sub-device that has established a communication connection with the first gateway, 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 this way, in the case where the master device has established a second communication connection with the first gateway, the first target sub-device has a far-field online state. At this time, if the master device adds a first communication connection with the first gateway, a near-field online state can be added for the first sub-device, thereby facilitating control of the first sub-device.

[0032] In an optional implementation, the master device is further configured to: in the case where the master device and the first gateway have not established a second communication connection, in response to the master device and the first gateway establishing a second communication connection, add a far-field online state for 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. In this way, when the communication connection state between the first gateway and the master device changes from unconnected to a state in which the second communication connection is established, a far-field online state can be added for the first target sub-device to facilitate control of the first sub-device.

[0033] In a third aspect, the present application further provides an electronic device, comprising: a display screen, a memory and one or more processors; the display screen and the memory are coupled to the processor; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method for determining the online status of the device as described in the first aspect above.

[0034] In a fourth aspect, the present application further provides a computer-readable storage medium, characterized in that it includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method for determining the online status of the device as described in the first aspect above.

[0035] In a fifth aspect, the present application further provides a computer program product, characterized in that when the computer program product is run on a computer, the computer is enabled to execute the method for determining the online status of a device as described in the first aspect above.

[0036] It can be understood that the beneficial effects that can be achieved by the technical solutions provided in the third to fifth aspects provided above can refer to the beneficial effects in the first aspect and any optional implementation method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 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 using a mobile phone to control a smart device provided by this embodiment;

[0040] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0041] Figure 4 It is a schematic diagram of the layered architecture of the software system of the electronic device provided in the embodiment of the present application;

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

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

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

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

[0046] Fig. 9 is a third flow chart of the method for determining the online status of a device provided in this embodiment;

[0047] Fig.10 is a fourth flow chart of the method for determining the online status of a device provided in this embodiment;

[0048] Fig.11 is a fifth flow chart of the method for determining the online status of a device provided in this embodiment;

[0049] Fig.12 is a sixth flow chart of the method for determining the online status of a device provided in this embodiment;

[0050] Fig.13 is a seventh flow chart of the method for determining the online status of a device provided in this embodiment;

[0051] Fig.14 is the eighth flow chart of the method for determining the online status of a device provided in this embodiment;

[0052] Fig.15 is a ninth flow chart of the method for determining the online status of a device provided in this embodiment;

[0053] Fig.16 is the tenth flow chart of the method for determining the online status of a device provided in this embodiment;

[0054] Fig.17 is an eleventh flow chart of the method for determining the online status of a device provided in this embodiment;

[0055] Fig.18 is a twelfth flow chart of the method for determining the online status of a device provided in this embodiment;

[0056] Fig.19 is a thirteenth flow chart of the method for determining the online status of a device provided in this embodiment;

[0057] Fig. 20 is the fourteenth flow chart of the method for determining the online status of a device provided in this embodiment;

[0058] Fig.21 This is a structural block diagram of a chip system provided in this embodiment. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making creative work all belong to the protection scope of the present application.

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

[0061] In addition, in the present application, directional terms such as "upper", "lower", "inner" and "outer" are defined relative to the orientation of the components schematically placed in the drawings. It should be understood that these directional terms are relative concepts. They are used for relative description and clarification, and they can change accordingly according to the changes in the orientation of the components placed in the drawings.

[0062] Smart devices are devices that can use various modern technological means to enable traditional electrical appliances, equipment and systems to achieve automation and intelligent control, and can be remotely monitored and operated through the Internet, such as smart TVs, smart speakers, smart projectors, smart lights, smart curtains, smart printers, smart switches and smart air conditioners.

[0063] As people's demand for intelligent life continues to increase, more and more types of intelligent devices are available on the market. In this way, users can use intelligent devices to replace traditional devices and use terminal devices, gateways, etc. to form a control system for intelligent devices to achieve control of intelligent 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 smart device control system includes a terminal device 11, a gateway 12, a first smart device 13, a second smart device 14, a scene cloud 15, a device cloud 16, an Over-the-Air (OTA) server 17 and a developer website 18.

[0066] The terminal device 11 is the main control device in the smart device control system, and can also be called the main device. The terminal user can use the terminal device 11 to realize the discovery, registration, control, status reporting and OTA operations of the first smart device 13 and the second smart device 14. The terminal device 11 can be a mobile phone, a tablet, a computer, a smart watch and other devices. The terminal device 11 can directly control the first smart device 13 and / or the second smart device 14, and can also connect to the Internet and control the first smart device 13 and / or the second smart device 14 through 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, a smart speaker, a smart projector, a smart light, a smart curtain, a smart printer, a smart switch, and a smart air conditioner. The second smart device 14 is the same, and will not be described here. It is understandable that the number and type of smart devices in the smart device control system can be selected according to actual conditions, 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, the manufacturer of the second smart device 14 may be the same as or different from the manufacturer of the terminal device 11, and the manufacturers of the first smart device 13 and the second smart device 14 may be the same as or different. The following description is made by taking the example that 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 manufacturer's private communication protocol built in. In this way, the first smart device 13 and the terminal device 11 can communicate with each other using the wireless communication technology through the manufacturer's private communication protocol, so that the terminal device 11 can directly control the first smart device 13.

[0070] Specifically, after the first smart device 13 establishes a communication connection with the terminal device 11, the first smart device 13 can report its online status to the terminal device 11. If the online status reported by the first smart device 13 to the terminal device 11 is online, the terminal device 11 can directly perform near-field control on the first smart device 13; if the online status reported by the first smart device 13 to the terminal device 11 is offline, the terminal device 11 cannot control the first smart 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 be able to have the same manufacturer's private communication protocol as that of the terminal device 11 built in, so that the second smart device 14 and the terminal device 11 cannot directly communicate and connect 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, so as to facilitate the terminal device 11 to control 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), fifth generation mobile communication technology (5th generation mobile networks or 5th generation wireless systems, 5G for short), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.

[0073] As a core device for connecting smart devices and the Internet, the gateway 12 can convert the communication protocol used by the first smart device 13 and the second smart device 14 mounted on the gateway 12 into an Internet standard protocol, so that the first smart device 13 and the second smart device 14 can be connected to the Internet. In this way, the second smart device 14 of a different manufacturer can establish a communication connection with the terminal device 11 through the gateway 12 and the Internet, so that the terminal device 11 can control the second smart device 14.

[0074] In addition, 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. At this time, the second smart device 14 can access the Internet through the gateway 12, so that the terminal device 11 can use the gateway 12 to perceive and control the second smart device 14, and 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 the specific purpose, which is not limited in this embodiment.

[0076] In the smart device control system, the scene cloud 15, the device cloud 16 and the OTA server 17 can be different modules of a cloud server built on an Internet platform. The cloud server can be used to realize the communication connection between the gateway 12 and the terminal device 11, thereby realizing the communication connection between the smart device mounted on the gateway 12 device and the terminal device 11.

[0077] The scene cloud 15 can provide functions such as data storage, analysis, processing and application services for IoT applications. The scene cloud 15 can establish a communication connection with the terminal device 11, so that the terminal device 11 can upload the scene editing definition to the scene cloud 15, wherein the scene editing definition includes the set control scene. Alternatively, the terminal device 11 can also obtain the scene download display from the scene cloud 15, so that the terminal device 11 can realize the linkage control of the smart device in the specified scene through the scene cloud 15.

[0078] Exemplarily, when the first smart device 13 is a smart light and the second smart device 14 is a smart speaker, the terminal device 11 can be set in the control scene to turn off the smart light and the smart speaker at the same time, or to turn off the smart light and the smart speaker at the same time, or to turn on the smart light and the smart speaker at the same time, and so on.

[0079] The device cloud 16 can support various types of IoT devices to access the cloud server, and users can conveniently manage device registration, authentication, access, and remote monitoring and control of IoT devices using the device cloud 16. In this way, the control instructions issued by the terminal device 11 can be transmitted to each sub-device through the device cloud 16 to achieve control and management of the sub-devices.

[0080] The OTA server 17 is a server used to remotely update the firmware and software of IoT devices. It can provide IoT devices with functions such as remote firmware update and software update, thereby saving a lot of manpower and time costs.

[0081] According to the above description, Figure 1 In the smart device control system shown, the terminal device 11 is capable of receiving and responding to operations of the terminal user, and utilizing the cloud server and the gateway 12 to control the first smart device 13 and the second smart device 14 .

[0082] In some embodiments, the first smart device 13 and the second smart device 14 can both be connected to the device cloud 16 through 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 achieve far-field control of the first smart device 13 and the second smart device 14 through the device cloud 16 and the gateway 12, or the terminal device 11 can also achieve far-field control of the first smart device 13 and the second smart device 14 through the scene cloud 15, the device cloud 16 and the gateway 12.

[0083] Specifically, the first smart device 13 can report the online status to the gateway 12, the gateway 12 can report the online status of the first smart device 13 to the device cloud 16, and the device cloud 16 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. When the first smart device 13 is online, the terminal device 11 can control the first smart device 13. When the first smart device 13 is offline, the terminal device 11 cannot control the first smart device 13.

[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 implement scene control 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, and the OTA server 17 is connected to the gateway 12. When the 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, and the developer website 18 uploads the OTA version package to the OTA server 17. The OTA server 17 can send the OTA version package to the first smart device 13 and the second smart device 14 associated with the gateway 12 through the gateway 12. The device cloud 16 can request the OTA server 17 to detect the version of the first smart device 13, and the OTA server 17 will then feed back 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 uploads the profile configuration file and / or the Prdld third-party device type configuration file to the device cloud 16, and then the device cloud 16 implements 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 that 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 that of the terminal device 11, the Prdld three-party device type configuration file can be used for configuration.

[0089] In summary, when the manufacturer of the smart device and the terminal device have the same manufacturer-proprietary communication protocol built in, the terminal device can control the smart device. However, when the manufacturer of the smart device and the terminal device cannot have the same manufacturer-proprietary communication protocol built in, the smart device can only establish a communication connection with the terminal device through the gateway and the cloud server, so that the terminal device can control the smart device.

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

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

[0092] like Figure 2 As shown, when controlling the smart device, the user can use the mobile phone to control it. Specifically, in the main interface 21 (such as Figure 2 Various types of application icons can be displayed on the main interface of the mobile phone, such as a clock icon, a calendar icon, a gallery icon, a memo icon, a file management icon, a video icon, a smart space icon 22, etc. A status bar can also be displayed on the main interface of the mobile phone, and the status bar may include: one or more signal strength indicators of mobile communication signals, one or more signal strength indicators of Wi-Fi signals, a power indicator of the electronic device, a time indicator, etc.

[0093] The mobile phone can receive and respond to the user's click operation 23 on the smart space icon, start the smart space application (Application, APP), and display the following Figure 2 The smart space APP interface 24 shown in (b) in FIG. In the smart space APP interface 24, the number of smart devices added by the user to "my home", the information of each smart device and the remaining function icons can be displayed.

[0094] The information of the smart device includes the icon, name, location, and online status of the smart device. The name of the smart device can be named by the user or the original name provided by the device manufacturer. In this embodiment, the name of the smart device is not limited. The function icons in the smart space APP interface 24 can include but are not limited to home icons, mall icons, smart icons, my icons, and add device icons.

[0095] Specifically, Figure 2 In (b), the online status of the TV in the living room is online, and the location is the living room; the online status of the TV in the master bedroom is online, and the location is the master bedroom; the online status of the TV in the second bedroom is online, and the location is the second bedroom; the online status of the speakers in the living room is offline, and the location is the living room; the online status of the speakers in the master bedroom is offline, and the location is the master bedroom; the online status of the speakers in the second bedroom is offline, and the location is the second bedroom; the online status of the smart projector is offline, and the location is the living room; the online status of the router is online, and the location is the living room. For each smart device, the smart device with an online status of online can be controlled, and the smart device with an online status of offline cannot be controlled.

[0096] For example, when the user wants to control the TV in the living room, the mobile phone can respond to the user's click on the icon of the TV in the living room and control the mobile phone to jump from the smart space APP interface 24 to the following interface: Figure 2 The living room TV control interface 25 shown in (c) of FIG. In the living room TV control interface 25, operable options of the living room TV may be displayed. The operable options of the living room TV may include but are not limited to power on, power off, volume + and volume -, etc. The mobile phone can respond to the user's click on the operable options and control the living room TV to execute corresponding instructions. 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) of FIG. 1 , in response to the user sliding the interface upward, the smart space APP interface can also display the following Figure 2 The smart scenes and their number shown in (d) in the figure. Among them, the smart scenes can be the first control scene, the second control scene and the third control scene set by the user according to his own needs to jointly control multiple smart devices. For example, the user can set the name of the first control scene to go out, and the setting of the first control scene is to turn off the TV, speakers and projectors in each room of the house. The mobile phone can receive and respond to the user's click on the first control scene, and turn off the TV, speakers and projectors in each room according to the setting of the first control scene.

[0098] In the above process of a user using a mobile phone to control a smart device, the mobile phone can only control the smart devices that are online. 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 a 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 a mobile phone.

[0099] Depend on Figure 1 It can be seen that the online status of the smart device displayed by the smart space APP of the mobile phone is reported by the gateway to the device cloud, and then reported by the device cloud to the scene cloud and the mobile phone, so that the online status of each smart device can be displayed on the smart space APP interface 24. In the process of reporting the online status of the smart device, the mobile phone and the cloud server need to remain connected, and the cloud server and the gateway also need to remain connected. However, when the network configuration, firewall configuration, routing settings of the cloud server or the cloud service provider cause the cloud service connection to be abnormal, the mobile phone and the gateway may not be able to connect to the cloud server. If either the mobile phone or the gateway is disconnected from the cloud server, the online status of the smart device cannot be reported to the mobile phone, resulting in the online status of the smart device displayed on the mobile phone may be wrong.

[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 is back online. However, if the mobile phone is disconnected from the Internet and cannot connect to the cloud server, the cloud server cannot report to the mobile phone that the living room speaker has changed from offline to online, and continues to display the living room speaker as offline, resulting in the user being unable to control the living room speaker through the mobile phone.

[0101] In another example, Figure 2 As shown in (b), the TV in the living room is currently online. If the TV in the living room is disconnected from the gateway, the TV in the living room should be offline. However, if the mobile phone is disconnected from the network, disconnected from the cloud server, or the gateway is disconnected from the cloud server, the cloud server cannot report to the mobile phone that the TV in the living room has changed from online to offline, and continues to display the TV in the living room as online. If the user uses the mobile phone to control the TV in the living room at this time, the TV in the living room cannot respond to the control operation, resulting in the failure of the user's control operation, affecting the user experience.

[0102] In order to solve the above problems, an embodiment of the present application provides a method for determining the online status of a device, which can determine the online status of a smart device 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 improving 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 can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, and other electronic devices. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.

[0104] For example, taking the electronic device as a mobile phone, Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present 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, an antenna 1, an 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. Among them, the sensor module 380 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0106] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0107] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0108] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, 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. The interface 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 an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 310 through the external memory interface 320 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0111] The internal memory 321 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 310, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, and can be loaded into the random access memory in advance for direct reading and writing by the processor 310.

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

[0113] While charging the battery 342, the charging management module 340 can also power the electronic device through the power management module 341. 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 is used to connect 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, and supplies power to the processor 310, the internal memory 321, the display screen 393, the camera 395, and the wireless communication module 360. The power management module 341 can also be used to monitor parameters such as the battery voltage, current, battery cycle number, and battery health status (leakage, impedance). In some other embodiments, the power management module 341 can also be set in the processor 310.

[0115] The wireless communication function of the electronic device can be implemented 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 the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.

[0117] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 350 can receive electromagnetic waves through the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the same device as at least some of the modules of the processor 310.

[0118] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through a display screen 393. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 310 and be set in the same device as the mobile communication module 350 or other functional modules.

[0119] The wireless communication module 360 ​​can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. 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, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 360 ​​can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through antenna 2.

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

[0121] In some embodiments, the electronic device may include 1 or N cameras 395, where N is a positive integer greater than 1. In the embodiment of the present application, the type of camera 395 can be distinguished according to the hardware configuration and the physical location. For example, the camera arranged on the side of the display screen 393 of the electronic device can be called a front camera, and the camera arranged on the side of the back cover of the electronic device can be called a rear camera; for another example, a camera with a short focal length and a larger viewing angle can be called a wide-angle camera, and a camera with a long focal length and a small viewing angle can be called a normal camera. Among them, the length of the focal length and the size of the viewing angle are relative concepts, and there is no specific parameter limitation. Therefore, wide-angle cameras and ordinary cameras are also a relative concept, and can be specifically distinguished according to physical parameters such as focal length and viewing angle.

[0122] The electronic device implements the display function through a GPU, a display screen 393, and an application processor. The GPU is a microprocessor for image editing, connecting the display screen 393 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or change display information.

[0123] The electronic device can realize the shooting function through ISP, camera 395, video codec, GPU, display screen 393 and application processor. GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs, which execute program instructions to generate or change display information. In the embodiment of the present application, the function of the GPU is used in the frame drawing process of each image frame so that the final displayed picture obtains better display effect and performance.

[0124] The ISP is used to process the data fed back by the camera 395. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 395. The camera 395 is used to capture static images or videos.

[0125] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

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

[0127] In an embodiment of the present application, the display screen 393 can be used to display pages required by the electronic device (for example, wizard pages (including highlight recommendation pages and external module access pages), etc.), and display images taken from 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 connected to or disconnected from the electronic device by inserting it into or removing it from the SIM card interface 394. The electronic device can support one or more SIM card interfaces. The SIM card interface 394 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 394 at the same time. The SIM card interface 394 can also be compatible with external memory cards. The electronic device interacts with the network through the SIM card to implement functions such as calls and data communications. One SIM card corresponds to one user number.

[0129] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0130] Of course, it is understandable that the above Figure 3 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include Figure 3 The structure shown in the figure is less than Figure 3 More structures are shown in the figure, which are not limited here.

[0131] It is understandable that, in general, the realization of electronic device functions requires not only hardware support but also software cooperation. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0132] Figure 4 Schematic diagram of the layered architecture of the software system of the electronic device provided in the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces (such as API).

[0133] In some examples, reference Figure 4As shown, in the embodiment of the present application, the software of the electronic device is divided into five layers, from top to bottom, namely, the application layer, the framework layer (or called the application framework layer), the system library and the Android runtime (android runtime), the HAL layer (hardware abstraction layer, hardware abstraction layer) and the driver layer (or called the kernel layer). Among them, the system library and the Android runtime can also be called the local framework layer or the native layer.

[0134] The application layer can include a series of applications. Figure 4 As shown, the application layer may include applications (APP) such as camera, gallery, calendar, map, WLAN, Bluetooth, music, video, short message, call, smart space, etc.

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

[0136] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions or services. For example, the application framework layer may include an activity manager, a window manager, a content provider, an audio service, a view system, a phone manager, a resource manager, a notification manager, a package manager, etc., and the embodiments of the present application do not impose any restrictions on this.

[0137] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

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

[0139] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. In some embodiments, the view system can also include or start a rendering thread to complete operations such as drawing a frame buffer.

[0140] The phone manager is used to provide communication functions of the electronic device. For example, the phone manager can manage the call status of the call application (including initiation, connection, hang up, etc.).

[0141] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0142] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0143] The package manager is The system 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. For example: surface manager, media library, etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0145] The HAL layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms. The HAL layer provides a standard interface to display device hardware functions to the higher-level Java API framework (i.e., the framework layer). The HAL layer contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as: audio HAL audio module, bluetooth HAL Bluetooth module, camera HAL camera module (also called camera HAL or camera hardware abstraction module), sensors HAL sensor module (or Isensor service, sensor service).

[0146] The kernel layer is a layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, a sensor driver, a battery driver, etc., which are not limited in this application. Among them, the sensor driver can specifically include the driver of each sensor included in the electronic device, such as an ambient light sensor driver, etc. Exemplarily, the ambient light sensor driver can respond to the indication or instruction of the sensor module to obtain the detection data, and send the detection data of the ambient light sensor to the sensor module in a timely manner.

[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, where 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, a tablet, a computer, and a 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] Exemplarily, the main device 51 may include: Figure 2 The smart space APP 511 shown in (a) of FIG. 5 is used to control the sub-devices by using the smart space APP 511. The smart space APP 511 may include an application program body (APP body 5111), middleware 5112, and a link service (Link Service, LinkSvc) 5113.

[0151] The middleware 5112 may include a device management module (DM) and a profile module to implement management and configuration functions of the main device 51. The DM can implement remote monitoring, configuration, maintenance and management of other devices connected to the main device 51.

[0152] LinkSvc 5113 may include submodules such as device discovery, device connection, device networking, and device transmission, so as to provide the main device 51 with functions such as connection, communication, or data transmission between the main device 51 and other devices.

[0153] Since one main device 51 can usually 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 main device 51 .

[0154] In addition, the sub-device can be any intelligent device that can be associated with the gateway device. Since a gateway device can usually 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 main device 51 can establish communication connections with multiple gateway devices, and each gateway device can be associated with multiple sub-devices, the method for the main device 51 to determine the online status of each sub-device through the gateway device can be the same. Therefore, in this embodiment, the first gateway 53 and the first sub-device 54 are used as examples to introduce the device online status determination system and method.

[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), wireless fidelity (Wi-Fi) network or ad hoc network wireless communication protocol (Zigbee).

[0157] In one example, when the first gateway 53 is not connected to the external network, the main device 51 and the first gateway 53 can establish a first communication connection, and at this time, the first gateway 53 is in a far-field offline and near-field online state. The first communication connection includes that the main device 51 and the first gateway 53 can be connected to each other through a local area network, so that the first gateway 53 can directly establish a communication connection with the main device 51.

[0158] It is worth noting that when the master device 51 and the first gateway 53 can establish the first communication connection, it means that the master device 51 and the first gateway 53 are in the same local area network and can both be connected to the local area network. If the master device 51 and the first gateway 53 are not in the same local area network, the master device 51 and the first gateway 53 cannot establish the first communication connection. Or if the master device 51 and the first gateway 53 are already in the same local area network, but either of them is in a shutdown state or cannot connect to the local area network, the master device 51 and the first gateway 53 cannot establish the first communication connection.

[0159] Exemplarily, when the first gateway 53 and the main 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 main device 51 through the Constrained Application Protocol (COAP).

[0160] Exemplarily, the first gateway 53 may include a Link Software Development Kit (LinkSDK) module 531, and the LinkSDK 531 can establish a communication connection with the link service LinkSvc 5113 through COAP. It is understandable that the first gateway 53 may also establish a communication connection with the main device 51 through other communication protocols.

[0161] Combination Figure 2 As shown in (b), specifically, the specific process of the master device 51 and the first gateway 53 establishing the first communication connection for the first time may be:

[0162] When the master device 51 is a mobile phone, the master device 51 can send a broadcast message to the environment where the master device 51 is located in response to the user clicking the "+" icon. When the first gateway 53 receives the broadcast message sent by the master device 51, it will send 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 the authentication can be passed, it establishes a first communication connection with the first gateway 53.

[0163] It is worth noting that the sending of the broadcast message by the master device 51 to the environment may be triggered by a user, or may be sent periodically by the master device 51 , which is not limited in this embodiment.

[0164] Please refer again Figure 5 In another example, the first gateway 53 can establish a communication connection with the main device 51 through the external network server 52. At this time, the first gateway 53 is in a remote 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 the external network server 52 can establish a communication connection with the main device 51 through MQTT, thereby realizing the communication connection between the first gateway 53 and the main device 51.

[0165] Optionally, the external network server 52 serves as an Internet platform for the main device 51 to communicate with the first gateway 53, which may be a cloud server or a virtual private server, etc., which is not limited in this embodiment.

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

[0167] Further, when the first gateway 53 is in the far-field online state, the first gateway 53 can be in the near-field online state or the near-field offline state at the same time. In other words, the second communication connection between the first gateway 53 and the main device 51 includes the first gateway 53 being in the far-field online state, the near-field offline state, and the first gateway 53 being in the far-field online state and the 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. In this way, when the first gateway 53 disconnects the second communication connection with the main device 51, the main device 51 can also establish a first communication connection with the first gateway 53 through the local area network, so as to obtain the first status information (the connection status of the first sub-device 54 and the first gateway 53) from the first gateway 53 by using the first communication connection, and determine the device status of the first sub-device 54 based on the communication connection status between the first gateway 53 and the main device 51 and the first status information, so as to provide the user with an accurate device status of the first sub-device 54. In other words, the device online status determination system can obtain the device status of the first sub-device 54 in a timely manner 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 can be seen from the above description, the first sub-device 54 is a device associated with the first gateway 53, and the communication between the first sub-device 54 and the main device 51 needs to be realized with the help of the first gateway 53. If the main 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 main device 51.

[0170] On the contrary, if the communication connection state between the first sub-device 54 and the first gateway 53 changes, the online state of the first sub-device 54 will be affected. At the same time, if the communication connection state between the first gateway 53 and the main device 51 changes, the online state of the first sub-device 54 will also be affected. The following describes the method for determining the online state of the first sub-device 54 when the communication connection state between the first sub-device 54 and the first gateway 53 changes and when the communication connection state between the first gateway 53 and the main device 51 changes.

[0171] Figure 6 This is the first flow chart 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 main device 51 , the communication connection between the first gateway 53 and the main 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, such as Wi-Fi signal or BT signal, that establishes the communication connection between the first sub-device 54 and the gateway fluctuates, the first sub-device 54 may lose the connection with the first gateway 53. Or when the power supply terminal or battery of the first sub-device 54 runs out of power, the first sub-device 54 may also lose the connection with the first gateway 53. After the connection problem between the first sub-device 54 and the first gateway 53 is resolved, the first sub-device 54 can go back online and establish a communication connection with the first gateway 53.

[0176] Exemplarily, after the first sub-device 54 goes 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 for 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 communication connection established between the first sub-device 54 and the first gateway 53. In this way, 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, and then report it to the main device 51 through the external network server 52.

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

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

[0181] Specifically, the first notification message may be notifyld:SUB_DEV_ONLN, where notifyld may indicate that the message type is a notification message, and SUB_DEV_ONLN may indicate that the first sub-device 54 establishes a communication connection with the first gateway 53. It is understandable that, in other embodiments, the external network server 52 may also send the first status information to the main device 51 through other types of messages, which is not limited in this embodiment.

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

[0183] As can be seen from the above description, LinkSvc 5113 can establish a communication connection and perform data transmission with the server 52. In this way, LinkSvc 5113 can receive the first notification message sent by the 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 the communication connection with the first gateway 53.

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

[0186] It is worth noting that the problem that causes the first sub-device 54 to disconnect the communication connection with the first gateway 53 may come from the first gateway 53, such as an error in the protocol configuration of the first gateway 53. Alternatively, the problem that causes the first sub-device 54 to disconnect the communication connection with the first gateway 53 may also come from the first sub-device 54, such as a power failure of the first sub-device 54. Alternatively, the problem that causes the first sub-device 54 to disconnect the communication connection with the first gateway 53 may also come from the external environment, such as an abnormality in the network through which the first sub-device 54 and the first gateway 53 establish a communication connection.

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

[0188] The first status information includes that the first sub-device 54 disconnects the communication connection with the first gateway 53. In this way, 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, and then report it to the main device 51 through the external network server 52.

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

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

[0191] Specifically, the second notification message may be notifyld:SUB_DEV_OFFLN. In which notifyld may indicate that the message type is a notification message, and SUB_DEV_OFFLN may indicate that the first sub-device 54 is disconnected from the first gateway 53. It is understandable that, in other embodiments, the external network server 52 may also send the first status information to the main device 51 through other types of messages, which is not limited in this embodiment.

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

[0193] It is worth noting that the description of the above step S108 can refer to the above step S104 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 state between the first gateway 53 and any one of the first sub-devices 54 changes, the first gateway 53 will send the ID of the first sub-device 54 and the communication connection state between the first sub-device 54 and the first gateway 53 to the external network server 52. At this time, the first state information may only include the communication connection state between one first sub-device 54 and the first gateway 53. If the communication connection state between multiple first sub-devices 54 associated with the first gateway 53 and the first gateway 53 changes, the first gateway 53 may sequentially send the communication connection state between each first sub-device 54 and the first gateway 53 to the external network server 52, and the external network server 52 then sequentially receives and sends notification information to the main device 51. In other words, in the above steps S101-S108, the first state information includes the communication connection state between one first sub-device 54 and the first gateway 53.

[0195] It can be understood that the process of the above steps S101-S104 is a process in 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 process of the above steps S105-S108 is a process in 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 the communication connection with the first gateway 53. In some methods for determining the online status of a device, only one of the processes may occur, or both may occur. When the processes of steps S101-S104 and steps S105-S108 both occur, this embodiment does not limit the order of the two.

[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, the first gateway 53 is directly connected to the main device 51 through the local area network, and the communication connection between the first gateway 53 and the main device 51 is in a far-field offline and near-field online state. The method for determining the online state 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 description of the above step S109 can refer to the above steps S101 and S105, which 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 main device 51 and the first gateway 53 have established a first communication connection, 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 main 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 main device 51 and the first sub-device 54 can be achieved by relying on 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 query the first status information regularly. 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, so that the main device 51 can determine the online status of the first sub-device 54 later.

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

[0204] Furthermore, when the first gateway 53 queries in batches, the number of first sub-devices 54 queried in each batch may 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 by this embodiment.

[0206] like Figure 7 As shown, illustratively, when the first gateway 53 is not connected to the external network, the first gateway 53 starts 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 first sub-devices 54 are numbered 1-30, Figure 7 The suffix of each first sub-device 54 indicates a number. In the first query cycle, the first gateway 53 may first query and store the communication connection status between the first sub-devices 54 numbered 1-10 and the first gateway 53, and then the first gateway 53 may continue to query and store the communication connection status between the first sub-devices 54 numbered 11-20 and the first gateway 53, and finally the first gateway 53 may 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, in one query cycle, the first gateway 53 can batch and 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 timely update the communication connection status between each first sub-device 54 and the first gateway 53.

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

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

[0209] The synchronization message includes synchronization first state 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 main device 51 through the local area network, LinkSvc 5113 can directly request the first gateway 53 to obtain the first status information. In this way, even if the first gateway 53 disconnects the remote field connection, the main device 51 can still determine the online status of the first sub-device 54 in time, so as to avoid the situation where the online status of the first sub-device 54 cannot be accurately obtained during the disconnection of the first gateway 53, thereby improving the accuracy of determining the online status of the first sub-device 54.

[0211] Exemplarily, the synchronization message may be SYNC_SUB_DEV_ONLINE. SYNC (Synchronization) may indicate that the message type is a synchronization message, and SUB_DEV_ONLINE may indicate 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 to obtain the communication connection status between the first sub-device 54 and the first gateway 53, which is not limited in this embodiment.

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

[0213] In this embodiment, when the first gateway 53 receives the synchronization message from the main device 51, it can send the first status information currently queried to LinkSvc 5113 based on the timing query result, 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 to the main device 51.

[0214] Exemplarily, when the first gateway 53 synchronizes the first status information with the main device 51, the first gateway 53 may send a first list to LinkSvc5113, wherein the first list includes the device IDs (identifications) of all first sub-devices 54 associated with the first gateway 53 and the corresponding communication connection states of the first sub-devices 54 and 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 main device 51 at one time.

[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 specific information 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 main device 51 to the main 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 can be seen from the above description, 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] Further, a first communication connection or a second communication connection may be established between the main device 51 and the first gateway 53. When the communication connection modes of the main device 51 and the first gateway 53 are different, the mode in which the main device 51 obtains the first status information may also be different. When the main device 51 and the first gateway 53 have established a first communication connection, that is, the first gateway 53 is in a far-field offline and near-field online state, the communication connection state between the first gateway 53 and the first sub-device 54 may be obtained through the above steps S109-S113. When the main device 51 and the first gateway 53 have established a second communication connection, that is, the first gateway 53 is in a far-field online and near-field online state or a far-field online and near-field offline state, the communication connection state between the first gateway 53 and the first sub-device 54 may be obtained through the above steps S101-S108. In this way, 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 to improve the accuracy of determining the online status of the first sub-device 54.

[0220] In addition, when the main 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, the first status information is obtained through the external network server 52, which can reduce the number of queries of the first gateway 53 and thus reduce resource consumption.

[0221] Please refer again Figure 6 , the method for determining the online status of the device also includes:

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

[0223] In this embodiment, after the main device 51 obtains the connection status between the first gateway 53 and the first sub-device 54, the main device 51 can obtain the communication connection status between the first gateway 53 and the main device 51 again, thereby preventing the communication connection status between the first gateway 53 and the main device 51 from changing, causing the main device 51 to incorrectly judge the online status of the first sub-device 54.

[0224] Step S115 : the 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 main device 51 .

[0225] The device status of the first sub-device 54 includes the near-field online state, the far-field online state and the offline state. 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 main device 51. For details, refer to 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 a first communication connection is established between the main device 51 and the first gateway 53, 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 a second communication connection is established between the main device 51 and the first gateway 53, LinkSvc 5113 can determine that the first sub-device 54 is in a far-field online state. When a communication connection is not established between the first gateway 53 and the first sub-device 54, or when a communication connection is not established between the first gateway 53 and the main 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 state between the first sub-device 54 and the first gateway 53 changes, the main device 51 can directly receive the first state information pushed by the server 52 of the external network when the first gateway 53 is in the far field online; the main device 51 can also request the first state information from the first gateway 53 when the first gateway 53 is in the far field offline and near field online. In other words, when the first gateway 53 cannot be connected to the external network, the main device 51 can also directly obtain the first state information from the first gateway 53 through the local area network. In this way, when determining the device online state of the first sub-device 54, the dependence on the external network can be reduced, and when the main device 51 and the first gateway 53 are disconnected from the external network, the device state of the first sub-device 54 can still be updated, so that a relatively accurate device state can be displayed to the user, so as to facilitate the user's control and improve the user's experience.

[0230] Figure 8 This is the second flow chart 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 by this embodiment is Figure 6 On the basis of:

[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 is also necessary to determine whether the device status of the first sub-device 54 needs to be updated on the APP main body 5111. Therefore, LinkSvc 5113 can obtain the historical status of the first sub-device 54 stored internally to determine whether an update is required.

[0234] Step S117: LinkSvc 5113 determines whether the current device state of the first sub-device 54 is the same as the 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 state of the first sub-device 54 is different from the historical state, LinkSvc 5113 sends a device state update message to the 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 state of the first sub-device 54 is near-field online, and the historical state is far-field online or offline, then it can be determined that the current device state of the first sub-device 54 is different from the historical state, and LinkSvc 5113 sends a device state update message to DM to update the device state of the first sub-device 54 to near-field online.

[0239] In another example, if the current device state of the first sub-device 54 is far-field online, and the historical state is near-field online or offline, then it can be determined that the current device state of the first sub-device 54 is different from the historical state, and LinkSvc 5113 sends a device state update message to DM to update the device state 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 the 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 the historical status, and 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 the historical state, the main device 51 does not need to update the device state of the first sub-device 54, LinkSvc 5113 may no longer send a message to the DM, and the process may end.

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

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

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

[0245] In this embodiment, the APP body 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 be used to 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 online 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 APP body 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 APP body 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 APP body 5111 needs to be updated.

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

[0248] In this embodiment, when the APP body 5111 displays that the first sub-device 54 is online and the first sub-device 54 is offline after being updated by DM, DM sends a message to the APP body 5111 to update the device status of the first sub-device 54 to offline. Alternatively, when the APP body 5111 displays that the first sub-device 54 is offline and the first sub-device 54 is near-field online or far-field online after being updated by DM, DM sends a message to the APP body 5111 to update the device status of the first sub-device 54 to online.

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

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

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

[0252] In this embodiment, after the main device 51 determines the device status of the first sub-device 54, it is also necessary 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 use the main device 51 to control the first sub-device 54.

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

[0254] like Fig. 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 establish a communication connection with the main device 51 through the server 52. In this way, a second communication connection is established between the first gateway 53 and the main device 51, that is, the first gateway 53 is in a remote field online state.

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

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

[0259] Specifically, the third notification message may be notifyld:DEV_ONLN. Wherein notifyld may indicate that the message type is a notification message, and DEV_ONLN may indicate that the server 52 establishes a communication connection with the first gateway 53. It is understandable that, in other embodiments, the external network server 52 may also send the message of establishing a communication connection between the server 52 and the first gateway 53 to the main device 51 through other types of messages, which is not limited in this embodiment.

[0260] Step S203: LinkSvc 5113 determines to establish 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 the 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, the first gateway 53 is in a remote online state, LinkSvc 5113 will also send the online state of the first gateway 53 to the DM so as to determine whether the first gateway 53 can be controlled through the server 52 when the DM needs it.

[0262] In the above steps S201-S203, the first gateway 53 completes the establishment of the second communication connection with the main device 51. In this way, the first gateway 53 can send the first status information to the LinkSvc 5113 through the server 52, so that the LinkSvc 5113 can 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 first status information.

[0264] In this embodiment, there may be multiple gateway devices connected to the main device 51, and the number of sub-devices associated with each gateway device is more than one. In this way, the sub-devices that can be connected to the main device 51 for communication are 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] In the case that the first gateway 53 establishes a second communication connection with the main device 51 , after determining the mounting relationship of the first gateway 53 , the 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 establishes a second communication connection with the main device 51 , the process of LinkSvc 5113 acquiring the first status information may refer to steps S101 - S108 , which will not be described in detail herein.

[0267] Step S205: LinkSvc 5113 determines a 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, so as to facilitate the determination of the device status of the first target sub-device. At the same time, since one condition that needs to be considered for the device status of the first sub-device 54 is the communication connection status between the first sub-device 54 and the first gateway 53, and the other condition is the communication connection status between the first gateway 53 and the main device 51. When any one of the above two conditions is in a state where the communication connection is not established, it can be determined that the first sub-device 54 is in an offline state. Therefore, the remaining first sub-devices 54 that have established a communication connection with the first gateway 53 are all in an offline state.

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

[0271] In this embodiment, steps S204-S206 are based on the situation that the first gateway 53 has established a second communication connection with the main device 51. 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 has not established a communication connection with the first gateway 53, then LinkSvc 5113 can determine that the first sub-device 54 is in an offline state.

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

[0273] like Fig. 9 and Fig.10 As shown, in one embodiment, the method for determining the online status of a device provided by this embodiment is Fig. 9 On the basis of

[0274] Step S207: the first gateway 53 disconnects the communication connection with the server 52.

[0275] In this embodiment, after the first gateway 53 establishes a communication connection with the server 52 , if there is a problem 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: the server 52 sends a fourth notification message to the LinkSvc 5113 .

[0277] The fourth notification message includes the disconnection status of the first gateway 53 and the server 52. In this way, the server 52 can report the disconnection status of the first gateway 53 and the server 52 to LinkSvc 5113, so that LinkSvc 5113 determines to disconnect the second communication connection with the first gateway 53.

[0278] Specifically, the fourth notification message may be notifyld:DEV_OFFLN. In which, notifyld may indicate that the message type is a notification message, and DEV_OFFLN may indicate that the server 52 disconnects the communication connection with the first gateway 53. It is understandable that, in other embodiments, the external network server 52 may also send the message of disconnecting the communication connection between the server 52 and the first gateway 53 to the main device 51 through other types of messages, which is not limited in this embodiment.

[0279] Step S209: LinkSvc 5113 receives the fourth notification message, determines to disconnect the second communication connection with the first gateway 53, and sends a message to DM that the first gateway 53 disconnects the second communication connection with the host device 51.

[0280] In this embodiment, when LinkSvc 5113 receives the fourth notification message, it can be determined that the second communication connection with the first gateway 53 is disconnected, that is, 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 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 Fig. 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. When LinkSvc 5113 determines that the first gateway 53 is in a far-field offline state, it means 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 the subsequent adjustment of the device state of the first target sub-device.

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

[0284] In this embodiment, when the first target sub-device has 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 of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM, and provide users with more accurate device states to improve 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 APP body 5111 side, and the update of the device status of the first sub-device 54 can refer to the above steps S116-S122, which will not be repeated here.

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

[0287] like Fig.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 server 52 on the external network.

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

[0290] Step S303: LinkSvc 5113 determines to establish 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 the DM.

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

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

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

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

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

[0296] In this embodiment, when the first gateway 53 and the main device 51 are in the same local area network, the first gateway 53 may send an authentication request to the main device 51 to request to establish a first communication connection with the main 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, so as to establish 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 main device 51, that is, 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 as to determine whether the first gateway 53 can be controlled through the server 52 when the DM needs it.

[0301] It is worth noting that, according to the above steps S301-S306, the first gateway 53 is in a far-field online state, and the first target sub-device is in a far-field online state. According to the above steps S307-S309, at this time, the first gateway 53 is online in the near field, that is, the first gateway 53 and the main device 51 have established a second communication connection and have not established a first communication connection, and the first gateway 53 has established a second communication connection with the main device 51.

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

[0303] In this embodiment, according to the above steps S301-S306, it can be known that 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 confirms the first target sub-device associated with the first gateway 53 again to determine which sub-devices to add the near-field online state to.

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

[0305] In this embodiment, when the first sub-device 54 is in the far-field online state, if the first gateway 53 adds a first communication connection with the main device 51, that is, when 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 state of the first sub-device 54 to the DM. In this way, when the device manager 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 main device 51. Compared with the case where the DM controls the first sub-device 54 through the second communication connection between the first gateway 53 and the main device 51, the communication path of the first communication connection can directly transmit the control signal to the first gateway 53 without relying on the external network server 52 for forwarding, and can also avoid the control delay caused by the external network delay, thereby improving the response speed of the first sub-device 54 to the control signal.

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

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

[0308] Step S312: the first gateway 53 disconnects the communication connection with the server 52.

[0309] In this embodiment, after the first gateway 53 establishes a communication connection with the server 52 , if there is a problem 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: the server 52 sends a fifth notification message to LinkSvc 5113 .

[0311] The fifth notification message includes the disconnection status of the first gateway 53 and the server 52. In this way, the server 52 can report the disconnection status of the first gateway 53 and the server 52 to LinkSvc 5113, so that LinkSvc 5113 determines to disconnect the second communication connection with the first gateway 53.

[0312] Specifically, the fifth notification message may be notifyld:DEV_OFFLN. In which, notifyld may indicate that the message type is a notification message, and DEV_OFFLN may indicate that the server 52 disconnects the communication connection with the first gateway 53. It is understandable that, in other embodiments, the external network server 52 may also send the message of disconnecting the communication connection between the server 52 and the first gateway 53 to the main device 51 through other types of messages, which is not limited in this embodiment.

[0313] Step S314: LinkSvc 5113 receives the fifth notification message, determines to disconnect the second communication connection with the first gateway 53, and sends a message to DM that the first gateway 53 disconnects the second communication connection with the host device 51.

[0314] In this embodiment, when LinkSvc 5113 receives the fifth notification message, it can be determined that the second communication connection with the first gateway 53 is disconnected, that is, 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 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 Fig.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, and in step S306, it has been determined that the first target sub-device has a far-field online state, and in step S311, it has been determined that the first target sub-device is in a near-field online state. When LinkSvc5113 determines that the first gateway 53 is in a far-field offline state, it means 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 the subsequent adjustment of the device state of the first target sub-device.

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

[0318] In this embodiment, when the first target sub-device has a remote field online state, if the first gateway 53 changes from a remote field online state to a remote 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 time according to the change of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM.

[0319] It is understandable that since the first communication connection state between the first gateway 53 and the main device 51 has not changed, the near-field online state of the first target sub-device does not need to be changed. After step S316, the first target sub-device is in the far-field offline and near-field online state.

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

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

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

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

[0324] In this embodiment, after the first gateway 53 main device 51 establishes the first communication connection, if there is a problem with the power supply, network, protocol configuration, etc. of the first gateway 53, the first communication connection of the first gateway 53 main device 51 will be disconnected.

[0325] Step S318: LinkSvc 5113 sends a message to DM to disconnect the first communication connection between the first gateway 53 and the master device 51.

[0326] In this embodiment, when LinkSvc 5113 determines that the main device 51 and the first gateway 53 disconnect the first communication connection, 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 for management and control of DM.

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

[0328] exist Fig.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, and in step S306, it has been determined that the first target sub-device has a far-field online state, and in step S311, it has been determined that the first target sub-device is in a near-field online state. When LinkSvc5113 determines that the first gateway 53 is in a near-field offline state, it means 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 the subsequent adjustment of the device state of the first target sub-device.

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

[0330] In this embodiment, when the first target sub-device has 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 time according to the change of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM.

[0331] It is understandable that since the second communication connection state between the first gateway 53 and the main device 51 has not changed, the far-field online state of the first target sub-device does not need to be changed. After step S320, the first target sub-device is in the far-field online and near-field offline state.

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

[0333] It is worth noting that the above Figures 11 to 13 In the method shown, when the first sub-device 54 is in the far-field online state or the near-field online state, if the online state of the first gateway 53 changes, the device state of the first sub-device 54 will also change. Fig.12 The method shown provides a process in which the first sub-device 54 changes from a far-field online state to a near-field online state to a far-field offline state to a near-field online state. Fig.13The method shown provides a process for the first sub-device 54 to change from the far-field online state to the near-field online state to the far-field online state and the near-field offline state. Then, when the first sub-device 54 needs to change from the far-field online state to the near-field online state to the far-field offline state and the near-field offline state, the above-mentioned Fig.12 and Fig.13 The method shown will not be repeated here.

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

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

[0336] like Fig.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 the 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 description of the above steps S401-S403 can refer to the description of steps S307-S309, which 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, there may be multiple gateway devices connected to the main device 51, and the number of sub-devices associated with each gateway device is more than one. In this way, the sub-devices that can be connected to the main device 51 for communication are 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 the LinkSvc 5113 .

[0345] It is worth noting that the description of the above steps S405-S406 can refer to the description of steps S111-S112, which 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, so as to facilitate the determination of the device status of the first target sub-device. At the same time, since one condition that needs to be considered for the device status of the first sub-device 54 is the communication connection status between the first sub-device 54 and the first gateway 53, and the other condition is the communication connection status between the first gateway 53 and the main device 51. When any one of the above two conditions is in a state where the communication connection is not established, it can be determined that the first sub-device 54 is in an offline state. Therefore, the remaining first sub-devices 54 that have established a communication connection with the first gateway 53 are all in an offline state.

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

[0350] In this embodiment, when the first gateway 53 establishes a first communication connection with the main device 51, 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 has not established a communication connection with the first gateway 53, then LinkSvc 5113 can determine that the first sub-device 54 is in an offline state.

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

[0352] like Fig.14 and Fig.15As shown, in one embodiment, the method for determining the online status of a device provided by this embodiment is Fig.14 On the basis of

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

[0354] Step S410: LinkSvc 5113 sends a message to DM to disconnect the first communication connection between the first gateway 53 and 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 description of the above steps S409-S411 can refer to steps S317-S319, which will not be repeated here.

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

[0358] In this embodiment, when the first target sub-device has 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 time according to the change of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM.

[0359] Furthermore, when the first sub-device 54 changes from the near-field online state to the near-field offline state, the device state of the first sub-device 54 should be displayed from online to offline on the APP main body 5111. The update of the device state of the first sub-device 54 can refer to the above steps S116-S122, which will not be repeated here.

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

[0361] like Fig.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 the 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 the 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 a near field online status for the first target sub-device.

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

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

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

[0373] Step S511: LinkSvc 5113 determines to establish 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 the DM.

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

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

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

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

[0378] In this embodiment, when the first sub-device 54 is in the near-field online state, if the first gateway 53 adds a second communication connection with the main device 51, that is, when 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 state of the first sub-device 54 to the DM. In this way, when the device manager 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 main device 51. Compared with the case where the DM controls the first sub-device 54 through the second communication connection between the first gateway 53 and the main device 51, the communication path of the first communication connection can directly transmit the control signal to the first gateway 53 without relying on the external network server 52 for forwarding, and can also avoid the control delay caused by the external network delay, thereby improving the response speed of the first sub-device 54 to the control signal.

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

[0380] like Fig.16 and Fig.17 As shown, in one embodiment, the method for determining the online status of a device provided by this embodiment is Fig.16 On the basis of

[0381] Step S515: the first gateway 53 disconnects the communication connection with the server 52.

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

[0383] Step S517: LinkSvc 5113 receives the fifth notification message, determines to disconnect the second communication connection with the first gateway 53, and sends a message to DM that the first gateway 53 disconnects the second communication connection with the host device 51.

[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 a far-field offline state for the first target sub-device.

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

[0387] In this embodiment, when the first target sub-device has a remote field online state, if the first gateway 53 changes from a remote field online state to a remote 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 time according to the change of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM.

[0388] It is understandable that since the first communication connection state between the first gateway 53 and the main device 51 has not changed, the near-field online state of the first target sub-device does not need to be changed. After step S519, the first target sub-device is in the far-field offline and near-field online state.

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

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

[0391] like Fig.16 and Fig.18 As shown, in one embodiment, the method for determining the online status of a device provided by this embodiment is Fig.16 On the basis of

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

[0393] Step S521: LinkSvc 5113 sends a message to DM to disconnect the first communication connection between the first gateway 53 and 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 description of the above steps S520-S522 can refer to steps S317-S319, which will not be repeated here.

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

[0397] In this embodiment, when the first target sub-device has 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 time according to the change of the online state of the first gateway 53, so as to facilitate the management and control of the first target sub-device by DM.

[0398] It is understandable that since the second communication connection state between the first gateway 53 and the main device 51 has not changed, the far-field online state of the first target sub-device does not need to be changed. After step S523, the first target sub-device is in the far-field online and near-field offline state.

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

[0400] It is worth noting that the above Figure 17 to Figure 18 In the method shown, when the first sub-device 54 is in the far-field online state or the near-field online state, if the online state of the first gateway 53 changes, the device state of the first sub-device 54 will also change. Fig.17 The method shown provides a process in which the first sub-device 54 changes from a far-field online state to a near-field online state to a far-field offline state to a near-field online state. Fig.18 The method shown provides a process for the first sub-device 54 to change from the far-field online state to the near-field online state to the far-field online state and the near-field offline state. Then, when the first sub-device 54 needs to change from the far-field online state to the near-field online state to the far-field offline state and the near-field offline state, the above-mentioned Fig.17 and Fig.18 The method shown will not be repeated here.

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

[0402] As can be seen from the above description, when the communication connection state between the first sub-device 54 and the first gateway 53 changes, and the communication connection state between the first gateway 53 and the main device 51 changes, the device state of the first sub-device 54 will also change accordingly, and it is necessary to update the device state of the first sub-device 54 displayed by the APP body 5111. However, when the online state of the main device 51 changes, it is also necessary to re-acquire the online state of the first sub-device 54.

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

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

[0405] Step S601 : When the communication connection between the main device 51 and the server 52 is not established, the DM sends a second request message to the LinkSvc 5113 in response to the main device 51 establishing a communication connection with the server 52 .

[0406] The second request message includes a device status list in the DM.

[0407] In this embodiment, when the main device 51 is disconnected from the network or shut down, if the main device 51 is reconnected or turned on, the DM needs to request LinkSvc 5113 to refresh the device list, so as to timely update the device status of the first sub-device 54 for user control.

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

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

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

[0411] Step S603: The 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 may 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 the 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, which will not be repeated here.

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

[0416] like Fig. 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 a first communication connection is established between the master device 51 and the first gateway 53 and the first gateway 53 is not connected to an external network, the master device 51 obtains first status information from the first gateway 53 .

[0418] The first communication connection includes a communication connection between the main device 51 and the first gateway 53 via a local area network. The first status information includes a 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 main 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 main device 51 and the first gateway 53 .

[0420] Wherein, in the case where the first gateway 53 establishes a communication connection with the first sub-device 54, if the main device 51 establishes a first communication connection with the first gateway 53, the main device 51 determines that the first sub-device 54 is in a near-field online state. If the main device 51 establishes a second communication connection with the first gateway 53, the main device 51 determines that the first sub-device 54 is in a far-field online state, and the second communication connection includes a communication connection between the main device 51 and the first gateway 53 through the server 52 of the external network.

[0421] In this embodiment, when the first gateway 53 is disconnected from the external network or cannot be connected to the external network, the main 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. At the same time, the main device 51 can determine the device status of the first sub-device 54 based on the communication connection status between the first gateway 53 and the main device 51 and the first status information. In this way, the main device 51 can not only determine the device status of the first sub-device 54 when the main device 51 and the first gateway 53 are disconnected from the external network, so as to reduce the dependence on the external network when confirming the device status of the first sub-device 54, so as to timely update the device status of the first sub-device 54, improve the accuracy of determining the device status of the first sub-device 54, and thus improve the user experience. At the same time, 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 main device 51 can control the first sub-device 54 through the near field or the far field.

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

[0423] Before determining the device status of the first sub-device 54 , when the main device 51 and the first gateway 53 have established a second communication connection, the main device 51 obtains the first status information reported by the first gateway 53 from the server 52 .

[0424] It is understandable that, when the master device 51 establishes a second communication connection with the first gateway 53 , the master device 51 may also establish a first communication connection with the first gateway 53 , or the master device 51 does not establish a first communication connection with the first gateway 53 .

[0425] In this way, when the main device 51 and the first gateway 53 can establish a connection by relying on the server 52 of the external network, the main device 51 can directly obtain the first status information reported by the server 52, and thus there is no 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, thereby reducing the consumption of resources.

[0426] The present application embodiment provides an electronic device, which may include: a display screen (such as a touch screen or a non-touch screen), a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 3 The structure of the electronic device shown.

[0427] Fig.21 A structural block diagram of a chip system provided in an embodiment.

[0428] The present application also provides a chip system, such as Fig.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 can be interconnected via lines. For example, the interface circuit 2102 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 2102 can be used to send signals to other devices (such as a processor 2101 or a touch screen of an electronic device). Exemplarily, the interface circuit 2102 can read instructions stored in the memory and send the instructions to the processor 2101. When the instruction is executed by the processor 2101, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0429] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.

[0430] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes each function or step executed by the electronic device in the above method embodiment.

[0431] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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 easy to understand that those skilled in the art can combine, split, reorganize, etc. the embodiments of the present application to obtain other embodiments based on the several embodiments provided in the present application, and these embodiments do not exceed the protection scope of the present application.

[0433] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0434] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0435] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0436] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to make a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), disk or optical disk and other media that can store program code. It should be noted that those skilled in the art will easily think of other implementation schemes of the present application after considering the specification and practicing the application disclosed here. The present application is intended to cover any variants, uses or adaptive changes of the present application, which follow the general principles of the present application and include the common knowledge or customary technical means in the technical field that are not disclosed in the present application. It is intended that the specification and examples be considered as exemplary only, with the true scope of the application being indicated by the claims.

[0437] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for determining the online status of a device, characterized in that: include: When a first communication connection is established between the master device and 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 through a local area network, and the first status information includes a communication connection status 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; The main device determines the device state of the first sub-device based on the first state information and the communication connection state between the main device and the first gateway, wherein: In the case where the first gateway and the first sub-device have established a communication connection, if the main device and the first gateway have established a first communication connection, the main device determines that the first sub-device is in a near-field online state; When the first gateway establishes a communication connection with the first sub-device, if the main device establishes a second communication connection with the first gateway, the main device determines that the first sub-device is in a remote online state, and the second communication connection includes a server-side communication connection between the main device and the first gateway through an external network.

2. The method for determining the online status of a device according to claim 1, characterized in that: Before determining the device state of the first sub-device, the method further includes: In a case where the second communication connection is established between the master device and 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 a device 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: In the case that the main device does not establish a communication connection with the first gateway, the main device determines that the first sub-device is in an offline state.

4. The method for determining the online status of a device 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: In a case where the first gateway and the first sub-device do not establish a communication connection, the main device determines that the first sub-device is in an offline state.

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

6. The method for determining the online status of a device according to claim 1, characterized in that: Also includes: In a case where 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 acquires the first status information from the first gateway.

7. The method for determining the online status of a device according to claim 1, characterized in that: Also includes: In a case where the main device has not established the second communication connection with the first gateway, in response to the main device establishing the second communication connection with the first gateway, the main device adds a remote online status for a first target sub-device, and the first target sub-device includes the first sub-device that has established a communication connection with the first gateway.

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

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

10. The method for determining the online status of a device according to claim 1, characterized in that: Also includes: In a case where the main device establishes the second communication connection with the first gateway device and the first communication connection is not established, in response to the main device disconnecting the second communication connection with the first gateway, the main device adds a remote-field offline state for a first target sub-device, and the first target sub-device includes the first sub-device that has established a communication connection with the first gateway.

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

12. The method for determining the online status of a device according to claim 1, characterized in that: Also includes: In the case where the master device and the server have not established a communication connection, in response to the master device and the server establishing 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, where the first response message includes the first status information.

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

14. The method for determining the online status of a device according to claim 13, characterized in that: Before determining the device state of the first sub-device, the method further includes: In a case where the second communication connection is established between the master device and the first gateway, the link service LinkSvc obtains a notification message sent by the server, where the notification message includes the first status information.

15. The method for determining the online status of a device according to claim 13, characterized in that: The determining the device state of the first sub-device based on the first state information and the communication connection state between the main device and the first gateway includes: The link service LinkSvc determines that the first sub-device is in a near field online state when the first gateway establishes a communication connection with the first sub-device and if the main device establishes the first communication connection with the first gateway.

16. The method for determining the online status of a device according to claim 13, characterized in that: The determining the device state of the first sub-device based on the first state information and the communication connection state between the main device and the first gateway includes: The link service LinkSvc determines that the first sub-device is in a far-field online state if the host device establishes the second communication connection with the first gateway when the first gateway establishes a communication connection with the first sub-device.

17. The method for determining the online status of a device according to claim 13, characterized in that: After the master device acquires the first status information, the method further includes: The link service LinkSvc determines that the first sub-device is in an offline state when the main device has not established a communication connection with the first gateway.

18. The method for determining the online status of a device according to claim 13, characterized in that: After the master device acquires the first status information, the method further includes: The link service LinkSvc determines that the first sub-device is in an offline state when the first gateway and the first sub-device do not establish a communication connection.

19. The method for determining the online status of a device according to any one of claims 15 to 18, characterized in that: The main device also includes a device management module DM, The method further comprises: The link service LinkSvc obtains the historical status of the first sub-device; The link service LinkSvc determines whether the current device state of the first sub-device is the same as the historical state; If the current device state of the first sub-device is different from the historical state, the link service LinkSvc sends a device state update message to the device management module DM, where the device state update message includes the current device state 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.

20. The method for determining the online status of a device according to claim 13, characterized in that: The master device further includes a device management module DM, and the method further includes: The device management module DM sends a second request message to the link service LinkSvc in response to the master device establishing a communication connection with the server when the master device and the server have not established a communication connection; The link service LinkSvc sends a first request message to the server in response to the second request message; The link service LinkSvc receives a first response message sent by the server in response to the first request message, where the first response message includes the first state information.

21. A device online status determination system, characterized in that: include: A main device, a first gateway, and at least one first sub-device, where the first sub-device is a sub-device associated with the first gateway; The master device is configured to: when a first communication connection is established between the master device and the first gateway and the first gateway is not connected to an external network, obtain 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 a communication connection status between the first gateway and at least one first sub-device; The main device is further configured to determine a device state of the first sub-device based on the first state information and a communication connection state between the main device and the first gateway, wherein: In the case where the first gateway establishes a communication connection with the first sub-device, if the main device establishes a first communication connection with the first gateway, the main device is configured to determine that the first sub-device is in a near-field online state; In the case where the first gateway establishes a communication connection with the first sub-device, if the main device establishes a second communication connection with the first gateway, the main device is configured to determine that the first sub-device is in a remote field online state, and the second communication connection includes a server-side communication connection between the main device and the gateway through an external network.

22. The device online status determination system according to claim 21, characterized in that: The main device is further configured to: after the main device obtains the first status information from the first gateway, if no communication connection is established between the main device and the first gateway, determine that the first sub-device is in an offline state.

23. The device online status determination system according to claim 21, characterized in that: The main device is further configured to: after the main device obtains the first status information from the first gateway, if the first gateway has not established a communication connection with the first sub-device, determine that the first sub-device is in an offline state.

24. The device online status determination system according to claim 21, characterized in that: The main device is further configured to: when the main device has established the second communication connection with the first gateway and the main device has not established the first communication connection with the first gateway, in response to the main device establishing the first communication connection with the first gateway, add a near-field online status for 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.

25. The device online status determination system according to claim 21, characterized in that: The main device is also configured to: in a case where the second communication connection is not established between the main device and the first gateway, in response to the main device establishing the second communication connection with the first gateway, add a remote-field online status for 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.

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

27. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method for determining the online status of a device as claimed in any one of claims 1 to 20.

28. A computer program product, characterized in that When the computer program product runs on a computer, the computer is enabled to execute the method for determining the online status of a device according to any one of claims 1 to 20.

Citation Information

Patent Citations

  • Method and device for safely controlling intelligent home appliances

    CN106302039A

  • IoT gateway and work method thereof

    CN108377219A

  • Anti-offline method for wireless equipment

    CN110505648A

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

    CN111031565A

  • Equipment state monitoring method, equipment state monitoring device and readable storage medium

    CN113596884A