Device Display Status Update Method, Device, Electronic Device, and Storage Medium
By obtaining the historical data of the target device, determining the query time node and sending status confirmation instructions, the false offline problem in the wireless network is solved, and accurate monitoring and control of the device status is achieved.
Patent Information
- Application Number
- CN202210358717.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-04-06
AI Technical Summary
In wireless networks, due to poor network conditions and other factors, communication failure between the cloud and some sub-devices, resulting in the status displayed by the sub-device does not match the actual real state, and there is a false offline situation, and the cloud cannot accurately monitor the real state of the equipment.
By obtaining the historical data of the target device, determining its query time node. When the query time node is reached, a status confirmation instruction is sent to the target device. If the response information is received, the display status of the target device is updated to the online status.
Accurately detect the real status of the target device, avoid fake offline situations, and ensure that the cloud can effectively monitor and control the device.
Smart Images

Figure CN114900846B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technologies, and more specifically, to a method, apparatus, electronic device, and storage medium for updating the display status of a device. Background Art
[0002] With the development of wireless network technologies, more and more devices have the ability to connect to the network, and these devices can be remotely controlled through the network. When there are a large number of controlled devices, for the convenience of management and control, the cloud is usually connected to multiple sub-devices, and the multiple sub-devices are controlled through the cloud. Due to communication failures between the cloud and some sub-devices caused by factors such as poor network conditions, the status shown by the sub-devices does not match the actual real status. For example, a false offline situation occurs, and the cloud cannot accurately monitor the real status of the device. Summary of the Invention
[0003] In view of the above problems, this application proposes a method, apparatus, electronic device, and storage medium for updating the display status of a device, which can solve the above problems.
[0004] In a first aspect, an embodiment of this application provides a method for updating the display status of a device. The method includes: using a device with an offline display status among multiple devices in the current network as a target device; obtaining historical data of the target device, and determining a polling cycle node of the target device based on the historical data; when reaching the polling cycle node of this round, sending a status confirmation instruction to the target device to instruct the target device to respond to the status confirmation instruction; when receiving response information fed back by the target device based on the status confirmation instruction, updating the display status of the target device to an online status.
[0005] In a second aspect, an embodiment of this application provides a device for updating the display status of a device. The device includes: a target device determination module, configured to use a device with an offline display status among multiple devices in the current network as a target device; an obtaining module, configured to obtain historical data of the target device and determine a polling time node of the target device based on the historical data; a sending module, configured to send a status confirmation instruction to the target device when reaching the polling time node of this round to instruct the target device to respond to the status confirmation instruction; a confirmation module, configured to update the display status of the target device to an online status when receiving response information fed back by the target device based on the status confirmation instruction.
[0006] Optionally, the obtaining module includes: a data acquisition module and an inquiry time node obtaining module; the data acquisition module is configured to obtain historical heartbeat data of the target device within a preset time period; the inquiry time node obtaining module is configured to obtain historical heartbeat time nodes in the historical heartbeat data, and determine the inquiry time node of the target device based on the historical heartbeat time nodes.
[0007] Optionally, the inquiry time node obtaining module includes: a smoothing module and a first inquiry time node obtaining module. The smoothing module is configured to perform smoothing processing on the historical heartbeat time nodes in the historical heartbeat data to obtain smoothed time nodes; the first inquiry time node obtaining module is configured to determine an inquiry cycle node of the target device based on the smoothed time nodes.
[0008] Optionally, the inquiry time node obtaining module includes: a first adjustment module, a second adjustment module, and a second inquiry time node obtaining module; the first adjustment module is configured to adjust historical heartbeat time nodes within a preset threshold range in the historical heartbeat data to first heartbeat time nodes; the second adjustment module is configured to adjust historical heartbeat time nodes not within the preset threshold range in the historical heartbeat data to second heartbeat time nodes; the second inquiry time node obtaining module is configured to determine the inquiry time node of the target device based on the first heartbeat time nodes and the second heartbeat time nodes.
[0009] Optionally, the sending module includes: an inquiry duration obtaining module and a status confirmation instruction sending module; the inquiry duration obtaining module is configured to obtain an inquiry duration when the current moment meets the inquiry time node; the status confirmation instruction sending module is configured to continuously send the status confirmation instruction to the target device within the inquiry duration to instruct the target device to respond to the status confirmation instruction.
[0010] Optionally, the apparatus further includes: a determination module and a continuous sending module; the determination module is configured to determine the next round of inquiry time nodes if response information feedback from the target device is not received within a preset duration; the continuous sending module is configured to send a status confirmation instruction to the target device when the next round of inquiry time nodes is reached to instruct the target device to respond to the status confirmation instruction.
[0011] Optionally, the apparatus further includes: an update module; the update module is configured to synchronize the updated online status of the target device to the corresponding terminal to instruct the terminal to update the status of the target device to the online status and display it, so as to resume the control of the target device by the terminal.
[0012] Optionally, the target device is a ZigBee device.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above method.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program code is stored, and the program code can be called by a processor to execute the above method.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of the computer device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, the steps in the method for updating the device display state in each embodiment of the present application are implemented.
[0016] For the method, device, electronic device, and storage medium for updating the device display state provided by the present application, when there are multiple devices in the current network, a device with an offline display state is determined from the multiple devices as the target device. In order to determine whether the device state is the above-mentioned pseudo-offline, the polling time node of the target device is obtained according to historical data. At the polling time node of this round, the target device has the function of sending and receiving information. Therefore, a status confirmation instruction is sent to the target device. When a response based on the status confirmation instruction from the target device is received, it is confirmed that the target device is in an online state capable of communication, and the display state of the target device is updated to the online state to accurately detect the true state of the target device and facilitate the subsequent control of the device.
[0017] These aspects or other aspects of the present application will be more clearly understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 A flowchart showing a method for updating the device display state provided by the prior art is shown;
[0020] Figure 2Shows the schematic diagram of the ZigBee mesh network topology of the device display status update method provided by the embodiment of the present application;
[0021] Figure 3 Shows the schematic diagram of the application environment of the device display status update method provided by the embodiment of the present application;
[0022] Figure 4 Shows the schematic flowchart of the device display status update method provided by an embodiment of the present application;
[0023] Figure 5 Shows the Figure 4 Schematic flowchart of step S120 of the device display status update method shown;
[0024] Figure 6 Shows the Figure 5 Schematic flowchart of step S122 of the device display status update method shown;
[0025] Figure 7 Shows the schematic diagram of the historical heartbeat node curve;
[0026] Figure 8 Shows the schematic diagram of the time node curve after smoothing processing;
[0027] Figure 9 Shows the Figure 6 Schematic flowchart of step S122 of the device display status update method shown;
[0028] Figure 10 Shows the schematic diagram of the historical heartbeat node curve;
[0029] Figure 11 Shows the schematic diagram of the adjusted historical heartbeat node curve;
[0030] Figure 12 Shows the Figure 4 Schematic flowchart of step S130 of the device display status update method shown;
[0031] Figure 13 Shows the schematic flowchart of the device display status update method provided by another embodiment of the present application;
[0032] Figure 14 Shows the schematic flowchart of the device display status update method provided by yet another embodiment of the present application;
[0033] Figure 15 Shows the schematic flowchart of the device display status update method provided by still another embodiment of the present application;
[0034] Figure 16 The block diagram of the device display status update device provided by an embodiment of the present application is shown;
[0035] Figure 17 It is the hardware structure block diagram of an electronic device according to an embodiment of the present application. Specific embodiments
[0036] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0037] With the development of wireless network technologies (e.g., ZigBee), more and more devices are capable of networking, and these sub-devices can be remotely controlled through the network to remotely turn on or off certain functions of the sub-devices. When there are a large number of sub-devices, in order to facilitate the management and control of the above-mentioned sub-devices, the cloud is usually connected to multiple sub-devices and controls multiple sub-devices through the cloud. Due to communication failures between the cloud and some sub-devices caused by factors such as poor network conditions, the status displayed by the sub-devices does not match the actual real status. For example, in the actual application scenario, there are many interference factors in the environment (such as messy furniture, walls, metal decorations, high-power electrical appliances, long distances, etc.) that will weaken the signal, resulting in the loss of transmitted data and the appearance of false offline conditions. The cloud cannot accurately monitor the real status of the device, and this phenomenon will affect the later control of the device.
[0038] To solve the above problems, a method is provided in the prior art. Exemplarily, please refer to Figure 1 The device display status update method provided by the prior art includes the following steps:
[0039] Step S10: The gateway obtains that the display status of the target device is the offline status.
[0040] The gateway is communicatively connected to the target device, and the gateway obtains the display status of the target device through this connection relationship. Among them, the target device can be a Zigbee device.
[0041] Step S20: The gateway sends an identify message to the target device.
[0042] The gateway sends an identify message to the target device through the above connection relationship. Optionally, the gateway can automatically send an identify message to the target device when the display status of the target device is offline. Or, when the display status of the target device is offline, the user manually toggles the button on the gateway to cause the gateway to send an identify message to the target device. Or, the gateway is connected to the user terminal. When the display status of the target device is offline, the user outputs a request command through the user terminal to request the gateway to send an identify message to the target device.
[0043] Step S30: Determine whether the target device has received the identify message.
[0044] To determine whether the offline status of the target device is a true offline or a false offline caused by the above interference factors, it is necessary to determine whether the target device has received the identify message. If the target device has not received the identify message, that is, the gateway has not received the default response (i.e., the default reply) returned by the target device in response to the identify message, the process returns to step S20, and the gateway resends the identify message to the target device. If the target device has received the identify message, the process proceeds to step S40.
[0045] Step S40: The target device replies with a default response based on the identify message and controls the indicator light to flash.
[0046] If the target device replies with a default response based on the identify message, for example, the default response corresponding to the identify message of the target device is 1, 0, or any other reply. And control the indicator light to flash to prompt the user that the target device is actually in an online state. Among them, the indicator light can be the indicator light on the target device or other separate indicator lights.
[0047] Step S50: Update the display status of the target device from the offline state to the online state.
[0048] The display status of the target device is updated from the offline state to the online state to facilitate the gateway to control the target device based on this status.
[0049] The Zigbee device includes a communication unit. The working states of the communication unit of the Zigbee device include a sleep state and an active state. When the communication unit is in the sleep state, the communication unit does not send or receive data for the Zigbee device. When the communication unit is in the active state, the communication unit sends and receives data for the Zigbee device. Therefore, when the communication unit of the Zigbee device is in the sleep state, the target device does not receive the identify message from the gateway, and thus the target device does not respond to the identify message with a default response. In the prior art, the gateway blindly sends identify messages randomly. If the communication unit of the target device is in the sleep state, the gateway will not receive the default response and will mistakenly think that the target device is in an offline state. In fact, the target device is in an online state, but the communication unit of the target device is in the sleep state and cannot reply with the default response.
[0050] To address the above technical problems, the inventors have discovered and proposed a device display status update method, apparatus, electronic device, and storage medium through long-term research. When the display status of the target device is the offline state, in order to determine whether the device status is the above-mentioned false offline, the polling time node of the target device is obtained. When the target device is at the polling time node, the target device has the function of sending and receiving information. Therefore, a status confirmation instruction is sent to the target device. When the response from the target device based on the status confirmation instruction is received, it is confirmed that the target device is in an online state capable of communication, and the display status of the target device is updated to the online state to accurately and quickly detect the true status of the target device and facilitate the subsequent control of the device.
[0051] To better understand the device display status update method, apparatus, electronic device, and storage medium provided in the embodiments of the present application, the application environment applicable to the embodiments of the present application will be described first.
[0052] In some scenarios, the device display status update method is applied to a device display status update system, and the device display status update system can be a ZigBee mesh network, and the target device can be a Zigbee device. Zigbee is a low-power local area network protocol based on the IEEE802.15.4 standard. According to international standards, Zigbee technology is a short-distance, low-power wireless communication technology. The transmission characteristics such as short distance and low power consumption make this technology greatly save power resources. Therefore, Zigbee technology is widely used in smart homes.
[0053] Please refer to Figure 2, in the ZigBee mesh network topology, the cloud can be directly connected to multiple ZigBee sub-devices. For example, the cloud is directly connected to the ZigBee sub-device a1. The cloud can be indirectly connected to ZigBee sub-devices through other ZigBee sub-devices. For example, the cloud is connected to the ZigBee sub-devices a2, a3, a4, and a5 through the ZigBee sub-device a1 respectively. Optionally, since the ZigBee sub-devices a1, a2, a3, a4, and a5 carry relatively important transmission functions in the network, the ZigBee sub-devices a1 to a5 can be powerful full-function devices (Ful-Function Device, abbreviated as FFD). Optionally, Figure 2 The unlabeled ZigBee sub-devices in can be FFDs or reduced-function devices (RFDs) with simple functions, such as sensors with communication functions.
[0054] The cloud is connected to the ZigBee sub-devices to control and monitor the ZigBee sub-devices through the cloud. Optionally, the ZigBee sub-devices include a communication unit. The communication unit of the ZigBee sub-device is connected to the cloud, and data interaction with the cloud is realized through the communication unit of the ZigBee sub-device. Since data interaction between the cloud and the ZigBee sub-devices does not occur all the time, to reduce power consumption and improve the battery life of the ZigBee sub-devices, the communication unit of the ZigBee sub-devices can be periodically turned on. For example, at the polling moment, the communication unit is in the on state, the power consumption of the ZigBee sub-device increases, and the ZigBee sub-device can occupy the channel to interact with the cloud for data, or ask the parent node whether there are control instructions from the cloud; at other times, the communication unit of the ZigBee sub-device is in the sleep state, the power consumption of the ZigBee sub-device decreases, and the ZigBee sub-device cannot interact with the cloud for data.
[0055] Optionally, multiple ZigBee sub-devices are indoor smart home devices. For example, the smart home devices can be, but are not limited to, wall sockets, wall switches, wireless switches, refrigerators, air conditioners, table lamps, etc.
[0056] In the scenario where the smart home devices include wall sockets, wall switches, and wireless switches, the present application proposes another device display status update system applied to the device display status update method. Please refer to Figure 3, the system includes a cloud, a gateway, a mobile phone, and smart home devices such as the above-mentioned wall sockets, wall switches, and wireless switches. The wall sockets, wall switches, wireless switches, and the cloud are all communicatively connected to the gateway, the cloud is communicatively connected to the mobile phone, and an application program (Application, abbreviated as APP) for controlling smart home devices is installed on the mobile phone. The user communicates with the cloud through the APP on the mobile phone, and through the cloud and the gateway, remote control of the wall sockets, wall switches, and wireless switches can be achieved. Moreover, the cloud can also send the display status of smart home devices such as wall sockets, wall switches, and wireless switches to the APP on the mobile phone for display, where the display status includes an online status and an offline status.
[0057] Figure 4 shows a schematic flowchart of a method for updating the display status of a device provided by an embodiment of the present application. The method for updating the display status of a device can be applied to, for example, Figure 2 the cloud shown as Figure 9 the device display status update device 100 shown as Figure 10 and the electronic device 1200 configured with the device display status update device 100 shown as
[0058] In this embodiment, the specific process of this embodiment will be described by taking the method for updating the display status of a device applied to an electronic device as an example. For example, the electronic device can specifically be a server, a cloud, a gateway, etc. Next, the Figure 4 schematic flowchart shown as
[0059] Step S110: Use the devices with an offline status among the multiple devices in the current network as target devices.
[0060] Among them, the current network refers to the network used for communicative connection between the above-mentioned electronic device and its corresponding devices. For example, the current network can be Figure 1 the network for communicative connection between the cloud in
[0061] The multiple devices refer to the devices in the device display status update system and also refer to the devices in the current network. The number of devices in the device display status update system is not fixed. When a device exits the current network, it correspondingly exits the device display status update system. When a device joins the device display status update system, the number of multiple devices in the device display status update system correspondingly increases.
[0062] The display status refers to the network connection status of the device displayed on the cloud or the mobile phone (hereinafter referred to as the display status), and the display status on the cloud and the mobile phone is the same. It can be understood that the display status can include an online status and an offline status.
[0063] When the display status of a device in the device display status update system is the online status, it indicates that the device is still in the current network for the cloud or the mobile phone, and can still be controlled by the cloud or the mobile phone in the device display status update system. When the display status of a device in the device display status update system is the offline status, it indicates that the device has exited the current network for the cloud or the mobile phone, which means that the cloud or the mobile phone cannot control the device through the current network.
[0064] The electronic device obtains the display status of each device among multiple devices in the current network, and takes the device with the display status of offline as the target device. It can be understood that the target device refers to the device with the display status of offline in the current network. That is to say, for the cloud or the mobile phone in the device display status update system, the target device is in the offline status. Here, the offline status may be a false offline caused by network or obstacle reasons, or may be a true offline, that is, the target device exits the current network. Therefore, it is necessary to verify this offline status.
[0065] The electronic device obtains the status of multiple devices. In one implementation, each device among the multiple devices has a communication unit, and the communication unit is periodically in the on state. Each time the communication unit is in the on state, the heartbeat packet of the device is sent to the electronic device. If the electronic device does not receive the heartbeat packet within a period of time, the display status is the offline status, that is, the electronic device considers the status of the device to be the offline status.
[0066] In another implementation, the electronic device is connected to the terminal device, where the terminal device can be Figure 2 a mobile phone, a smart wearable device, a tablet computer, a laptop computer, etc. The terminal device displays the identifiers corresponding to multiple devices. For example, for an air conditioner, the pattern of the air conditioner is displayed on the terminal device as an identifier. The electronic device obtains the identifier information displayed by multiple devices on the mobile terminal. The identifier information can indicate that the display status of the device is the online status or the offline status. For example, when the identifier information is gray, it indicates that the device is in the offline status, and when the identifier information is colored, it indicates that the device is in the online status. When the displayed identifier information indicates that a device is in the offline status, this offline status may be the above-mentioned false offline, and it is necessary to determine this offline status to determine that the device with the displayed offline status is the target device.
[0067] Step S120, obtain the historical data of the target device, and determine the polling time node of the target device based on the historical data.
[0068] After the electronic device confirms the target device, the electronic device considers the display status of the target device to be the offline status. Due to factors such as network and obstacles, the target device may have a false offline. To confirm whether the offline status of the target device's display is the above-mentioned false offline or true offline, it is necessary to determine whether the current moment has reached the polling time node. It can be understood that at the polling time node, the communication unit of the target device is in the on state and data interaction can be performed. When the current moment does not meet the polling time node, it means that the communication unit of the target device is in the sleep state, and the target device cannot interact with the electronic device. If a status confirmation instruction is sent to the target device at this moment, the instruction cannot be received by the target device. That is to say, the target device will not reply to the status confirmation instruction, and it is impossible to accurately determine whether the target device is in a true offline or false offline state.
[0069] Therefore, when the display status is the offline status, to determine whether this offline status is a true offline or a false offline, it is necessary to obtain the polling time node from the historical data. Among them, the historical data is the data actively reported by the target device to the electronic device when the target device and the electronic device are communicating normally. For example, the target device reports data to the electronic device in the form of a heartbeat packet. Among them, the data in the heartbeat packet includes the time when the target device reports the heartbeat packet. After the electronic device receives the heartbeat packet, it stores the data in the heartbeat packet as historical data. Therefore, the electronic device can obtain the historical data from the storage location of the historical data and obtain the polling time node from the historical data. Among them, the polling time node refers to the moment or time period when the communication unit of the target device is in the on state and can perform data interaction, that is, the polling moment. At the polling time node, the communication unit of the target device is in the on state, and data interaction is realized through the communication unit.
[0070] In one implementation, for a target device with a variable preset polling period, its preset polling period can be adjusted according to user settings. For example, when the target device is a smart table lamp, the preset polling period can be one day, and the user can reset the preset polling period to 12 hours according to seasonal factors.
[0071] As a way, the electronic device is the cloud. The cloud is connected to the terminal device. The user makes a period setting on the terminal device. The cloud generates a beacon frame based on this setting and sends the beacon frame to the target device to set the preset polling period of the target device. The cloud saves the preset polling period set by the user. As another way, the terminal device is connected to the target device and the cloud respectively. The terminal device sends a period setting instruction to the target device to set the preset polling period of the target device. The cloud obtains the period setting instruction from the terminal device and obtains and stores the preset polling period according to this instruction.
[0072] In another implementation, for a target device with a fixed preset polling period, such as a single-fire device (e.g., a smoke sensor), the electronic device only needs to obtain the preset polling period corresponding to the target device once.
[0073] Step S130: When reaching the polling time node of this round, send a status confirmation instruction to the target device to instruct the target device to respond to the status confirmation instruction.
[0074] Among them, the status confirmation instruction is generated by the electronic device to verify whether the offline status of the target device is false offline or true offline. Optionally, the status confirmation instruction can be an instruction of the identify attribute. When at the polling time node, the communication unit of the target device is in the on state, and the target device can only receive the status confirmation instruction sent by the electronic device. To determine the timing of sending the status confirmation instruction, it is necessary to judge whether the polling time node of this round is reached. First, the current time can be obtained, and then it can be judged whether the current time is the polling time, so as to judge whether the polling time node of this round is reached.
[0075] In one implementation, the polling time node is a moment. After obtaining the polling time node, it is necessary to judge whether the current moment is the polling time node. When the current moment is different from the polling time node, it is determined that the current moment is not the polling time node, indicating that the electronic device has missed the polling time node when the communication unit of the target device is turned on. For example, the current moment is 10:22 and the polling time node is 10:20, or the electronic device has not waited for the polling time node when the communication unit of the target device is turned on. For example, the current moment is 10:22 and the polling time node is 10:30.
[0076] In another implementation, the polling time node is a time period, and the communication unit of the target device is in the on state within a continuous period of time (i.e., within the polling time node), that is, the polling duration corresponding to the polling time node. When the current moment is not within the polling duration, it is determined that the current moment does not meet the polling time node. For example, when the obtained polling moment is 9:00 and the duration for the communication unit to be turned on is 2 minutes, the polling duration is the duration between 9:00 and 9:02. When the current moment is 8:49, it is considered that the current moment is not within the polling duration, and it is determined that the current moment does not meet the polling time node, and the electronic device still needs to continue to wait for the polling moment.
[0077] As a way, to save the expenditure of the electronic device, the electronic device sends a status confirmation instruction to the target device once within the polling duration.
[0078] As another way, to make the confirmation result more accurate, within the polling duration, the electronic device can continuously send the status confirmation instruction to the target device multiple times.
[0079] Step S140: When receiving the response information fed back by the target device based on the status confirmation instruction, update the display status of the target device to the online status.
[0080] The principle for the electronic device to verify whether the offline status is true offline or false offline through the status confirmation instruction is that at the polling time node, the communication unit of the target device is in the on state, and the electronic device sends the status confirmation instruction to the target device. The target device receives the status confirmation instruction through its communication unit and then responds to the status confirmation instruction. After the electronic device receives this response from the target device, it determines that the communication connection between the electronic device and the target device is normal, and the electronic device can control the target device through this connection relationship, that is, the target device is actually in the online state. That is to say, the displayed offline status of the target device is false offline. Updating the display status of the target device from the offline status to the online status facilitates the electronic device to control the target device.
[0081] On the contrary, if the electronic device does not receive the response from the target device, it determines that the communication connection between the electronic device and the target device is abnormal, the electronic device cannot control the target device, and the target device is actually in the offline state. That is to say, the displayed offline status of the target device is true offline.
[0082] Optionally, since interference factors in the environment may cause data transmission between the electronic device and the target device to be lost, to ensure the accuracy of the above verification result, the electronic device can send the status confirmation instruction to the target device multiple times. That is, if the response information fed back by the target device is not received within the preset duration, the next polling time node is determined. When the next polling time node arrives, the status confirmation instruction is sent to the target device to instruct the target device to respond to the status confirmation instruction.
[0083] Optionally, to prevent excessive occupation of the processing resources of the electronic device and the communication resources of the current network, the number of re-verification rounds is limited, and the number of re-verification rounds can be preset. For example, it can be set to 5 times, 6 times, etc. If the response from the target device is not received in the preset number of rounds, it is determined that the offline status of the target device is true offline.
[0084] The device display status update method provided in this embodiment involves multiple devices in the current network. The devices with an offline display status are determined from the multiple devices as target devices. To determine whether the status of a device is the so-called false offline, the polling time node of the target device is obtained based on historical data. At the polling time node of this round, the target device has the function of sending and receiving information. Therefore, a status confirmation instruction is sent to the target device. When the response from the target device based on the status confirmation instruction is received, it is confirmed that the target device is in an online state capable of communication, and the display status of the target device is updated to the online state to accurately and quickly detect the true status of the target device and facilitate the subsequent control of the device. Compared with the above-mentioned prior art of blindly sending identify messages, in the embodiment of this application, the status confirmation instruction is sent only when the polling time node is reached, and the target device can quickly respond to this instruction, improving the status detection speed.
[0085] Before the display status is the offline state, the target device periodically reports heartbeat packets to the electronic device, and the electronic device stores the heartbeat data in the heartbeat packets. For example, in a scenario where the historical data includes historical heartbeat data, the heartbeat attributes can be stored in the historical data.
[0086] Please refer to Figure 5 , step S120 includes the following sub-steps:
[0087] Sub-step S121: Obtain the historical heartbeat data of the target device within a preset time period.
[0088] Before the display status of the target device is the offline state, the target device and the electronic device maintain normal communication through the current network, and the target device periodically reports heartbeat packets to the electronic device. Among them, the heartbeat packets include heartbeat data, and the electronic device stores the heartbeat data in the heartbeat packets as historical heartbeat data at a pre-set storage location.
[0089] Sub-step S122: Obtain the historical heartbeat time nodes in the historical heartbeat data, and determine the polling time node of the target device based on the historical heartbeat time nodes.
[0090] The historical heartbeat data includes historical heartbeat time nodes. Among them, the historical heartbeat time node refers to the moment or time period when the communication unit of the target device is in the on state before the display status of the target device is the offline state. It can be understood that at the historical heartbeat time node, the target device can perform data interaction. The polling time node of the target device is inferred based on the historical heartbeat nodes.
[0091] In one implementation manner, please refer to Figure 6 , sub-step S122 includes the following sub-steps:
[0092] Sub-step S122-1: Smooth the historical heartbeat time nodes in the historical heartbeat data to obtain the smoothed time nodes.
[0093] Among them, the historical heartbeat data stores the historical heartbeat time nodes actively reported by the target device. It can be understood that at the historical heartbeat time nodes, the communication unit of the target device is in the on state, and the device can perform data interaction.
[0094] The electronic device obtains the historical heartbeat data. Optionally, the electronic device can obtain the historical heartbeat data from the location where it stores the historical heartbeat data itself, or can also obtain the historical heartbeat data from other devices connected to the electronic device. The historical heartbeat data includes multiple historical heartbeat time nodes. For example, Figure 7 As shown, the x-axis represents the number of weeks. For example, when x is 1, it represents Monday, and when x is 7, it represents Sunday. It can be understood that the period for the target device to send historical heartbeat time nodes can be 1 day. The y-axis represents the clock display time. For example, when the y-axis is 10, it represents 10:00. As Figure 7 shown, the points on the x-y coordinate system represent the historical heartbeat time nodes of the target device. For example, multiple historical polling moments of the target device for a continuous week are collected, which are 10:35, 10:35, 10:35, 10:35, 10:34, 10:37, 10:35 respectively.
[0095] It should be noted that the historical heartbeat data not only includes the historical heartbeat time nodes of the target device, but also includes the historical heartbeat time nodes of the remaining devices other than the target device among multiple devices. And the polling period is not limited to the above 1 day, and can also be 6 hours, one day, one week, etc. according to the actual statistical results.
[0096] Since the historical heartbeat time nodes of different rounds of the target device are different, therefore, the curves formed by different historical heartbeat time nodes have fluctuations. When estimating the polling time node based on the historical heartbeat time node, in order to improve the accuracy of the estimation, it is necessary to smooth the curve formed by the historical heartbeat time nodes. Exemplarily, after Figure 7 smoothing the curve of the historical heartbeat time nodes, the curve shown in Figure 8 is obtained.
[0097] The method of smoothing the curve formed by the historical heartbeat time nodes can calculate the average value of multiple historical heartbeat time nodes and use the average value as the polling time node. Calculate the average value of multiple historical heartbeat time nodes.
[0098] Specifically, first calculate the total number of minutes represented by multiple historical heartbeat time nodes, that is, the sum of the minutes corresponding to the hours of multiple historical heartbeat time nodes and the minutes of multiple historical heartbeat time nodes, which is the total number of minutes. Continuing to combineFigure 7 In the example in , the total number of minutes is 10 * 60 * 7 + 35 * 5 + 34 + 37 = 4446. Then calculate the average hours. Calculate the average hours based on the total number of minutes and the number of days. If the calculated average hours are a decimal, round down. Specifically, the total number of minutes / the number of days / 60 gives the average hours. For example, 4446 / 7 / 60 = 10, and the obtained average hours are 10. Then calculate the average minutes. Specifically, the total number of minutes is divided by the number of days, and then the remainder is taken with respect to 60. For example, (4446 / 7) % 60 = 35. Finally, connect the average hours and the average minutes to obtain the average polling time of 10:35. The average value can be used as the polling time node for each day in the next week.
[0099] Sub-step S122-2: Determine the polling cycle node of the target device based on the smoothed time node.
[0100] The electronic device determines the polling cycle node of the target device based on the smoothed time node. Exemplarily, the electronic device obtains that the current day is Monday. According to Figure 8 the curve shown, obtain the reading on the y-axis corresponding to the point where the x-axis is 1 as the polling cycle node.
[0101] In another implementation manner, please refer to Figure 9 , sub-step S122 includes the following sub-steps:
[0102] Sub-step S122-3: Adjust the historical heartbeat time nodes within the preset threshold range in the historical heartbeat data to the first heartbeat time nodes.
[0103] Optionally, obtain multiple historical heartbeat time nodes. Any two different time nodes among the multiple historical heartbeat time nodes can be taken as the first heartbeat time node and the second heartbeat time node. For example, please refer to Figure 10 , in Figure 10 where the abscissa is the date and the ordinate is the historical heartbeat time node. According to Figure 10 the obtained multiple historical heartbeat time nodes are 10:15, 10:17, 10:19, 10:13, 10:15, 10:15, 10:07, 10:23, 10:15, and 10:11 respectively. Arbitrarily select any two different time nodes among the multiple historical heartbeat time nodes as the first time node and the second time node. For example, select 10:18 as the first time node and 10:05 as the second time node. Or among the multiple historical heartbeat time nodes, take the two historical heartbeat time nodes with the higher occurrence frequency as the two time nodes. For example, the first heartbeat time node can be 10:15 and the second heartbeat time node can be 10:17.
[0104] Optionally, a preset threshold range is set in advance. For example, the preset threshold range can be set to 6 minutes.
[0105] Add the preset threshold range to each of the multiple historical heartbeat time nodes to obtain the added historical heartbeat time nodes, and process each historical heartbeat time node into a time node closer to the added historical heartbeat time node. For example, add or subtract a certain historical heartbeat time node from the preset threshold range to obtain a calculation result. When the calculation result is closer to the first heartbeat time node than the second heartbeat time node, adjust the historical heartbeat time node to the first heartbeat time node.
[0106] Exemplarily, when 10:18 and 10:07 are selected as the first heartbeat time node and the second heartbeat time node respectively, for the historical heartbeat time node 10:12, adding 6 minutes to the historical heartbeat time node 10:12 gives a calculation result of 10:18. Compared with the second heartbeat time node 10:07, the calculation result 10:18 is closer to the first heartbeat time node 10:18, so the historical heartbeat time node 10:12 is processed as 10:18, that is, the historical heartbeat time node is adjusted to the first heartbeat time node.
[0107] Sub-step S122-4: Adjust the historical heartbeat time nodes that are not within the preset threshold range in the historical heartbeat data to the second heartbeat time node.
[0108] Add the preset threshold range to each of the multiple historical heartbeat time nodes to obtain the added historical heartbeat time nodes, and process each historical heartbeat time node into a time node closer to the added historical heartbeat time node. For example, add or subtract a certain historical heartbeat time node from the preset threshold range to obtain a calculation result. When the calculation result is closer to the second heartbeat time node than the first heartbeat time node, adjust the historical heartbeat time node to the second heartbeat time node.
[0109] Exemplarily, continuing with the above example, for the historical heartbeat time node 10:05, adding 2 minutes to the historical heartbeat time node 10:05 gives a calculation result of 10:07. Compared with the first heartbeat time node 10:18, the calculation result 10:07 is closer to the second heartbeat time node 10:07, and the historical heartbeat time node 10:05 is processed as the second heartbeat time node.
[0110] According to sub-step S122-3 and sub-step S122-4, adjust the Figure 10 historical heartbeat time node curve in Figure 11 to the curve shown in
[0111] Sub-step S122-5: Determine the polling time node of the target device based on the first heartbeat time node and the second heartbeat time node.
[0112] Obtain a curve graph as shown based on the first heartbeat time node and the second heartbeat time node, and determine the polling time node of the target device from the curve graph. For example, if the current date is the 1st, then obtain the ordinate 10:18 corresponding to the point with the abscissa of 1 from Figure 11 as the polling time node of the target device. Figure 11 In the context of the
[0113] embodiment, this embodiment provides a method for updating the display status of a device. Please refer to Figure 4 for details. The method includes the following steps: Figure 13 Step S210: Regard the devices with the display status of offline among multiple devices in the current network as target devices.
[0114] Step S220: Obtain the historical data of the target device, and determine the polling time node of the target device based on the historical data.
[0115] Step S230: When the polling time node of this round is reached, send a status confirmation instruction to the target device to instruct the target device to respond to the status confirmation instruction.
[0116] Step S240: When receiving the response information fed back by the target device based on the status confirmation instruction, update the display status of the target device to the online status.
[0117] For the specific descriptions of steps S210 - S240, please refer to steps S110 - S140, which will not be elaborated here.
[0118] Step S250: Synchronize the updated online status of the target device to the corresponding terminal to instruct the terminal to update the status of the target device to the online status and display it, so as to resume the control of the target device by the terminal.
[0119]
[0120] The display status of the target device shown on the electronic device and the terminal is synchronized. Therefore, after the display status of the target device is updated to the online status on the electronic device, to maintain the synchronization of the display status between the electronic device and the terminal, the electronic device synchronizes the updated online status of the target device to the corresponding terminal, and the control terminal updates the display status of the target device from the original offline status to the online status and displays the updated online status. For example, the identification information representing the status of the target device can be updated from gray to color. After the display status of the target device is shown as the online status on the terminal, the terminal considers that the target device can be controlled, so the control of the target device is restored on the terminal.
[0121] In the device display status update method provided in this embodiment, after the electronic device updates the display status of the target device from the offline status to the online status, the electronic device synchronizes the online status to the terminal, that is, synchronizes the updated online status of the target device to the corresponding terminal to instruct the terminal to update the display status, facilitating the user to control the target device through the terminal.
[0122] For the scenario where the electronic device is the cloud and the target device is a wireless switch, this application proposes a device display status update method. Figure 14 The flowchart showing the device display status update method provided in another embodiment of this application is shown. Please refer to Figure 14 The device display status update method includes:
[0123] Step S310: The display status of the wireless switch is the offline status.
[0124] The cloud is communicatively connected to the wireless switch, and the cloud obtains that the display status of the wireless switch is the offline status. It can be understood that when the wireless switch is in the offline status, the cloud considers that the wireless switch is disconnected from the network and the cloud cannot control the wireless switch.
[0125] Step S320: Set to automatically send an identify message.
[0126] Optionally, the above status confirmation instruction can be an identify message. Setting to automatically send an identify message means that the cloud estimates the polling time node based on the historical polling time node. When the current moment reaches the estimated polling time node, the cloud automatically sends an identify message to seek a response from the wireless switch.
[0127] Step S330: The cloud determines whether the estimated polling time node has been reached.
[0128] If it is determined that the estimated polling time node has been reached, the process returns to step S320. If it is determined that the estimated polling time node has not been reached, the process proceeds to step S340.
[0129] Step S340: The cloud sends an identify message to the wireless switch.
[0130] Based on the automatic setting in step S320, the cloud automatically sends an identify message to the wireless switch.
[0131] Step S350: Determine whether the wireless switch has resumed online.
[0132] If the cloud determines that the wireless switch is not online, that is, the wireless switch does not respond to the identify message. To further determine the display status of the wireless gateway, the process proceeds to step S360. If the cloud determines that the wireless switch is online, that is, the wireless switch responds to the identify message, the process proceeds to step S370.
[0133] Step S360: Determine whether the number of times the identify message is triggered is less than the preset number of times.
[0134] If the cloud determines that the number of times the identify message is triggered is less than the preset number of times, it means that the cloud can continue to trigger the identify message, and the process returns to step S340. If the cloud determines that the number of times the identify message is triggered is not less than the preset number of times, it means that the number of times the cloud triggers the identify message is greater than or equal to the preset number of times. When the number of times the cloud triggers the identify message is sufficient but still no response from the wireless switch is received, the process returns to step S310.
[0135] Step S370: Update the display status of the wireless switch from the offline state to the online state.
[0136] The cloud updates the display status of the wireless switch from the offline state to the online state. The cloud can also control the indicator light indicating the online state to light up, facilitating the user to understand the working state of the wireless switch.
[0137] For the device display status update method provided in this embodiment, the cloud determines that the display status of the wireless switch is the offline state. To determine whether the offline state of the wireless switch is a false offline, the cloud estimates the polling time node of the wireless switch according to historical data. At the polling time node, the wireless switch has the function of sending and receiving information. Therefore, at the polling time node, the cloud automatically triggers an identify message and sends the identify message to the wireless switch. When receiving the response of the wireless switch based on the identify message, it is confirmed that the wireless switch is in the online state capable of communication, and the display status of the wireless switch is updated to the online state to accurately and quickly detect the true state of the wireless switch and also facilitate the subsequent control of the wireless switch.
[0138] For the scenario where the electronic device is the cloud and the target device is a wall socket, this application proposes a method for updating the display status of the device. Figure 15 The flowchart of the device display status update method provided by another embodiment of this application is shown. Please refer to Figure 15 , the device display status update method includes:
[0139] Step S410: The display status of the wall socket is the offline status.
[0140] The cloud is communicatively connected to the wall socket, and the cloud obtains that the display status of the wall socket is the offline status. It can be understood that when the wall socket is in the offline status, the cloud considers that the wall socket is disconnected from the network, and the cloud cannot control the wall socket.
[0141] Step S420: Set to send an identify message manually or automatically.
[0142] Optionally, the above status confirmation instruction can be an identify message.
[0143] It is possible to set to automatically send an identify message. It can be understood that the cloud estimates the polling time node based on the historical polling time node. When the current time reaches the estimated polling time node, the cloud automatically sends an identify message to seek a response from the wall socket.
[0144] It is also possible to set to manually send an identify message. The cloud estimates the polling time node based on the historical polling time node. When the current time reaches the estimated polling time node, a prompt message is sent to prompt the user that the polling time node has been reached. After receiving the prompt message, the user manually sends an identify message, where the prompt message.
[0145] Step S430: The cloud determines whether the estimated polling time node has been reached.
[0146] If the cloud determines that the estimated polling time node has not been reached, the process proceeds to step S440. If the cloud determines that the estimated polling time node has been reached, the process proceeds to step S450.
[0147] Step S440: Manually trigger an identify message.
[0148] Receive the identify message instruction manually triggered by the user and manually trigger an identify message. Optionally, it is also possible to automatically trigger an identify message when the estimated polling time node is reached.
[0149] Step S450: The cloud sends an identify message to the wall socket.
[0150] The cloud sends an identify message to the wall socket.
[0151] Step S460: Determine whether the wall socket has resumed online status.
[0152] If the wall socket has resumed online status, the process proceeds to step S480. If the wall socket has not resumed online status, the process proceeds to step S470.
[0153] Step S470: Determine whether the number of times the identify message is triggered is less than the preset number of times.
[0154] If the number of times the identify message is triggered is less than the preset number of times, it means the cloud can continue to trigger the identify message, and the process returns to step S410. If the number of times the identify message is triggered is not less than the preset number of times, it means the number of times the cloud triggers the identify message is greater than or equal to the preset number of times. When the cloud has triggered the identify message a sufficient number of times but still has not received a response from the wall socket, the process returns to step S450.
[0155] Step S480: Update the display status of the wall socket from the offline status to the online status.
[0156] The cloud updates the display status of the wall socket from the offline status to the online status. The cloud can also control the indicator light indicating the online status to light up, facilitating the user to understand the working status of the wireless switch.
[0157] In the device display status update method provided in this embodiment, if the cloud determines that the display status of the wall socket is the offline status, in order to determine whether the offline status of the wall socket is a false offline, the cloud estimates the polling time node of the wall socket according to historical data. At the polling time node, the wall socket has the function of receiving and sending information. Therefore, at the polling time node, the cloud automatically triggers an identify message and sends the identify message to the wall socket. When receiving the response of the wall socket based on the identify message, it is confirmed that the wall socket is in an online state capable of communication, and the display status of the wall socket is updated to the online status, so as to accurately and quickly detect the true status of the wall socket and also facilitate the subsequent control of the wall socket.
[0158] It should be understood that although Figures 4 - 6 each step in the flowcharts of 9, 12, 13 is shown in sequence according to the arrow indication, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figures 4 - 6At least a part of the steps in 9, 12, and 13 may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily need to be executed and completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0159] To implement the above method embodiments, this embodiment provides a device display status update device. Figure 16 The block diagram of the device display status update device provided by an embodiment of the present application is shown. Please refer to Figure 16 The device display status update device 100 includes: a target device determination module 110, an acquisition module 120, a sending module 130, and a confirmation module 140.
[0160] The target device determination module 110 is configured to use the devices with an offline display status among multiple devices in the current network as target devices.
[0161] The acquisition module 120 is configured to acquire historical data of the target device and determine the polling time node of the target device based on the historical data.
[0162] The sending module 130 is configured to send a status confirmation instruction to the target device when the polling time node of this round is reached, so as to instruct the target device to respond to the status confirmation instruction.
[0163] The confirmation module 140 is configured to update the display status of the target device to the online status when receiving the response information fed back by the target device based on the status confirmation instruction.
[0164] Optionally, the acquisition module 120 includes: a data acquisition module and a polling time node acquisition module.
[0165] The data acquisition module is configured to acquire historical heartbeat data of the target device within a preset time period.
[0166] The polling time node acquisition module is configured to acquire the historical heartbeat time nodes in the historical heartbeat data and determine the polling time node of the target device based on the historical heartbeat time nodes.
[0167] Optionally, the polling time node acquisition module includes: a smoothing module and a first polling time node acquisition module.
[0168] The smoothing module is configured to perform smoothing processing on the historical heartbeat time nodes in the historical heartbeat data to obtain the smoothed time nodes.
[0169] The first inquiry time node acquisition module is used to determine the inquiry cycle node of the target device based on the smoothed time node.
[0170] Optionally, the inquiry time node acquisition module includes: a first adjustment module, a second adjustment module, and a second inquiry time node acquisition module.
[0171] The first adjustment module is used to adjust the historical heartbeat time nodes within the preset threshold range in the historical heartbeat data to the first heartbeat time nodes;
[0172] The second adjustment module is used to adjust the historical heartbeat time nodes not within the preset threshold range in the historical heartbeat data to the second heartbeat time nodes;
[0173] The second inquiry time node acquisition module is used to determine the inquiry time node of the target device based on the first heartbeat time node and the second heartbeat time node.
[0174] Optionally, the sending module 130 includes: an inquiry duration acquisition module and a status confirmation instruction sending module.
[0175] The inquiry duration acquisition module is used to acquire the inquiry duration when the current moment meets the inquiry time node;
[0176] The status confirmation instruction sending module is used to continuously send the status confirmation instruction to the target device within the inquiry duration to instruct the target device to respond to the status confirmation instruction.
[0177] Optionally, the device further includes: a determination module and a continuous sending module.
[0178] The determination module is used to determine the next inquiry time node if the response information feedback from the target device is not received within the preset duration;
[0179] The continuous sending module is used to send a status confirmation instruction to the target device when the next inquiry time node is reached to instruct the target device to respond to the status confirmation instruction.
[0180] Optionally, the device further includes: an update module.
[0181] The update module is used to synchronize the updated online status of the target device to the corresponding terminal to instruct the terminal to update the status of the target device to the online status and display it to resume the control of the target device by the terminal.
[0182] Optionally, the target device is a ZigBee device.
[0183] Those skilled in the art can clearly understand that the action detection device provided in the embodiments of the present application can implement Figures 4 to 15 each process implemented by the electronic device in the method embodiments. For the convenience and conciseness of description, for the specific working processes of the above-described devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
[0184] In several embodiments provided in the present application, the coupling, direct coupling, or communication connection between the modules shown or discussed with each other may be through some interfaces. The indirect coupling or communication connection of the devices or modules may be in electrical, mechanical, or other forms. Additionally, in each embodiment of the present application, the various functional modules may be integrated in one processing module, or each module may exist physically alone, or two or more modules may be integrated in one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0185] The embodiments of the present invention provide an electronic device, which includes a processor and a memory. The memory stores at least one instruction, at least one program segment, a code set, or an instruction set. The at least one instruction, the at least one program segment, the code set, or the instruction set is loaded and executed by the processor to implement the fingerprint foreign object detection method as provided in the foregoing method embodiments.
[0186] The memory can be used to store software programs and modules. The processor runs the software programs and modules stored in the memory to execute various functional applications and data processing. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0187] Figure 17 is a hardware structure block diagram of an electronic device according to an embodiment of the present application. As Figure 17As shown, the electronic device 1200 can vary significantly due to different configurations or performances. It may include one or more processing units (PUs) 1210 (the processor 1210 may include, but is not limited to, processing devices such as a microcontroller unit (MCU) or a field-programmable gate array (FPGA)), a memory 1230 for storing data, and one or more storage media 1220 for storing application programs 1223 or data 1222 (such as one or more mass storage devices). Among them, the memory 1230 and the storage media 1220 can be transient storage or persistent storage. The programs stored in the storage media 1220 may include one or more modules, and each module may include a series of instruction operations on the server. Further, the processor 1210 can be set to communicate with the storage media 1220 and execute a series of instruction operations in the storage media 1220 on the electronic device 1200. The electronic device 1200 may also include one or more power supplies 1260, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1240, and / or one or more operating systems 1221, such as Windows ServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM, and so on.
[0188] The input / output interface 1240 can be used to receive or send data via a network. Specific examples of the above network may include the wireless network provided by the communication provider of the electronic device 1200. In one example, the input / output interface 1240 includes a network interface controller (NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one example, the input / output interface 1240 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0189] Those of ordinary skill in the art can understand that Figure 17 the structure shown is only schematic and does not limit the structure of the above electronic device. For example, the electronic device 1200 may also include more or fewer components than Figure 17 shown, or have a different configuration from Figure 17 shown.
[0190] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement each process of the above-mentioned method embodiment for updating the display state of the device, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0191] The embodiments of the present invention provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above-mentioned method embodiments.
[0192] In summary, for the method, device, electronic device, and storage medium for updating the display state provided by the present application, when there are multiple devices in the current network, the device with the display state of the offline state is determined from the multiple devices as the target device. To determine whether the device state is the above-mentioned false offline, the polling time node of the target device is obtained according to historical data. At the polling time node of this round, the target device has the function of sending and receiving information. Therefore, a status confirmation instruction is sent to the target device. When receiving the response of the target device based on the status confirmation instruction, it is confirmed that the target device is in an online state capable of communication, and the display state of the target device is updated to the online state to accurately detect the true state of the target device and facilitate the subsequent control of the device.
[0193] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0194] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be an intelligent gateway, mobile phone, computer, server, air conditioner or network device, etc.) to execute the methods described in various embodiments of the present application.
[0195] The above has described the embodiments of the present application in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A method for updating the display state of a device, characterized in that, The method includes: Regarding the devices with an offline display status among multiple devices of the current network as target devices; Obtaining historical data of the target devices, and determining the polling time nodes of the target devices based on the historical heartbeat time nodes in the historical data; the polling time nodes refer to the moments or time periods when the target devices can perform data interaction; the historical heartbeat time nodes refer to the moments or time periods when the target devices can perform data interaction before the display status of the target devices becomes offline; When the polling time nodes of this round are reached, sending a status confirmation instruction to the target devices to instruct the target devices to respond to the status confirmation instruction; When receiving the response information fed back by the target devices based on the status confirmation instruction, updating the display status of the target devices to the online status.
2. The method according to claim 1, wherein The historical data includes historical heartbeat data. The obtaining of the historical data of the target devices and the determining of the polling time nodes of the target devices based on the historical data includes: Obtaining the historical heartbeat data of the target devices within a preset time period; Obtaining the historical heartbeat time nodes in the historical heartbeat data, and determining the polling time nodes of the target devices based on the historical heartbeat time nodes.
3. The method according to claim 2, characterized in that, The obtaining of the historical heartbeat time nodes in the historical heartbeat data and the determining of the polling time nodes of the target devices based on the historical heartbeat time nodes includes: Performing smoothing processing on the historical heartbeat time nodes in the historical heartbeat data to obtain the smoothed time nodes; Determining the polling cycle nodes of the target devices based on the smoothed time nodes.
4. The method according to claim 2, characterized in that, The obtaining of the historical heartbeat time nodes in the historical heartbeat data and the determining of the polling time nodes of the target devices based on the historical heartbeat time nodes includes: Adjusting the historical heartbeat time nodes within a preset threshold range in the historical heartbeat data to the first heartbeat time nodes; Adjusting the historical heartbeat time nodes not within the preset threshold range in the historical heartbeat data to the second heartbeat time nodes; Determining the polling time nodes of the target devices based on the first heartbeat time nodes and the second heartbeat time nodes.
5. The method according to claim 1, characterized in that The step of when the polling time nodes of this round are reached, sending a status confirmation instruction to the target devices to instruct the target devices to respond to the status confirmation instruction includes: When the current moment meets the polling time nodes, obtaining the polling duration; Within the polling duration, continuously sending the status confirmation instruction to the target devices to instruct the target devices to respond to the status confirmation instruction.
6. The method according to claim 1, characterized in that, The method further includes: If the response information fed back by the target devices is not received within a preset duration, determining the polling time nodes of the next round; When the polling time nodes of the next round are reached, sending a status confirmation instruction to the target devices to instruct the target devices to respond to the status confirmation instruction.
7. The method according to any one of claims 1-6, characterized in that After receiving the response information fed back by the target device based on the status confirmation instruction and updating the display status of the target device to the online status, it further includes: Synchronize the updated online status of the target device to the corresponding terminal, so as to instruct the terminal to update the status of the target device to the online status and display it, so as to resume the control of the target device by the terminal.
8. The method according to claim 7, wherein The target device is a ZigBee device.
9. An apparatus for updating a display state of a device, characterized in that, The device includes: A target device determination module, configured to use a device with an offline display status among multiple devices in the current network as the target device; An acquisition module, configured to acquire historical data of the target device, and determine a polling time node of the target device based on a historical heartbeat time node in the historical data; the polling time node refers to a moment or time period when the target device can perform data interaction; the historical heartbeat time node refers to a moment or time period when the target device can perform data interaction before the display status of the target device is offline; A sending module, configured to send a status confirmation instruction to the target device when reaching the polling time node of this round, so as to instruct the target device to respond to the status confirmation instruction; A confirmation module, configured to update the display status of the target device to the online status when receiving the response information fed back by the target device based on the status confirmation instruction.
10. An electronic device, characterized in that, It includes: One or more processors; A memory; One or more applications, where the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, Program code is stored in the computer-readable storage medium, and the program code can be called by the processor to execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
ZigBee equipment state scanning method and device and readable storage medium
CN110519360A
Offline equipment determination method and device
CN111884875A