Method and system for maintaining information and state of smart home equipment
Monitoring and synchronizing the status information of smart home devices through the cloud device status service, combined with the transparent transmission gateway's network presence and absence judgment and device heartbeat judgment, solves the problem of accuracy and timeliness of device status maintenance under cloud management, and realizes smart home Timely and effective display and synchronization of device status.
Patent Information
- Application Number
- CN202310207621.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-06
AI Technical Summary
When managing smart home devices in thousands of households in the cloud, existing technology is difficult to effectively maintain the status information of the devices, resulting in inaccurate and untimely status maintenance.
Monitor the status reported smart home device information through the cloud device status service, determine status changes, store and synchronize them, and perform logical processing and forwarding based on the reported source of the status information to ensure that the device status is updated and displayed in a timely manner when it changes, including transparent transmission gateways The network presence and absence judgment and device heartbeat judgment are used to ensure the accuracy of the status.
It achieves timely and effective display and accurate maintenance of smart home device status, avoids illegal status reporting and erroneous maintenance under network conditions, and ensures real-time update and synchronization of device status.
Smart Images

Figure CN118611999A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart home, and in particular relates to a method and system for maintaining information and status of smart home devices. Background Art
[0002] The control of existing smart homes is based on the edge computing of the host, that is, the host status and logical processing are all performed on the host side. For example, when controlling a device, the device status changes, and the device sends a status change information, such as changing from off to on. The information is first sent to the host, and the host maintains this status in its memory. When viewed with an app, the device status maintained by the host is individual, that is, if a family is equipped with one host, then the host of a family can only maintain the status of one family.
[0003] Now, in order to enable unified management and control of smart home devices, the functions of the host are transferred to the cloud, and the cloud and the smart home device end need gateway devices to transmit information, and then the unified management of smart home devices in each household is realized through cloud computing. This gateway device only has the function of information transmission and no data processing function, that is, the gateway device cannot maintain the status, so it needs the cloud to maintain the status. At this time, the cloud maintains the status of thousands of households. Therefore, when the status of each device changes, the cloud needs to maintain the status of different devices in different categories. Therefore, it is urgent to propose a way to ensure the correct maintenance of smart home device information and status when facing thousands of smart home devices in the cloud to achieve smart home device information and status maintenance. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for maintaining the information and status of smart home devices, so as to solve the problem of correctly maintaining the information and status of smart home devices in thousands of households based on cloud computing.
[0005] To solve the above technical problems, the present invention provides a method for maintaining smart home device information and status, comprising the following steps:
[0006] 1) The device status service in the cloud monitors the status information of the smart home devices reported, and determines whether the status information of the smart home devices reported has changed;
[0007] 2) If a change occurs, the status information is stored and transmitted to the corresponding module according to the reporting source of the status information, so that the corresponding module can synchronize the status information of the smart home device; the reporting source includes at least one of the device status information reported by the cloud device service, the device status information reported by the smart single product device through the single product business service, and the device actively reporting the device status information through the transparent transmission gateway.
[0008] The beneficial effects are as follows: the present invention performs corresponding logical processing according to the reporting source of the status information, that is, when the device status changes, the device status information in the status service is first updated, and then the corresponding device status information is forwarded according to the reporting source of the status information, so as to ensure that the status information of the corresponding device can be displayed in time and effectively when it needs to be displayed. The reporting source of the status information in the present invention can be one or more of the status information reported by the intelligent control service in the cloud, the status information reported by the intelligent single product through the single product business service, and the status information actively reported by the device. The first two reporting sources are actively obtained by the cloud after the cloud intelligent control, and then the status information of the device can be quickly updated after the control, thereby ensuring the timely and effective display of the status after the smart home control. In addition, the active reporting of the device status of the present invention can monitor the status of the device in real time, thereby ensuring that the cloud data can be updated in time when the status of the device is updated, thereby ensuring the accuracy and timeliness of maintaining the device status.
[0009] Furthermore, in step 2), when the reporting source is that the device actively reports the device status information through the transparent transmission gateway, the transparent transmission gateway device first determines the legitimacy of the device, and when the legitimacy of the device is met, determines whether there is a network or not, and forwards the protocol corresponding to the status information of the smart home device to the cloud according to the network or not. The cloud obtains the network or not according to the content of the protocol, and forwards the status information directly to the user end when there is no network, and stores the status information before forwarding it to the user end when there is a network.
[0010] In the present invention, when the reporting source is the active reporting of the device, the legality of the reported information is first determined to ensure that the reported device status is the real device status, thereby avoiding the situation where the wrong device status is reported due to illegal behavior. In addition, after the device status is legal, the transparent transmission gateway device is used to determine whether there is a network. Because the device status maintenance processes are different in the two different situations of having a network or not, the correct device status maintenance process is guaranteed based on the judgment of whether there is a network or not based on the transparent transmission gateway, and the corresponding process is performed under the corresponding state to realize the status maintenance of the device.
[0011] Furthermore, in step 2), if the reported status information of the smart home device changes and the smart home device is bound to other devices, the status information of the smart home device is forwarded to the other devices.
[0012] The present invention also takes into account the possibility that smart home devices may be bound to other devices. In this case, it is necessary to synchronize the device status to other devices to ensure the correct implementation of related services such as data processing and status monitoring of the smart home devices by other devices; for example, the fresh air panel and smart screen are bound to the air-conditioning equipment. After the air-conditioning equipment reports its status, it is necessary to synchronize the device status data to the fresh air panel or other bound devices. This operation needs to be judged based on the device type and the device binding relationship, and then an instruction is issued to the air-conditioning fresh air panel to synchronize the status display.
[0013] Furthermore, in step 1), the status information includes the device heartbeat. In step 2), when the cloud receives the device heartbeat, it determines that the device is online and updates the device status to an online status. When the cloud does not receive the device heartbeat within a first set time, it determines that the device is offline and updates the device status to an offline status.
[0014] Furthermore, in step 2), when the device heartbeat is not received within the second set time, the cloud actively queries the device status once. If the device heartbeat is still not received within the second set time, the device is judged to be offline; the first set time is not less than twice the second set time.
[0015] The present invention also judges the offline or online status of the device through the device heartbeat, and judges that the device is online when the device heartbeat is received. When the device heartbeat is not received within the second set time, the device status is judged again by actively obtaining the device status. If the device heartbeat is not received twice, the device is judged to be offline. The second set time in the present invention is set according to the device heartbeat reporting time interval. In order to avoid the situation where the device heartbeat is not received within the second set time due to poor signal and other reasons, the present invention judges that the device is offline only after the device heartbeat is not received twice, thereby ensuring the accuracy of the device offline and online status maintenance.
[0016] To solve the above technical problems, the present invention further provides a system for maintaining information and status of smart home devices, including a server, wherein the server is used to execute instructions to implement the following steps:
[0017] 1) The device status service monitors the status information of the smart home device reported, and determines whether the reported status information of the smart home device has changed;
[0018] 2) If a change occurs, the status information is stored and transmitted to the corresponding module according to the reporting source of the status information, so that the corresponding module can synchronize the status information of the smart home device; the reporting source includes at least one of the device status information reported by the cloud device service, the device status information reported by the smart single product device through the single product business service, and the device actively reporting the device status information through the transparent transmission gateway.
[0019] The beneficial effects are as follows: the present invention performs corresponding logical processing according to the reporting source of the status information, that is, when the device status changes, the device status information in the status service is first updated, and then the corresponding device status information is forwarded according to the reporting source of the status information, so as to ensure that the status information of the corresponding device can be displayed in time and effectively when it needs to be displayed. The reporting source of the status information in the present invention can be one or more of the status information reported by the intelligent control service in the cloud, the status information reported by the intelligent single product through the single product business service, and the status information actively reported by the device. The first two reporting sources are actively obtained by the cloud after the cloud intelligent control, and then the status information of the device can be quickly updated after the control, thereby ensuring the timely and effective display of the status after the smart home control. In addition, the active reporting of the device status of the present invention can monitor the status of the device in real time, thereby ensuring that the cloud data can be updated in time when the status of the device is updated, thereby ensuring the accuracy and timeliness of maintaining the device status.
[0020] Furthermore, in step 2), when the reporting source is that the device actively reports the device status information through the transparent transmission gateway, the transparent transmission gateway device first determines the legitimacy of the device, and when the legitimacy of the device is met, determines whether there is a network or not, and forwards the protocol corresponding to the status information of the smart home device to the cloud according to the network or not. The cloud obtains the network or not according to the content of the protocol, and forwards the status information directly to the user end when there is no network, and stores the status information before forwarding it to the user end when there is a network.
[0021] In the present invention, when the reporting source is the active reporting of the device, the legality of the reported information is first determined to ensure that the reported device status is the real device status, thereby avoiding the situation where the wrong device status is reported due to illegal behavior. In addition, after the device status is legal, the transparent transmission gateway device is used to determine whether there is a network. Because the device status maintenance processes are different in the two different situations of having a network or not, the correct device status maintenance process is guaranteed based on the judgment of whether there is a network or not based on the transparent transmission gateway, and the corresponding process is performed under the corresponding state to realize the status maintenance of the device.
[0022] Furthermore, in step 2), if the reported status information of the smart home device changes and the smart home device is bound to other devices, the status information of the smart home device is forwarded to the other devices.
[0023] The present invention also takes into account the possibility that smart home devices may be bound to other devices. In this case, it is necessary to synchronize the device status to other devices to ensure the correct implementation of related services such as data processing and status monitoring of the smart home devices by other devices; for example, the fresh air panel and smart screen are bound to the air-conditioning equipment. After the air-conditioning equipment reports its status, it is necessary to synchronize the device status data to the fresh air panel or other bound devices. This operation needs to be judged based on the device type and the device binding relationship, and then an instruction is issued to the air-conditioning fresh air panel to synchronize the status display.
[0024] Further, in step 1), the status information includes a device heartbeat. In step 2), when the device heartbeat is received, the device is judged to be online and the device status is updated to an online status. When the device heartbeat is not received within a first set time, the device is judged to be offline and the device status is updated to an offline status.
[0025] Furthermore, in step 2), when the device heartbeat is not received within the second set time, the device status is actively queried from the device once. If the device heartbeat is still not received within the second set time, the device is judged to be offline; the first set time is not less than twice the second set time.
[0026] The present invention also judges the offline or online status of the device through the device heartbeat, and judges that the device is online when the device heartbeat is received. When the device heartbeat is not received within the second set time, the device status is judged again by actively obtaining the device status. If the device heartbeat is not received twice, the device is judged to be offline. The second set time in the present invention is set according to the device heartbeat reporting time interval. In order to avoid the situation where the device heartbeat is not received within the second set time due to poor signal and other reasons, the present invention judges that the device is offline only after the device heartbeat is not received twice, thereby ensuring the accuracy of the device offline and online status maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the source of device status reporting of the present invention;
[0028] Figure 2 It is a diagram of the architecture of the device status reporting system of the present invention;
[0029] Figure 3 This is a flow chart of reporting device status in a network-free state of the present invention;
[0030] Figure 4 It is a schematic diagram of the device status reporting process of the present invention;
[0031] Figure 5 It is a device status reporting logic flow chart of the present invention;
[0032] Figure 6It is a schematic diagram of the device heartbeat reporting process of the present invention;
[0033] Figure 7 It is a schematic diagram of the device status update process of the present invention;
[0034] Figure 8 It is a schematic diagram of the device off-grid judgment process of the present invention;
[0035] Fig. 9 It is a schematic diagram of the process of actively querying the status of a single device in the cloud of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0037] Method embodiment for maintaining smart home device information and status:
[0038] The method for maintaining smart home device information and status in the present embodiment is a cloud-based maintenance process. Since the smart home devices maintained in the cloud are smart home devices in thousands of households, it is necessary to ensure the efficiency of cloud device maintenance and the timely and accurate display of the real-time status of the devices. In the present embodiment, after receiving the status information, corresponding logical processing is performed according to different sources of the status information to achieve the process of updating and displaying the status information of different sources on the corresponding devices. The status information in the present embodiment includes the on / off status of lamps, the temperature of the air conditioner, the wind speed of the air conditioner, etc.
[0039] like Figure 1 As shown, the sources of device status reporting in this embodiment include device execution, host reporting of device status, and smart products (such as background music, hue, smart screen, etc.), where device execution is the process of cloud-based intelligent realization of device status reporting after the execution of device actions, host reporting of device status is the process of the device actively reporting device status information through the host (i.e., transparent transmission gateway device), and smart product reporting of status information is the status reporting process performed through the product business service, as shown in the following figure. Figure 2 As shown in the figure, after the device service controls the device, it sends the control content to Kafka, which is monitored by the device status and performs logical processing; the single product device (intelligent single product device) reports the single product business service, the single product business service performs the instruction transfer model, and then sends it to the device status service through Kafka, which is monitored and performed logical processing by the device status; the Zigbee device reports the host device status, which is forwarded to emqx after host-central control decoding, and the device status service monitors the MQTT protocol and performs logical processing.
[0040] In this embodiment, different state maintenance processes are performed for network and non-network. The network maintenance process is as follows: Figure 3 As shown, the device reports the device status to the host. The host determines the device status protocol and determines that there is no network. At this time, it forwards the common to the cloud emqx, and emqx forwards the information to the APP (user end). The user end parses the original command and updates the device status. Figure 4 As shown, the device reports the device status, and the host determines the network status after judging the device status protocol. At this time, the corresponding protocol is forwarded to emqx, and emqx forwards it to the central control service in the cloud. The central control service parses the instruction and forwards it according to the rules, and forwards it to emqx again. At this time, the device status service monitors the device status information, and then the device status service updates the status and sends an internal message notification of the APP to emqx. At this time, the APP monitors the information sent by the device status service in emqx and updates the status change. The host in this embodiment has the functions of verifying the legitimacy of the device, forwarding the status report type to the cloud, customizing the protocol, and the host judging whether there is a network, whether there is a network, and what protocol to send. The device status service has the functions of receiving the device status changes reported by the host, updating the device status changes, sending the common protocol to emqx, forwarding intelligent services, and forwarding message services. The APP has the functions of monitoring the common protocol to update the device status and realize the page status update changes.
[0041] like Figure 5 As shown, this embodiment also takes into account the possibility that the smart home device may be bound to other devices. In this case, it is necessary to synchronize the device status to other devices to ensure the correct implementation of related services such as data processing and status monitoring of the smart home device by other devices; for example, the fresh air panel and smart screen are bound to the air-conditioning equipment. After the air-conditioning equipment reports its status, it is necessary to synchronize the device status data to the fresh air panel or other bound devices. This operation needs to be judged according to the device type and the device binding relationship, and then an instruction is issued to the air-conditioning fresh air panel to synchronize the status display.
[0042] In this embodiment, the device status includes the device heartbeat. The heartbeat is a type of device status reporting and can be distinguished according to the D8 function code X024 in the zigbee instruction reported by the device. The heartbeat data of different device types are divided into two cases: 1. Heartbeat with device status data; 2. Heartbeat without device status data.
[0043] Device offline judgment: If the heartbeat is not received for a certain time, it may be due to poor signal or other reasons. The device status will be actively queried from the device once. If the heartbeat status is not received for the second time, the device status will be actively queried from the device again. If no result is received, the device will be updated to offline. Figure 6As shown in the figure, the device reports the heartbeat through the host and forwards it to the cloud. Finally, the cloud status service module performs the corresponding business processing. The transparent gateway distinguishes the heartbeat identifier in the device report instruction code and reports it to a separate topic. After the central control service obtains the heartbeat data, it parses the instruction to obtain the object model json data and forwards it to the device status service according to the rules. The device status service updates the device status and notifies the APP and internal services. Figure 7 As shown, in this embodiment, the online and offline states of the device are first determined, and then the change of the device action state is determined when the device is in the online state, thereby ensuring the updating efficiency of the device state.
[0044] like Figure 8 The following is the process of determining whether the device is online or not in this embodiment: Off-network detection: The heartbeat reporting interval of each device type is different. If the cloud wants to monitor which devices have not reported heartbeats, the device status service needs to regularly query the device's last heartbeat time, and compare the difference with the current time to determine whether the device is off-network. Since the interval of each device type is different and the service is multi-node, the scheduled task method is not suitable. Therefore, consider using the redis Zset queue to implement device off-network monitoring. The specific implementation logic is as follows:
[0045] 1. After the device is connected to the network for the first time, the device type is determined. If there is a heartbeat report, the device information and the time of disconnection are put into the zset queue. The key is the device's sn, deviceId, heartbeat timeout times and other attributes, which are serialized and inserted as values, and the timeout time (current date + device heartbeat interval) is used as the score.
[0046] 2. Create an independent thread to poll and query the data in zset that is less than the current time, that is, the data that has not been reported due to the timeout heartbeat. After obtaining the data, determine the number of timeouts. If it is one, actively obtain the device status. If the acquisition is not successful, increase the timeout number by 1 and put it into the zset queue again. If the heartbeat times out twice in a row and the device status is not successfully obtained, the obtained device information will be updated to off-network.
[0047] 3. Every time the device reports a heartbeat or performs a device operation (status update to the device status service), the device timeout is recalculated (current date + device heartbeat interval) as the score, and the timeout count is initialized and put back into the redis queue.
[0048] The process of actively querying the status of a single device in the cloud during off-grid judgment is as follows: Fig. 9As shown, the information querying the status of a single device is transmitted to the central control service through the status service, and the information is transmitted to the device side through the forwarding of the central control service, EMQX and the host. Then, when the device side receives the query information, it reports the device status, realizing the process of actively querying the status of a single device in the cloud.
[0049] The present invention performs corresponding logical processing according to the reporting source of status information, that is, when the device status changes, the device status information in the status service is first updated, and then the corresponding device status information is forwarded according to the reporting source of the status information, so as to ensure that the status information of the corresponding device can be displayed in time and effectively when it needs to be displayed. The reporting source of status information in the present invention can be one or more of the status information reported by the intelligent control service of the cloud, the status information reported by the intelligent single product through the single product business service, and the status information actively reported by the device. The first two reporting sources are actively obtained by the cloud after the cloud intelligent control, and then the status information of the device can be quickly updated after the control, thereby ensuring the timely and effective display of the status after the smart home control. In addition, the active reporting of the device status of the present invention can monitor the status of the device in real time, thereby ensuring that the cloud data can be updated in time when the status of the device is updated, thereby ensuring the accuracy and timeliness of maintaining the device status.
[0050] System implementation for maintaining smart home device information and status:
[0051] The system for maintaining smart home device information and status of this embodiment includes a server, and the server is used to execute instructions to implement the method process of maintaining smart home device information and status. The method process of maintaining smart home device information and status has been described in detail in the method embodiment of maintaining smart home device information and status, and will not be repeated here.
[0052] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. The patent protection scope of the present invention shall be based on the claims. All equivalent structural changes made using the contents of the description and drawings of the present invention should also be included in the protection scope of the present invention.
Claims
1. A method for maintaining information and status of smart home devices, It is characterized in that The steps include: 1) The device status service in the cloud monitors the status information of the smart home devices reported, and determines whether the status information of the smart home devices reported has changed; 2) If a change occurs, the status information is stored and transmitted to the corresponding module according to the reporting source of the status information, so that the corresponding module can synchronize the status information of the smart home device; the reporting source includes at least one of the device status information reported by the cloud device service, the device status information reported by the smart single product device through the single product business service, and the device actively reporting the device status information through the transparent transmission gateway.
2. The method for maintaining smart home device information and status according to claim 1, It is characterized in that In step 2), when the reporting source is that the device actively reports the device status information through the transparent transmission gateway, the transparent transmission gateway device first determines the legitimacy of the device, and when the legitimacy of the device is met, determines whether there is a network or not, and forwards the protocol corresponding to the status information of the smart home device to the cloud according to the network or not. The cloud obtains the network or not according to the content of the protocol, and forwards the status information directly to the user end when there is no network, and stores the status information before forwarding it to the user end when there is a network.
3. The method for maintaining smart home device information and status according to claim 1, It is characterized in that In step 2), if the reported status information of the smart home device changes and the smart home device is bound to other devices, the status information of the smart home device is forwarded to the other devices.
4. The method for maintaining smart home device information and status according to claim 1, It is characterized in that In step 1), the status information includes the device heartbeat. In step 2), when the cloud receives the device heartbeat, it determines that the device is online and updates the device status to the online status. When the cloud does not receive the device heartbeat within the first set time, it determines that the device is offline and updates the device status to the offline status.
5. The method for maintaining smart home device information and status according to claim 4, It is characterized in that In step 2), when the device heartbeat is not received within the second set time, the cloud actively queries the device status once. If the device heartbeat is still not received within the second set time, the device is judged to be offline; the first set time is not less than twice the second set time.
6. A system for maintaining information and status of smart home devices, It is characterized in that The method comprises a server, wherein the server is used to execute instructions to implement the following steps: 1) The device status service monitors the status information of the smart home device reported, and determines whether the reported status information of the smart home device has changed; 2) If a change occurs, the status information is stored and transmitted to the corresponding module according to the reporting source of the status information, so that the corresponding module can synchronize the status information of the smart home device; the reporting source includes at least one of the device status information reported by the cloud device service, the device status information reported by the smart single product device through the single product business service, and the device actively reporting the device status information through the transparent transmission gateway.
7. The system for maintaining smart home device information and status according to claim 6, It is characterized in that In step 2), when the reporting source is that the device actively reports the device status information through the transparent transmission gateway, the transparent transmission gateway device first determines the legitimacy of the device, and when the legitimacy of the device is met, determines whether there is a network or not, and forwards the protocol corresponding to the status information of the smart home device to the cloud according to the network or not. The cloud obtains the network or not according to the content of the protocol, and forwards the status information directly to the user end when there is no network, and stores the status information before forwarding it to the user end when there is a network.
8. The system for maintaining smart home device information and status according to claim 6, It is characterized in that In step 2), if the reported status information of the smart home device changes and the smart home device is bound to other devices, the status information of the smart home device is forwarded to the other devices.
9. The system for maintaining smart home device information and status according to claim 6, It is characterized in that In step 1), the status information includes the device heartbeat. In step 2), when the device heartbeat is received, the device is judged to be online and the device status is updated to the online status. When the device heartbeat is not received within the first set time, the device is judged to be offline and the device status is updated to the offline status.
10. The system for maintaining smart home device information and status according to claim 9, It is characterized in that In step 2), when the device heartbeat is not received within the second set time, the device status is actively queried from the device. If the device heartbeat is still not received within the second set time, the device is judged to be offline; the first set time is not less than twice the second set time.
Citation Information
Cited By
Equipment state reporting method, system and device, equipment and storage medium
CN119629225A
