Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the development of wireless network technology (e.g., zigBee bees), more and more devices are provided with networking capability, and these sub-devices can be remotely controlled through a network to remotely turn on or off certain functions of the sub-devices. When the number of the sub-devices is large, in order to facilitate management and control of the sub-devices, the cloud end is generally connected with a plurality of sub-devices, and the plurality of sub-devices are controlled through the cloud end. The communication fault between the cloud end and part of the sub-devices caused by factors such as poor network conditions causes the situation that the state displayed by the sub-devices is inconsistent with the actual real state, for example, in the actual application scene, the signals can be weakened by more interference factors (such as disordered home, walls, metal decoration, high-power electrical appliances, long distances and the like) in the environment, the transmitted data are lost, the condition of false offline occurs, the real state of the devices cannot be accurately monitored by the cloud end, and the phenomenon can influence the control of the devices in the later period.
To solve the above-mentioned problems, a method is provided in the prior art, and referring to fig. 1, for example, the method for updating the display status of the device provided in the prior art includes the following steps:
step S10, the gateway obtains that the display state of the target device is an offline state.
The gateway is in communication connection with the target equipment, and the gateway obtains the display state of the target equipment through the connection relation. The target device may be a Zigbee device.
And step S20, the gateway sends an identification message to the target equipment.
And the gateway sends the identification message to the target equipment through the connection relation. Optionally, the gateway may automatically send an identification message to the target device when the display state of the target device is an offline state. Or when the display state of the target equipment is an offline state, the user manually dials a button on the gateway to enable the gateway to send the identification message to the target equipment. And the gateway is connected with the user terminal, and when the display state of the target equipment is in an offline state, the user outputs a request instruction through the user terminal so as to request the gateway to send an identification message to the target equipment.
And step S30, judging whether the target equipment receives the identification message.
In order to determine whether the offline state of the target device is a true offline state or a false offline state caused by the above-mentioned interference factors, it needs to determine whether the target device receives the identification message, if the target device does not receive the identification message, i.e. the gateway does not receive the default response (i.e. default reply) of the target device in response to the identification message, the flow returns to step S20, the gateway resends the identification message to the target device, and if the target device receives the identification message, the flow proceeds to step S40.
And S40, the target equipment replies default response based on the identification message, and controls the indicator lamp to flash.
If the target device replies with an default response based on the identification message, for example, the target device replies with 1, 0 or any other default response based on the corresponding default response of the identification message. And controls the indicator light to flash to indicate to the user that the target device is actually online. The indicator light may be an indicator light on the target device, or may be another separate indicator light.
Step S50, the display state of the target device is updated from the offline state to the online state.
The display state of the target device is updated from an offline state to an online state so that the gateway can control the target device according to the state.
The Zigbee device comprises a communication unit, the working state of the communication unit of the Zigbee device comprises a dormant state and an open state, when the communication unit is in the dormant state, the communication unit can not send and receive data for the Zigbee device, and when the communication unit is in the open state, the communication unit sends and receives data for the Zigbee device. Therefore, when the communication unit of the Zigbee device is in the dormant state, the target device does not receive the identity message of the gateway, and therefore the target device does not respond to the identity message to reply to the default response. In the prior art, if the communication unit of the target device is in a dormant state, the gateway will not receive the default response, and the target device will be mistakenly considered to be 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 dormant state and cannot reply to the default response.
In order to solve the above technical problems, the inventor has found and proposed a method, a device, an electronic device and a storage medium for updating a display state of a device, where when a display state corresponding to a target device is an offline state, in order to determine whether the display state of the device is the above pseudo offline state, an interrogation time node of the target device is obtained, and when the target device is at the interrogation time node, the target device has a function of receiving and transmitting information. Therefore, the state confirmation instruction is sent to the target equipment, when the response of the target equipment based on the state confirmation instruction is received, the target equipment is confirmed to be in an online state capable of carrying out communication, and the display state of the target equipment is updated to be in the online state, so that the real state of the target equipment is accurately and rapidly detected, and the control of the equipment in the later period is facilitated.
In order to better understand the method, the device, the electronic device and the storage medium for updating the display state of the device provided by the embodiment of the application, an application environment suitable for the embodiment of the application is described below.
In some scenarios, the device display status updating method is applied to a device display status updating system, and the device display status updating system may be a ZigBee mesh network, and the target device may be a ZigBee device. The Zigbee is a low-power consumption local area network protocol based on the IEEE802.15.4 standard, and according to international standard provision, the Zigbee technology is a wireless communication technology with short distance and low power consumption, and the transmission characteristics of short distance, low power consumption and the like enable the technology to greatly save electric quantity resources, so that the Zigbee technology is widely used in intelligent households.
Referring to fig. 2, in the ZigBee mesh network topology, the cloud may be directly connected to a plurality of ZigBee sub-devices, for example, the cloud is directly connected to ZigBee sub-device a 1. The cloud may be indirectly connected to the ZigBee kids through other ZigBee kids, for example, the cloud is connected to the ZigBee kids a2, a ZigBee kids a3, a ZigBee kids a4, and a ZigBee kids a5 through the ZigBee kids a1, respectively. Alternatively, since the ZigBee sub-Device a1, the ZigBee sub-Device a2, the ZigBee sub-Device a3, the ZigBee sub-Device a4, and the ZigBee sub-Device a5 carry important transmission functions in the network, the ZigBee sub-devices a1 to a5 may be powerful full Function devices (Ful-Function devices, FFD for short). Alternatively, the untagged ZigBee Device in fig. 2 may be an FFD, or may be a Reduced-Function Device (RFD) with a simple Function, for example, a sensor with a communication Function.
The cloud end is connected with the ZigBee equipment, and the ZigBee equipment is controlled, monitored and the like through the cloud end. Optionally, the ZigBee sub-device includes a communication unit, where the communication unit of the ZigBee sub-device is connected to the cloud, and data interaction with the cloud is achieved through the communication unit of the ZigBee sub-device. Because the cloud end and the ZigBee equipment do not always perform data interaction, in order to reduce power consumption and improve the cruising ability of the ZigBee equipment, the communication unit of the ZigBee equipment can be periodically started. For example, when the polling (polling) is performed, the communication unit is in an on state, the power consumption of the ZigBee device is increased, the ZigBee device can occupy a channel to perform data interaction with the cloud or inquire a parent node whether a control instruction of the cloud exists, and when the rest is performed, the communication unit of the ZigBee device is in a dormant state, the power consumption of the ZigBee device is reduced, and the ZigBee device can not perform data interaction with the cloud.
Alternatively, the plurality of ZigBee sub-devices are indoor smart home devices, for example, the smart home devices may be, but are not limited to, wall sockets, wall switches, wireless switches, refrigerators, air conditioners, desk lamps, and the like.
In a scenario that the smart home device includes a wall socket, a wall switch, and a wireless switch, the present application provides another device display status update system applied to a device display status update method, referring to fig. 3, the system includes a cloud, a gateway, a mobile phone, and the smart home devices such as the wall socket, the wall switch, and the wireless switch. Wall socket, wall switch, wireless switch and high in the clouds all with gateway communication connection, high in the clouds and cell-phone communication connection, install the Application (APP) of control intelligent house equipment on the cell-phone, the user is APP and high in the clouds communication through being on the cell-phone, can realize the remote control to wall socket, wall switch and wireless switch through high in the clouds and gateway. And the cloud end can also send the display state of intelligent household equipment such as a wall socket, a wall switch and a wireless switch to the APP of the mobile phone for display, wherein the display state comprises an online state and an offline state.
Fig. 4 is a flowchart illustrating a device display status updating method according to an embodiment of the present application, where the device display status updating method may be applied to the cloud end shown in fig. 2, the device display status updating apparatus 100 shown in fig. 9, and the electronic device 1200 configured with the device display status updating apparatus 100 shown in fig. 10.
The embodiment will take application of the device display status updating method to the electronic device as an example to describe a specific flow of the embodiment, for example, the electronic device may be a server, a cloud, a gateway, etc. The method for updating the display state of the device specifically may include the following steps, which will be described in detail with reference to the flowchart shown in fig. 4:
step S110, a device with an offline state is used as a target device in a plurality of devices of the current network.
The current network is a network for communication connection between the electronic device and each corresponding device. For example, the current network may be a network of communication connections between the cloud and the plurality of ZigBee sub-devices in fig. 1.
The plurality of devices refer to devices in the device display state updating system, and also refer to devices in the current network, the number of the devices in the device display state updating system is not fixed, and when one of the plurality of devices exits the current network, the corresponding device exits from the device display state updating system. When a device is added to the device display status updating system, the number of the plurality of devices in the device display status updating system correspondingly increases.
The display state refers to a network connection state (hereinafter referred to as a display state) of a device displayed on the cloud or the mobile phone, wherein the display states on the cloud and the mobile phone are consistent. It is understood that the display state may include an on-line state and an off-line state.
When the display state of the device in the device display state updating system is an on-line state, 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 state updating system. When the display state of the device in the device display state updating system is in an offline state, the fact that the device exits the current network for the cloud or the mobile phone is indicated, which means that the cloud or the mobile phone cannot control the device through the current network.
The electronic device obtains a display state of each device in the plurality of devices in the current network, and takes the device with the display state being an offline state as a target device, and it can be understood that the target device refers to the device with the display state being the offline state in the current network, that is, for a cloud or a mobile phone in a device display state updating system, the target device is in the offline state, and the offline state may be a false offline caused by a network or an obstacle, or may be a true offline, that is, the target device exits the current network, so that verification on the offline state is required.
The electronic device obtains states of a plurality of devices. In one embodiment, each of the plurality of devices has a communication unit thereon, the communication unit is periodically in an on state, and when the communication unit is in each on state, a heartbeat packet of the device is sent to the electronic device, and if the electronic device does not receive the heartbeat packet within a period of time, the display state is in an off-line state, that is, the electronic device considers that the device is in an off-line state.
In another embodiment, the electronic device is connected to a terminal device, where the terminal device may be a mobile phone, an intelligent wearable device, a tablet computer, a notebook computer, or the like in fig. 2. For example, for an air conditioner, a pattern of the air conditioner is displayed on the terminal device as an identifier, and the electronic device obtains the identifier information displayed by the plurality of devices on the mobile terminal, where the identifier information may indicate that the display state of the device is an on-line state or an off-line state, for example, when the identifier information is gray, the device is indicated to be in an off-line state, and when the identifier information is colored, the device is indicated to be in an on-line state. When the display identification information indicates that the device is in the offline state, the offline state may be the above-mentioned false offline state, and the offline state needs to be determined to determine that the device displaying the offline state is the target device.
Step S120, historical data of the target device is obtained, and the interrogation time node of the target device is determined based on the historical data.
After the electronic device confirms the target device, the electronic device considers that the display state of the target device is an offline state, and the target device is false offline due to factors such as a network and an obstacle, and in order to confirm whether the display offline state of the target device is the false offline or the true offline, it is necessary to judge whether the current moment reaches the interrogation time node, and it is understood that when the interrogation time node is reached, the communication unit of the target device is in an on state, and data interaction can be performed. When the current moment does not meet the inquiry time node, the communication unit of the target device is in a dormant state, the target device cannot interact with the electronic device, and if a state confirmation instruction is sent to the target device at the moment, the instruction cannot be received by the target device. That is, the target device does not reply to the status confirmation command, and thus it cannot accurately determine whether the target device is in the true offline or the false offline.
Therefore, when the display state is an offline state, it is necessary to acquire the interrogation time node from the history data in order to determine whether the offline state is a true offline state or a false offline state. The historical data are data which are actively reported to the electronic equipment by the target equipment when the target equipment and the electronic equipment normally communicate. For example, the target device reports data to the electronic device in the form of a heartbeat packet. The data in the heartbeat package comprises time when the target device reports the heartbeat package, and the electronic device stores the data in the heartbeat package as historical data after receiving the heartbeat package. Thus, the electronic device may obtain the historical data from the storage location of the historical data and obtain the interrogation time node from the historical data. The polling time node refers to a time or a time period when the communication unit of the target device is in an on state and can perform data interaction, namely polling time. When the time node is inquired, the communication unit of the target equipment is in an on state, and data interaction is realized through the communication unit.
In one embodiment, for a target device with a variable preset interrogation period, the preset interrogation period may be adjusted according to user settings. For example, when the target device is a smart desk lamp, the preset interrogation period may be one day, and the user may reset the preset interrogation period to 12 hours according to seasonal factors.
As one mode, the electronic device is a cloud end, the cloud end is connected with the terminal device, a user sets a period on the terminal device, the cloud end generates a beacon frame based on the setting, the beacon frame is sent to the target device to set a preset interrogation period of the target device, and the cloud end stores the preset interrogation period set by the user. As another way, the terminal device is connected with the target device and the cloud terminal respectively, the terminal device sends a period setting instruction to the target device, a preset interrogation period of the target device is set, the cloud terminal obtains the period setting instruction from the terminal device, and the preset interrogation period is obtained and stored according to the instruction.
In another embodiment, for a target device with a fixed preset interrogation period, such as a single fire device (e.g., smoke sensor), the electronic device need only acquire the preset interrogation period corresponding to the target device once.
And step S130, when the polling time node of the round is reached, a state confirmation instruction is sent to the target equipment so as to instruct the target equipment to respond to the state confirmation instruction.
The state confirmation instruction is generated by the electronic device, and is used for verifying whether the offline state of the target device is a false offline state or a true offline state. Alternatively, the state validation instruction may be an instruction of the identify attribute. When the communication unit of the target device is in the on state in the interrogation time node, the target device may receive a state confirmation instruction sent by the electronic device. In order to determine the time for sending the state confirmation instruction, whether the current time reaches the current polling time node needs to be determined, and then whether the current time is the polling time can be determined, so that whether the current polling time node reaches the current polling time node is determined.
In one embodiment, the interrogation time node is a time, after the interrogation time node is acquired, it needs to be determined whether the current time is the interrogation time node, and when the current time is different from the interrogation time node, it is determined that the current time is not the interrogation time node, which indicates that the electronic device has missed the interrogation time node of the target device for starting the communication unit. For example, the current time is 10:22, the interrogation time node is 10:20, or the electronic device has not yet waited for the target device to turn on the communication unit, for example, the current time is 10:22, and the interrogation time node is 10:30.
In another embodiment, the polling time node is a time period, and the communication unit of the target device is in an on state for a continuous period of time (i.e., in the polling time node), that is, a polling time period corresponding to the polling time node, and when the current time is not in the polling time period, it is determined that the current time does not satisfy the polling time node. For example, when the acquired interrogation time is 9:00, the communication unit is turned on for 2 minutes, and the interrogation time is between 9:00 and 9:02. When the current time is 8:49, the current time is not considered to be within the interrogation time length, the current time is determined not to meet the interrogation time node, and the electronic device still needs to continue waiting for the interrogation time.
As one approach, to save electronic device costs, the electronic device sends a status confirmation instruction to the target device once within the interrogation time period.
Alternatively, to make the validation result more accurate, the electronic device may continue to send status validation instructions to the target device multiple times during the interrogation period.
And step 140, when receiving response information fed back by the target equipment based on the state confirmation instruction, updating the display state of the target equipment into an on-line state.
The principle that the electronic device verifies whether the offline state is the true offline state or the false offline state through the state confirmation instruction is that when the time node is inquired, the communication unit of the target device is in an on state, and the electronic device sends the state confirmation instruction to the target device. The target equipment receives the state confirmation instruction through the communication unit on the target equipment, then responds to the state confirmation instruction, the electronic equipment judges that the communication connection between the electronic equipment and the target equipment is normal after receiving the response of the target equipment, and the electronic equipment can control the target equipment through the connection relation, namely, the target equipment is in an actually online state. That is, the offline state of the displayed target device is a pseudo offline. And updating the display state of the target equipment from an offline state to an online state, so that the electronic equipment can conveniently control the target equipment.
Otherwise, if the electronic device does not receive the response of the target device, it is determined 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 an offline state, that is, the offline state of the displayed target device is true offline.
Optionally, due to the fact that interference factors in the environment may cause data loss in transmission between the electronic device and the target device, in order to ensure accuracy of the verification result, the electronic device may send a status confirmation instruction to the target device multiple times, that is, if response information fed back by the target device is not received within a preset duration, determine an interrogation time node of a next round. And when the next round of inquiry time node is reached, sending a state confirmation instruction to the target equipment so as to instruct the target equipment to respond to the state confirmation instruction.
Alternatively, in order to prevent the transient occupation of the processing resources of the electronic device and the communication resources of the current network, the round of re-authentication is limited, and the round of re-authentication may be preset, for example, may be set to 5 times, 6 times, or the like. And if no response returned by the target equipment is received in the preset round, determining that the offline state of the target equipment is a true offline.
In the method for updating the display state of the device provided in the embodiment, a plurality of devices are present in the current network, the device whose display state is the offline state is determined from the plurality of devices as the target device, in order to determine whether the device state is the above-mentioned false offline state, the interrogation time node of the target device is obtained according to the historical data, and the target device has the function of transmitting and receiving information when the interrogation time node of the current round is. Therefore, the state confirmation instruction is sent to the target equipment, when the response of the target equipment based on the state confirmation instruction is received, the target equipment is confirmed to be in an online state capable of carrying out communication, and the display state of the target equipment is updated to be in the online state, so that the real state of the target equipment is accurately and rapidly detected, and the control of the equipment in the later period is facilitated. Compared with the blind sending identification message in the prior art, the embodiment of the application can send the state confirmation instruction after waiting for the inquiry time node, so that the target equipment can quickly respond to the instruction, and the state detection speed is improved.
And before the display state is an offline state, the target device periodically reports the heartbeat package to the electronic device, and the electronic device stores the heartbeat data in the heartbeat package. For example, in a scenario where the historical data includes historical heartbeat data, the heartbeat attributes may be stored into the historical data.
Referring to fig. 5, step S120 includes the following sub-steps:
and step S121, acquiring historical heartbeat data of the target equipment in a preset time period.
And before the display state of the target equipment is an offline state, the target equipment and the electronic equipment maintain normal communication through the current network, and the target equipment periodically reports the heartbeat package to the electronic equipment. The electronic equipment stores the heartbeat data in the heartbeat packet as historical heartbeat data to a preset storage position.
And step S122, acquiring a historical heartbeat time node in the historical heartbeat data, and determining the interrogation time node of the target device based on the historical heartbeat time node.
The historical heartbeat data comprises a historical heartbeat time node, wherein the historical heartbeat time node refers to the moment or the time period when the communication unit of the target device is in the on state before the display state of the target device is in the off-line state. It will be appreciated that the target device may interact with data at the time of the historic heartbeat time node. And presuming the interrogation time node of the target device according to the historical heartbeat node.
In one embodiment, referring to fig. 6, substep S122 includes the substeps of:
and step S122-1, performing smoothing processing on the historical heartbeat time nodes in the historical heartbeat data to obtain smoothed time nodes.
The historical heartbeat data is stored with a historical heartbeat time node actively reported by the target device, and it can be understood that when the historical heartbeat time node is, a communication unit of the target device is in an on state, and the device can perform data interaction.
The electronic device acquires the historical heartbeat data, alternatively, the electronic device may acquire the historical heartbeat data from a location where the electronic device itself stores the historical heartbeat data, and may also acquire the historical heartbeat data from other devices connected to the electronic device. The historical heartbeat data includes a plurality of historical heartbeat time nodes, as shown in fig. 7, the x-axis represents a number of weeks, for example, x represents monday in 1 time and x represents sunday in 7 times, and it is understood that the period of sending the historical heartbeat time nodes by the target device may be 1 day. The y-axis represents clock display time, e.g., a y-axis of 10 represents 10:00. As shown in FIG. 7, points on the x-y coordinate system characterize historical heartbeat time nodes of the target device, e.g., a plurality of historical interrogation moments of the target device are acquired for consecutive one week, 10:35,10:34,10:37,10:35, respectively.
It should be noted that, the historical heartbeat data includes not only the historical heartbeat time node of the target device, but also the historical heartbeat time nodes of the rest devices except the target device. And the interrogation period is not limited to the above 1 day, but may be 6 hours, one day, one week, etc. depending on the actual system result.
Because the historical heartbeat time nodes of different rounds of the target equipment are different, curves formed by the different historical heartbeat time nodes have fluctuation. When estimating the interrogation time node from the historical heartbeat time node, in order to improve the accuracy of the estimation, a curve smoothing process for the historical heartbeat time node is required. Illustratively, the curve shown in FIG. 8 is obtained after smoothing the curve of the historic heartbeat time node of FIG. 7.
The method of smoothing the curve formed by the historical heartbeat time nodes can calculate the average value of a plurality of historical heartbeat time nodes, and the average value is used as the interrogation time node. An average of a plurality of historical heartbeat time nodes is calculated.
Specifically, first, the total number of minutes represented by the plurality of historical heartbeat time nodes, that is, the sum of the number of minutes corresponding to the hours of the plurality of historical heartbeat time nodes and the number of minutes of the plurality of historical heartbeat time nodes, is calculated as the total number of minutes, and continuing to combine the example in fig. 7, the total number of minutes is 10×60×7+35×5+34+37=4446. The average hour is then calculated, calculated by the total number of minutes and days, and if the calculated average hour is a decimal integer, specifically, the total number of minutes/days/60, the average hour is obtained, for example, 4446/7/60=10, and the average hour obtained is 10. The average minutes, specifically the total minutes divided by the number of days, is recalculated and the remainder is taken for 60, for example, (4446/7)% 60=35. Finally, average hours and average minutes are connected to obtain average interrogation time 10:35. The average value may be taken as the interrogation time node for each day of the next week.
Substep S122-2 determines an interrogation cycle node of the target device based on the smoothed time node.
The electronic device determines an interrogation cycle node of the target device based on the smoothed time node. Illustratively, the electronic device obtains a reading on the y-axis corresponding to a point with an x-axis of 1 as the interrogation cycle node, based on the graph shown in FIG. 8, for Monday.
In another embodiment, referring to fig. 9, the substep S122 includes the following substeps:
And step S122-3, adjusting the historical heartbeat time node in the historical heartbeat data within a preset threshold range to be a first heartbeat time node.
Alternatively, a plurality of historical heartbeat time nodes are acquired, and two different time nodes may be taken as the first heartbeat time node and the second heartbeat time node in any one of the plurality of historical heartbeat time nodes, for example, refer to fig. 10, in which an abscissa is a date and an ordinate is the historical heartbeat time node, and the plurality of historical heartbeat time nodes are acquired according to fig. 10 and are respectively 10:15, 10:17, 10:19, 10:13, 10:15, 10:07, 10:23, 10:15 and 10:11. Two different time nodes are arbitrarily selected from the plurality of historical heartbeat time nodes as a first time node and a second time node, for example, 10:18 is selected as the first time node, and 10:05 is selected as the second time node. Or, among the plurality of historical heartbeat time nodes, two historical heartbeat time nodes with higher current frequency are taken out as two time nodes, for example, the first heartbeat time node may be 10:15, and the second heartbeat time node may be 10:17.
Alternatively, a preset threshold range is set in advance, and for example, the preset threshold range may be set to 6 minutes.
And adding a preset threshold range to each of the plurality of historical heartbeat time nodes to obtain added historical heartbeat time nodes, and processing each historical heartbeat time node into a time node which is closer to the added historical heartbeat time node. For example, a certain historical heartbeat time node is added or subtracted from a preset threshold range to obtain a calculation result, and when the calculation result approaches to the first heartbeat time node compared with the second heartbeat time node, the historical heartbeat time node is adjusted to be the first heartbeat time node.
For example, when 10:18 and 10:07 are selected as the first heartbeat time node and the second heartbeat time node, for the historical heartbeat time node 10:12, the historical heartbeat time node 10:12 is added with 6 minutes to obtain a calculation result of 10:18, and the calculation result 10:18 is closer to the first heartbeat time node 10:18 than the second heartbeat time node 10:07, the historical heartbeat time node 10:12 is processed as 10:18, that is, the historical heartbeat time node is adjusted to be the first heartbeat time node.
And step S122-4, adjusting the historical heartbeat time nodes which are not in the preset threshold range in the historical heartbeat data to be second heartbeat time nodes.
And adding a preset threshold range to each of the plurality of historical heartbeat time nodes to obtain added historical heartbeat time nodes, and processing each historical heartbeat time node into a time node which is closer to the added historical heartbeat time node. For example, a certain historical heartbeat time node is added or subtracted from a preset threshold range to obtain a calculation result, and when the calculation result approaches to a second heartbeat time node compared with the first heartbeat time node, the historical heartbeat time node is adjusted to the second heartbeat time node.
For example, continuing with the above example, for the historical heartbeat time node 10:05, the historical heartbeat time node 10:05 is added with 2 minutes to obtain a calculation result of 10:07, the calculation result 10:07 is closer to the second heartbeat time node 10:07 than the first heartbeat time node 10:18, and the historical heartbeat time node 10:05 is processed to the second heartbeat time node.
The historic heartbeat time node curve in fig. 10 is adjusted to the curve shown in fig. 11 according to substep S122-3 and substep S122-4.
Substep S122-5, determining the interrogation time node of the target device based on the first and second heartbeat time nodes.
The interrogation time node of the target device is determined from the graph based on the first and second heartbeat time nodes obtaining the graph as shown in fig. 11. For example, if the current date is number 1, the ordinate 10:18 corresponding to the point with the abscissa of 1 is obtained from fig. 11 as the node of the interrogation time of the target device.
On the basis of the embodiment of fig. 4, this embodiment provides a method for updating a display state of a device, please refer to fig. 13, which includes the following steps:
step S210, a device with an offline state is displayed in a plurality of devices of the current network as a target device.
Step S220, historical data of the target device is obtained, and the interrogation time node of the target device is determined based on the historical data.
And step S230, when the polling time node of the round is reached, a state confirmation instruction is sent to the target equipment so as to instruct the target equipment to respond to the state confirmation instruction.
And step S240, when receiving response information fed back by the target equipment based on the state confirmation instruction, updating the display state of the target equipment into an on-line state.
The specific description of step S210 to step S240 refer to step S110 to step S140, and are not described herein.
And step S250, synchronizing the updated online state of the target equipment to a corresponding terminal so as to instruct the terminal to update the state of the target equipment to the online state and display the online state, thereby restoring the control of the terminal to the target equipment.
The display states of the electronic device and the target device displayed on the terminal are synchronized, so that after the display state of the target device is updated to the online state on the electronic device, in order to keep the synchronization of the display states of the electronic device and the terminal, the electronic device synchronizes the updated online state of the target device to the corresponding terminal, and the control terminal updates the display state of the target device from the original offline state to the online state and displays the updated online state. For example, the identification information representing the status of the target device may be updated from gray to color. After the display state of the target device is displayed on the terminal in the on-line state, the terminal considers that the target device can be controlled, and thus control of the target device is resumed on the terminal.
According to the device display state updating method provided by the embodiment, after the electronic device updates the display state of the target device from the offline state to the online state, the electronic device synchronizes the online state to the terminal, namely, the updated online state of the target device is synchronized to the corresponding terminal, so that the terminal is instructed to update the display state, and a user can conveniently control the target device through the terminal.
For a scenario in which an electronic device is a cloud and a target device is a wireless switch, the present application proposes a device display status updating method, fig. 14 is a flowchart illustrating a device display status updating method according to another embodiment of the present application, and referring to fig. 14, the device display status updating method includes:
in step S310, the display state of the wireless switch is an off-line state.
The cloud end is in communication connection with the wireless switch, and the cloud end obtains that the display state of the wireless switch is an off-line state. It can be understood that when the wireless switch is in an offline state, the cloud considers that the wireless switch is disconnected from the network, and the cloud cannot control the wireless switch.
Step S320, automatic sending of the identification message is set.
Alternatively, the status confirmation instruction may be an identify message. The automatic sending of the identification message is set, and it can be understood that the cloud terminal predicts the interrogation time node according to the historical interrogation time node, and when the current moment reaches the predicted interrogation time node, the cloud terminal automatically sends the identification message to search for the response of the wireless switch.
Step S330, the cloud judges whether the estimated inquiry time node is reached.
If it is determined that the predicted interrogation time node is reached, the flow returns to step S320, and if it is determined that the predicted interrogation time node is not reached, the flow proceeds to step S340.
Step S340, the cloud sends an identification message to the wireless switch.
Based on the automatic setting in step S320, the cloud automatically sends an identification message to the wireless switch.
Step S350, judging whether the wireless switch is on-line or not.
If the cloud determines that the wireless switch is not on-line, that is, the wireless switch does not respond to the identification message, in order to further determine the display state of the wireless gateway, the flow proceeds to step S360, and if the cloud determines that the wireless switch is on-line and the wireless switch responds to the identification message, the flow proceeds to step S370.
Step S360, judging whether the number of times of triggering the identification message is less than a preset number of times.
If the cloud determines that the number of times of triggering the identification message is less than the preset number of times, it is indicated that the cloud may further continue to trigger the identification message, and the flow returns to step S340. If the cloud determines that the number of times of triggering the identification message is not less than the preset number of times, the number of times of triggering the identification message by the cloud is larger than or equal to the preset number of times, and if the number of times of triggering the identification message by the cloud is enough but the wireless switch response is not received, the flow returns to step S310.
In step S370, the display state of the wireless switch is updated from the off-line state to the on-line state.
The cloud updates the display state of the wireless switch from an off-line state to an on-line state. The cloud end can also control the indication lamp indicating the on-line state to be lighted, so that a user can know the working state of the wireless switch conveniently.
According to the equipment display state updating method provided by the embodiment, the cloud determines that the display state of the wireless switch is an off-line state, and in order to determine whether the off-line state of the wireless switch is a false off-line state, the cloud predicts an inquiry time node of the wireless switch according to historical data, and when the wireless switch is in the inquiry time node, the wireless switch has a function of receiving and transmitting information. Therefore, when the time node is inquired, the cloud automatically triggers the identification message, sends the identification message to the wireless switch, confirms that the wireless switch is in an on-line state capable of communicating when receiving a response of the wireless switch based on the identification message, and updates the display state of the wireless switch to the on-line state so as to accurately and rapidly detect the real state of the wireless switch and also facilitate the control of the wireless switch in the later period.
For a scenario that an electronic device is a cloud end and a target device is a wall socket, the present application provides a device display status updating method, fig. 15 is a schematic flow diagram of a device display status updating method provided by a further embodiment of the present application, referring to fig. 15, where the device display status updating method includes:
In step S410, the display state of the wall socket is an off-line state.
The cloud end is in communication connection with the wall socket, and the cloud end obtains that the display state of the wall socket is an off-line state. It can be appreciated that when the wall socket is offline, the cloud considers the wall socket to be disconnected from the network, and the cloud cannot control the wall socket.
Step S420, setting manual or automatic sending of the identification message.
Alternatively, the status confirmation instruction may be an identify message.
The automatic sending of the identification message can be set, and it can be understood that the cloud end predicts the interrogation time node according to the historical interrogation time node, and when the current moment reaches the predicted interrogation time node, the cloud end automatically sends the identification message to seek the response of the wall socket.
The cloud end predicts the interrogation time node according to the historical interrogation time node, and when the current time reaches the predicted interrogation time node, the cloud end sends prompt information to prompt the user to reach the interrogation time node, and after receiving the prompt information, the user manually sends the identification message, wherein the prompt information.
Step S430, the cloud determines whether the estimated inquiry time node is reached.
If the cloud determines that the estimated inquiry time node is not reached, the flow proceeds to step S440, and if the cloud determines that the estimated inquiry time node is reached, the flow proceeds to step S450.
Step S440, manually triggering the identification message.
And receiving an identification message instruction manually triggered by a user, and manually triggering the identification message. Alternatively, the identify message may also be triggered automatically upon reaching the expected interrogation time node.
And S450, the cloud end sends an identification message to the wall socket.
And the cloud sends an identification message to the wall socket.
Step S460, judging whether the wall socket is on line or not.
If the wall outlet is restored to the on-line state, the flow proceeds to step S480, and if the wall outlet is not restored to the on-line state, the flow proceeds to step S470.
Step S470, judging whether the number of times of triggering the identification message is less than the preset number of times.
If the number of times of triggering the identification message is less than the preset number of times, the cloud end can also continue to trigger the identification message, and the flow returns to step S410. If the number of times of triggering the identification message is not less than the preset number of times, it is indicated that the number of times of triggering the identification message by the cloud is greater than or equal to the preset number of times, and if the number of times of triggering the identification message by the cloud is enough but no response of the wall socket is received, the flow returns to step S450.
In step S480, the display state of the wall socket is updated from the offline state to the online state.
The cloud updates the display state of the wall socket from an offline state to an online state. The cloud end can also control the indication lamp indicating the on-line state to be lighted, so that a user can know the working state of the wireless switch conveniently.
In the method for updating the display state of the device provided by the embodiment, if the cloud determines that the display state of the wall socket is an offline state, in order to determine whether the offline state of the wall socket is a false offline state, the cloud predicts an inquiry time node of the wall socket according to the historical data, and when the inquiry time node is detected, the wall socket has a function of receiving and transmitting information. Therefore, when the time node is inquired, the cloud automatically triggers the identification message, the identification message is sent to the wall socket, when the response of the wall socket based on the identification message is received, the wall socket is confirmed to be in an on-line state capable of communicating, the display state of the wall socket is updated to be in an on-line state, the real state of the wall socket is accurately and rapidly detected, and the control of the wall socket in the later period is facilitated.
It should be understood that, although the steps in the flowcharts of fig. 4-6, 9, 12, 13 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps of fig. 4-6, 9, 12, 13 may comprise a plurality of sub-steps or phases, which are not necessarily performed at the same time, but may be performed at different times, nor does the order of execution of the sub-steps or phases necessarily follow one another, but may be performed alternately or alternately with at least some of the other steps or sub-steps of other steps.
In order to implement the above method embodiments, the present embodiment provides a device display status updating apparatus, fig. 16 is a block diagram of the device display status updating apparatus provided in an embodiment of the present application, and referring to fig. 16, the device display status updating apparatus 100 includes a target device determining module 110, an obtaining module 120, a sending module 130, and a confirming module 140.
A target device determining module 110, configured to take, as a target device, a device whose display status is an offline status among a plurality of devices of a current network;
An acquisition module 120, configured to acquire historical data of the target device, and determine an interrogation time node of the target device based on the historical data;
A sending module 130, configured to send a status confirmation instruction to the target device when the current round of inquiry time node is reached, so as to instruct the target device to respond to the status confirmation instruction;
and the confirmation module 140 is used for updating the display state of the target equipment to be an on-line state when receiving response information fed back by the target equipment based on the state confirmation instruction.
Optionally, the acquisition module 120 includes a data acquisition module and an interrogation time node acquisition module.
The data acquisition module is used for acquiring historical heartbeat data of the target equipment in a preset time period;
The inquiry time node acquisition module is used for acquiring a historical heartbeat time node in the historical heartbeat data and determining the inquiry time node of the target device based on the historical heartbeat time node.
Optionally, the interrogation time node obtaining module comprises a smoothing module and a first interrogation time node obtaining module.
The smoothing module is used for carrying out smoothing processing on the historical heartbeat time nodes in the historical heartbeat data to obtain smoothed time nodes;
And the first interrogation time node acquisition module is used for determining an interrogation period node of the target device based on the smoothed time node.
Optionally, the acquisition module of the interrogation time node comprises a first adjustment module, a second adjustment module and a second acquisition module of the interrogation time node.
The first adjusting module is used for adjusting the historical heartbeat time node in the historical heartbeat data within a preset threshold range to be a first heartbeat time node;
The second adjusting module is used for adjusting the historical heartbeat time nodes which are not in the preset threshold range in the historical heartbeat data to be second heartbeat time nodes;
a second interrogation time node obtaining module for determining the interrogation time node of the target device based on the first and second heartbeat time nodes.
Optionally, the sending module 130 includes an interrogation duration obtaining module and a status confirmation instruction sending module.
The interrogation time length acquisition module is used for acquiring interrogation time length when the current moment meets the interrogation time node;
and the state confirmation instruction sending module is used for continuously sending the state confirmation instruction to the target equipment in the interrogation time length so as to instruct the target equipment to respond to the state confirmation instruction.
Optionally, the device further comprises a determining module and a continuous sending module.
The determining module is used for determining a next round of inquiry time node if response information fed back by the target equipment is not received within a preset duration;
And the continuous sending module is used for sending a state confirmation instruction to the target equipment when the next round of inquiry time nodes are reached, so as to instruct the target equipment to respond to the state confirmation instruction.
Optionally, the device further comprises an updating module.
And the updating module is used for synchronizing the updated online state of the target equipment to a corresponding terminal so as to instruct the terminal to update the state of the target equipment into the online state and display the online state, so that the control of the terminal on the target equipment is restored.
Optionally, the target device is a ZigBee device.
It can be clearly understood by those skilled in the art that the motion detection device provided in the embodiment of the present application can implement each process implemented by the electronic device in the method embodiment of fig. 4 to 15, and for convenience and brevity of description, the specific working process of the above description device and module may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided by the present application, the illustrated or discussed coupling or direct coupling or communication connection of the modules to each other may be through some interfaces, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other forms. In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The embodiment of the invention provides electronic equipment, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the method for detecting fingerprint foreign matters, which is provided by the embodiment of the method.
The memory may be used to store software programs and modules that the processor executes to perform various functional applications and data processing by executing the software programs and modules stored in the memory. The memory may mainly include a storage program area which may store an operating system, application programs required for functions, and the like, and a storage data area which may store data created according to the use of the device, and the like. 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, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide access to the memory by the processor.
Fig. 17 is a block diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in fig. 17, the electronic device 1200 may be configured or configured differently to provide a relatively large variance, and may include one or more Processors (PU) 1210 (the processor 1210 may include, but is not limited to, a microprocessor MCU or a Processing device such as a programmable logic device FPGA), a memory 1230 for storing data, one or more storage media 1220 (e.g., one or more mass storage devices) for storing applications 1223 or data 1222. Wherein memory 1230 and storage medium 1220 can be transitory or persistent. The program stored on the storage medium 1220 may include one or more modules, each of which may include a series of instruction operations on a server. Still further, the processor 1210 may be configured to communicate with a storage medium 1220 and to execute a series of instruction operations in the storage medium 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 the like.
The input-output interface 1240 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the electronic device 1200. In one example, the input/output interface 1240 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the input/output interface 1240 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 17 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device 1200 may also include more or fewer components than shown in fig. 17, or have a different configuration than shown in fig. 17.
The embodiment of the application also provides 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 embodiment of the device display state updating method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is provided here. The computer readable storage medium is, for example, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk or an optical disk.
Embodiments of the present invention provide a computer program product or computer program comprising computer instructions 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 performs the steps in the above-described method embodiments.
In summary, the method, the apparatus, the electronic device and the storage medium for updating the device display state provided by the application have a plurality of devices in the current network, and determine, from the plurality of devices, the device whose display state is in an offline state as a target device, in order to determine whether the device state is the above-mentioned false offline, acquire the polling time node of the target device according to the history data, and when the polling time node of the current round is, the target device has a function of transmitting and receiving information, so that a state confirmation instruction is sent to the target device, and when a response of the target device based on the state confirmation instruction is received, the target device is confirmed to be in an online state capable of performing communication, and the display state of the target device is updated to be in the online state, so that the true state of the target device is accurately detected, and further control of the device is facilitated.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal (which may be a smart gateway, a mobile phone, a computer, a server, an air conditioner or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the scope of the present application.