Equipment control method and device, computer equipment and storage medium

By detecting the distributed network equipment in the target network and determining the control strategy to ensure communication connection between devices, the linkage problem of the thermostat when the device fails in the 485 communication network is solved, and the stable operation of the system in the event of a failure is achieved.

CN119148545AActive Publication Date: 2024-12-17GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411558826.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2024-12-17
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

When the existing thermostat fails in the 485 communication network, the linkage function cannot be maintained, resulting in unstable or failure of the system operation, and it is impossible to cope with the failure of equipment in the communication network.

Method used

By detecting whether there are distributed devices in the target network, determining the control strategy based on the judgment results, controlling the connection between the undistributed devices and the router of the distributed devices, or controlling the communication faulty devices to turn on the hotspot to ensure the communication connection between the devices and realize Communication network recovery in case of device failure.

Benefits of technology

In the event of a device failure, the communication connection between the devices is maintained through the router or hotspot mechanism to prevent the system from getting out of control and ensure the stability of information transmission and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148545A_ABST
    Figure CN119148545A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to an equipment control method and device, computer equipment and a storage medium, and the method comprises the steps: judging whether network distribution equipment exists in a target network or not when detecting that communication fault equipment exists in the target network, and enabling the target network to comprise a plurality of pieces of equipment which are in communication connection with each other; determining a control strategy of the equipment in the target network according to a judgment result; and controlling the communication mode of the equipment in the target network according to the control strategy. Therefore, when the communication failure equipment exists in the target network, the corresponding control strategy can be determined according to whether the network distribution equipment exists in the current target network or not, so that the communication mode of the equipment is controlled through the control strategy, and the communication network can still be in normal communication connection when one piece of equipment has the communication failure; information transmission among the devices is guaranteed, and out-of-control of the system is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of device control, and in particular, to a device control method, device, computer device, and storage medium. Background Art

[0002] As a device for directly controlling load drive, the thermostat is widely used in systems that require temperature regulation, such as air conditioners. At present, the thermostats on the market are usually in a mode where a single device corresponds to a single air conditioner. When multiple thermostats need to be linked, they are often synchronized through network communication of devices such as 485 communication networks to ensure that the status of each thermostat remains consistent. However, in actual applications, once the 485 communication network fails or is disconnected, the communication between the thermostats will be interrupted and the original linkage function cannot be realized. In this case, the thermostat will not be able to synchronize its status, which may cause unstable or failed system operation.

[0003] The existing technology cannot cope with the situation that a certain device in the communication network fails. When the device communication fails or fails, the temperature controllers in the system will not be able to continue to operate in conjunction. Therefore, how to ensure the communication connection between devices when a certain device in the 485 communication network fails has become an urgent problem to be solved. Summary of the invention

[0004] In view of this, in order to solve the above technical problems or part of the technical problems, the embodiments of the present invention provide a control method, an apparatus, a computer device and a storage medium for a device.

[0005] In a first aspect, an embodiment of the present invention provides a method for controlling a device, including:

[0006] When a communication fault device is detected in the target network, determining whether there is a network-configured device in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other;

[0007] Determine a control strategy for the device in the target network according to the judgment result;

[0008] The communication mode of the device in the target network is controlled according to the control strategy.

[0009] In a possible implementation manner, determining the control strategy of the device in the target network according to the judgment result includes:

[0010] When the judgment result is that there is a network-configured device, determining the control strategy is: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device;

[0011] When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

[0012] In a possible implementation manner, the communication fault device is determined in the following manner:

[0013] At intervals of a first time length, controlling each device in the target network to send device information to other devices;

[0014] When more than a preset number of devices do not receive the device information of the first device, determining that there is a communication fault device, and determining that the first device is the communication fault device;

[0015] Or, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be the communication fault device.

[0016] In a possible implementation, controlling the unconfigured device to connect to the router of the configured device to control the communication connection of the device in the target network through the router, the first address of the configured device and the second address of the unconfigured device includes:

[0017] When the network-configured device is connected to the router, controlling the network-configured device to send network configuration information to the unconfigured device;

[0018] Controlling the unconfigured network device to connect to the router through the network configuration information;

[0019] Control the unconfigured device to extract the first address from the device information of the configured device, so as to communicate with the configured device through the first address;

[0020] The unconfigured network device is controlled to send the second address to the router, so that the router sends the second address to the configured network device, so that the configured network device is communicatively connected with the unconfigured network device through the second address.

[0021] In a possible implementation manner, controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot includes:

[0022] Control the device with normal communication to extract the hotspot name from the device information with communication failure;

[0023] Control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot;

[0024] When the verification is successful through the verification information, the communication fault device and the communication normal device are controlled to establish a communication connection according to the hotspot.

[0025] In a possible implementation, the method further includes:

[0026] When there are multiple network-configured devices, and the multiple network-configured devices include a communication fault device, determining a first target router to which the communication fault device is connected;

[0027] Control the normal communication device to connect to the first target router according to the network configuration information of the communication faulty device, and control the communication connection of devices in the target network through the first target router, the third address of the communication faulty device and the fourth address of the normal communication device.

[0028] In a possible implementation, when there are multiple network-configured devices and the multiple network-configured devices do not include a communication fault device, controlling the communication fault device to obtain a router signal strength of each network-configured device;

[0029] Determine a target network-configured device with the largest router signal strength, and determine a second target router for the target network-configured device;

[0030] Control the communication fault device to connect to the second target router according to the network configuration information of the target networked device, and control the device communication connection in the target network through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

[0031] In a second aspect, an embodiment of the present invention provides a control device for a device, including:

[0032] A judgment module, used for judging whether there is a network-configured device in the target network when a communication fault device is detected in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other;

[0033] A determination module, used to determine a control strategy for the device in the target network according to the determination result;

[0034] A control module is used to control the communication mode of the device in the target network according to the control strategy.

[0035] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a processor and a memory, wherein the processor is used to execute a control program of the device stored in the memory to implement a control method of the device described in any one of the first aspects above.

[0036] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the control method of the device described in any one of the first aspects above.

[0037] The control scheme of the device provided in the embodiment of the present invention is to determine whether there is a network-configured device in the target network when a communication failure device is detected in the target network, and the target network includes multiple devices that are connected to each other in communication; determine the control strategy of the device in the target network according to the judgment result; and control the communication mode of the device in the target network according to the control strategy. Therefore, when there is a communication failure device in the target network, the corresponding control strategy can be determined according to whether there is a network-configured device in the current target network, so as to control the communication mode of the device through the control strategy, so as to achieve normal communication connection of the communication network when a communication failure occurs in a certain device, ensure the information transmission between the devices, and avoid the loss of control of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of a flow chart of a control method for a device provided by an embodiment of the present invention;

[0039] Figure 2 A schematic flow chart of another device control method provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the structure of a control device of a device provided by an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention;

[0042] Figure 5 A flowchart of a control method for another device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.

[0045] Figure 1 A flow chart of a control method for a device provided in an embodiment of the present invention is shown as follows: Figure 1 As shown, the method specifically includes:

[0046] S11. When it is detected that there is a communication fault device in the target network, it is determined whether there is a configured device in the target network, wherein the target network includes a plurality of devices that are communicatively connected to each other.

[0047] The control method of the device provided in the embodiment of the present invention is applied to computer equipment, which may include but is not limited to: servers, desktop computers, controllers (for example, programmable logic controllers PLC), central systems, etc. The target network may be a communication network established based on the RS-485 standard, and the target network includes multiple devices that can communicate with each other. The computer device can issue control instructions to each device in the target network to control it. Specifically, when there is a communication failure device in the target network, the corresponding communication connection method can be determined according to whether there is a network-connected device in the current target network, so as to perform communication connection through the communication connection method.

[0048] In this embodiment, the device may include, but is not limited to, a temperature control device (e.g., a thermostat, a temperature and humidity controller, etc.) that can be connected to the target network. Each device in the target network can send control instructions, device information, network configuration information, etc. to each other to achieve linkage and message synchronization of all devices. When a device has a communication failure, the device will not be able to receive information sent by other devices, nor can it send information to other devices. Therefore, the method of judging whether a communication failure device currently exists may include: controlling each device to send its own device information and network configuration information to other devices at intervals of a preset time period (only network-configured devices need to send), etc. When a device cannot send or receive device information to other devices in a certain round of information transmission, the device is determined to be a communication failure device. Alternatively, using an RS-485 communication protocol analyzer or a serial port debugging tool, the data transmission of devices in the network can be monitored. By checking the reception and transmission of data packets, devices that have no response or incomplete data can be identified. If a device is found to have no response or data loss, it may be that the device has failed to communicate. Error frames can be captured to check whether there are CRC errors, verification failures, etc. If so, the device is determined to be a communication failure device. Alternatively, in the target network, a computer device can act as a master device, usually communicating with multiple devices by polling. The polling request sent by the master device can be monitored by software to see if each device responds normally. If a device fails to return data or the response times out during polling, it is determined to be a communication failure device.

[0049] S12, determining a control strategy for the device in the target network according to the judgment result;

[0050] S13: Control the communication mode of the device in the target network according to the control strategy.

[0051] In this embodiment, step S12 and step S13 are described uniformly. When the judgment result is that there is a network-configured device, the control strategy is determined as follows: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device;

[0052] Specifically, when any device is networked, the network configuration information will be synchronously sent to each device through the target network so that each device can store it. The network configuration information may include the first address of the networked device and the information of the connected router. When a communication failure device appears, it means that the device cannot communicate and connect with other devices through the target network. Regardless of whether the networked device is a communication failure device, the communication connection between each device can be achieved through the router. At this time, each device can determine the current communication failure device in step S11, control the unconfigured device to determine the network configuration information of the configured device from the pre-stored network configuration information, and configure the network based on the network configuration information, connect the router of the configured device, and communicate and connect with the configured device through the router according to the pre-stored first address. The router can assign a network address to the unconfigured device as the second address, and both the unconfigured device and the configured device can obtain the assigned second address and store it. At the same time, the configured device can communicate and connect with the unconfigured device through the router according to the second address. Among them, the communication connection of the router can be performed only for the communication failure device, or the communication connection of the router can be performed for all unconfigured devices.

[0053] For example, when the communication fault device is an unconfigured device, the communication fault device is controlled to be connected to the same router as the configured device. When there are group control instructions or information that needs to be synchronized, the communication fault device can receive the information or control instructions forwarded by the configured device, and other devices with normal communication can also communicate in the target network. When the communication fault device is a configured device, any other device with normal communication can be controlled to be connected to the same router as the communication fault device. When there are group control instructions or information that needs to be synchronized, the communication fault device can receive the information or control instructions forwarded by the normal communication device through the router, and other devices with normal communication can also communicate in the target network. Alternatively, all other devices are controlled to be connected to the same router as the communication fault device, and messages and control instructions are sent through the router. In this way, all devices in the target network can achieve communication connection with each other.

[0054] When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

[0055] Specifically, when there is no configured device in the target network, the communication fault device is controlled to automatically turn on the wireless hotspot function. At this time, the communication fault device will generate a temporary wireless hotspot signal, so that other devices with normal communication in the target network can discover and connect to the hotspot.

[0056] Specifically, the device information synchronized by the devices in the target network at preset intervals will include the hotspot name of each device, that is, each device will pre-store the hotspot names of other devices, and control the normal communication devices in the target network to scan nearby available networks. After discovering the hotspot name opened by the communication fault device, the normal communication devices are controlled to automatically connect to the hotspot, thereby establishing a temporary communication channel with the communication fault device.

[0057] Data interaction and status synchronization can be performed through the hotspot of the communication failure device. Even if the communication failure device cannot access the target network, other devices can still be linked and controlled through this temporary communication method.

[0058] In one possible implementation, the connection status of the device with communication failure can be continuously monitored. When the failed device resumes normal communication with the router or the target network, the hotspot function of the device can be controlled to be turned off to restore the normal network communication path. At the same time, the communication normal device that has established a connection through the hotspot will automatically switch back to the original network connection to achieve seamless communication.

[0059] The control method of the device provided in the embodiment of the present invention is to determine whether there is a network-configured device in the target network when a communication failure device is detected in the target network, and the target network includes multiple devices that are connected to each other in communication; determine the control strategy of the device in the target network according to the judgment result; and control the communication mode of the device in the target network according to the control strategy. Therefore, when there is a communication failure device in the target network, the corresponding control strategy can be determined according to whether there is a network-configured device in the current target network, so as to control the communication mode of the device through the control strategy, so as to achieve normal communication connection of the communication network when a communication failure occurs in a certain device, ensure the information transmission between the devices, and avoid the loss of control of the system.

[0060] Figure 2 A flow chart of another device control method provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method specifically includes:

[0061] S21. Control each device in the target network to send device information to other devices at intervals of a first time length; when more than a preset number of devices have not received the device information of the first device, determine that there is a communication fault device, and determine that the first device is a communication fault device.

[0062] In this embodiment, each device in the target network will send the current device information of the device to all other devices once at a preset first time interval to achieve timely synchronization of device information. The device information may include but is not limited to: device identification, communication address, device's own barcode information, device hotspot name, etc. When each device receives the device information sent by other devices, all device information will be stored for use in subsequent communications.

[0063] After sending device information once, if more than a preset number of devices in the target network do not receive the device information of a first device, it means that the first device cannot communicate in the target network, and the first device is determined to be a communication failure device. At this time, each device will receive a message that the first device is a communication failure device.

[0064] At the same time, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be a communication fault device. That is, when a second device cannot receive the device information sent by other devices, the second device can determine that it is a communication fault device. Therefore, when there is a communication fault device in the target network, all devices can get the information of which one is the communication fault device in time.

[0065] S22. When there is a network-configured device, when the network-configured device is connected to a router, control the network-configured device to send network configuration information to the unconfigured device; control the unconfigured device to connect to the router through the network configuration information; control the unconfigured device to extract a first address from the device information of the network-configured device, so as to communicate and connect with the network-configured device through the first address.

[0066] In this embodiment, after a device in the target network is connected to a router and network configuration is completed, the network-configured device will send its own network configuration information to each other device so that each device stores the network configuration information of the network-configured device. The network configuration information is used to connect to the router for network configuration, and may include but is not limited to: router name, password, address, etc.

[0067] Furthermore, when it is determined that a communication fault device has occurred and there is currently a network-configured device, there is no need to determine whether the communication fault device is a network-configured device. The unconfigured device can be controlled to connect to the router of the network-configured device according to the network configuration information, so that all devices are connected to the same router and communicated through the router. At the same time, after the unconfigured device is connected to the router, the device information of the network-configured device can be determined from the stored device information, and the first address of the network-configured device can be extracted from it. According to the first address, a message can be sent to the network-configured device through the router. At the same time, the network-configured device can also forward the received message to other devices, realizing the communication connection between all devices in the target network.

[0068] S23, controlling the unconfigured device to send the second address to the router, so that the router sends the second address to the configured device, so that the configured device is communicatively connected with the unconfigured device through the second address.

[0069] In this embodiment, after the unconfigured device is connected to the router, the router can assign a second address to the unconfigured device, or the unconfigured device sends the second address it carries to the router, and the router sends the second address to the configured device, or other devices connected to the router, so that the configured device or other devices can send messages to the unconfigured device through the router according to the second address.

[0070] In one possible implementation, when there are multiple network-configured devices and the multiple network-configured devices include a communication fault device, determine the first target router to which the communication fault device is connected; control the device with normal communication to connect to the first target router according to the network configuration information of the communication fault device, and control the communication connection of the devices in the target network through the first target router, the third address of the communication fault device and the fourth address of the communication normal device.

[0071] In this embodiment, when there are multiple network-configured devices, it is determined whether the communication fault device is a network-configured device. When the judgment result is yes, the router currently connected to the communication fault device is determined to be the first target router, and other communication normal devices or other communication normal devices that are not network-configured are controlled to connect to the first target router according to the pre-stored network configuration information, so as to realize the communication connection between all devices through the first target router. The third address of the communication fault device currently in the first target router can be sent to other devices connected to the first target router, so that all devices can communicate with the communication fault device through the third address. At the same time, the first target router can forward the received fourth address of the communication normal device and send it to the communication fault device for storage, so that the communication fault device can communicate with the communication normal device through the first target router according to the fourth address. Among them, any communication normal device can receive the message of the communication fault device after connecting to the first target router and forward it to other devices through the target network, that is, as long as the communication connection between the communication fault device and any communication normal device is established through the first target router, the communication normal device can realize the communication connection of all devices through the target network and the first target router.

[0072] In one possible implementation, when there are multiple networked devices and the multiple networked devices do not include a communication fault device, the communication fault device is controlled to obtain the router signal strength of each networked device; the target networked device with the largest router signal strength is determined, and the second target router of the target networked device is determined; the communication fault device is controlled to connect to the second target router according to the network configuration information of the target networked device, and the communication connection of the devices in the target network is controlled through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

[0073] In this embodiment, when there are multiple network-configured devices, it is determined whether the communication fault device is a network-configured device. When the determination result is no, the communication fault device needs to connect to the router of the network-configured device. At this time, the router signal strength of all routers that can be searched is obtained, and the device with the largest router signal strength is determined to be the target network-configured device of the router to be connected. The router of the target network-configured device is determined to be the second target router, and the communication fault device is controlled to connect to the second target router through the pre-stored network configuration information. After the connection is successful, the second target router can allocate a third address to the communication fault device, or the communication fault device sends its own third address to the second target router, so that it sends the third address to the target network-configured device, so that the target network-configured device can send a message to the communication fault device through the second target router according to the third address, and at the same time, the second target router sends the fifth address of the target network-configured device to the communication fault device, so that the communication fault device can send a message to the target network-configured device through the second target router according to the fifth address. At the same time, the target network-configured device can forward the message of the communication fault device to other devices through the target network, thereby realizing the communication connection between all devices.

[0074] S24. When there is no network-connected device, control the device with communication failure to turn on the hotspot, and control the device with normal communication to extract the hotspot name from the device information of the communication failure; control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot; when the verification information is successfully verified, control the device with communication failure and the device with normal communication to establish a communication connection according to the hotspot.

[0075] In this embodiment, when there is no network-configured device in the target network, the communication fault device is controlled to open the hotspot. If there is only one hotspot at this time, the communication normal device can directly connect to the hotspot to achieve temporary communication between devices. Among them, only one communication normal device can be controlled to connect to the hotspot. When the communication normal device receives a message sent by the communication fault device, the message can be forwarded to other devices through the target network, thereby reducing the number of hotspot connections and reducing processing pressure. Each communication normal device can also be controlled to communicate with the communication fault device through the hotspot, so that each communication normal device can receive the message of the communication fault device in time.

[0076] When multiple hotspots are included, each device with normal communication can search for the device information of the device with communication failure from the stored device information, extract the hotspot name from it, and search for the hotspot of the device with communication failure by the hotspot name to connect.

[0077] Furthermore, after successfully connecting to the hotspot, the device with normal communication first sends a verification message to the device with communication failure. The verification information may include but is not limited to the device's identity authentication, verification code or key parameters of the communication between the two parties to ensure the connection security between the devices and the accurate transmission of data. After receiving the verification information, the device with communication failure verifies it. The verification process includes confirming the identity and device status of the device with normal communication. If the verification information is successfully verified, the device with communication failure will send a verification confirmation message to the device with normal communication. When the verification confirmation message is received by the device with normal communication, the communication connection between the two devices is formally established through the hotspot. At this time, the device with normal communication and the device with communication failure can exchange data and synchronize status through the temporary communication path.

[0078] S25, generating fault information according to the communication fault device; sending the fault information to each device in the target network for display; when the communication fault device has not recovered to a normal state after a second time interval, controlling the communication fault device to disconnect from the target network.

[0079] In this embodiment, after the communication connection is established, fault information containing relevant information of the communication fault device is generated, which may include but is not limited to: the name and unique identifier of the communication fault device, the time when the fault occurs, the type of fault (such as communication interruption, network timeout, etc.), the possible cause of the fault (such as insufficient signal coverage, network interruption, hardware failure, etc.), etc. The system sends the generated fault information to all communication normal devices in the target network through the established communication connection. Each device that receives the fault information can use it for display to prompt the user that there is a communication fault device in the current network. The second time length is used to wait for the communication fault device to automatically recover. If the communication fault device successfully restores the connection with the target network after the second time length, the fault information is updated to all devices to notify other devices that the fault has been resolved and the device has resumed normal operation. If the communication fault device still does not restore normal connection after the second time length ends, the status of the communication fault device is detected again to confirm that it cannot restore communication, and the communication fault device is controlled to disconnect from the target network (for example, forcibly log off the device, clear the network information of the device or mark it as an unavailable device, etc.) to prevent the faulty device from affecting other normal operating devices. At the same time, after the communication fault device is disconnected from the target network, it sends updated fault information to other devices in the network again, prompting that the device has been forcibly disconnected. Other devices can adjust their own linkage operations or notify users to deal with the problem based on this information.

[0080] As an example, Figure 5The figure is a flow chart of another device control method provided by an embodiment of the present invention, wherein the target network is a 485 network, and the device is a thermostat. After each thermostat is powered on, communication can be performed through the 485 network. Each thermostat synchronizes device information such as device identification and hotspot information with each other for storage. When any thermostat is successfully networked or the network configuration information changes, the network configuration information is synchronized to other thermostats through the 485 network, and each thermostat can obtain the network configuration information of the currently networked device.

[0081] When a thermostat fails, due to the thermostat address roll call in the 485 network, by continuously checking the data in the 485 network, the lack of data of a certain thermostat can determine that the specific thermostat is offline, that is, the communication failure device. At the same time, the offline thermostat itself can also confirm that it is offline through this method. When there is a networked thermostat, the unnetworked thermostat connects to the same route as the networked thermostat through the routing information obtained when the communication is normal, and communicates with the networked thermostat according to the address previously obtained in the 485 network. At this time, the broadcast (group control) control of the thermostat command can be realized. When the unnetworked thermostat communicates successfully, the thermostat will announce its own address to the networked thermostat. At this time, the addresses of the networked thermostat and the unnetworked thermostat are both known, which can achieve data synchronization between thermostats.

[0082] If there is no networked thermostat, temporary communication needs to be achieved by opening a hotspot through the WiFi network. When a thermostat is detected to be disconnected or faulty on the 485 network, the disconnected thermostat opens a hotspot, and the thermostat in normal communication searches for the module hotspot name backed up during normal communication. When the corresponding hotspot is found, it first tries to connect. If the connection is successful, it checks whether the thermostat information is a disconnected thermostat. If it is confirmed to be a disconnected thermostat, a temporary communication network is successfully established.

[0083] If there are multiple thermostats that have been networked, the route connected to the lost thermostat will also be the main route. The thermostats that are normally networked and have not established networked relationships will be connected to the route connected to the lost thermostat, and communication will be carried out after the connection is successful. When the temporary communication network is successfully established, the user will be prompted on the thermostat that a communication failure has occurred. This is temporary communication, and the thermostat number of the lost thermostat will be displayed. Remind the user that the current working status of the thermostat is not normal and needs to be repaired in time. After the establishment of the temporary communication network, the thermostat starts timing. When the thermostat runs for more than 72 hours and the fault still exists, the backup network communication will be stopped at this time, and the original thermostat that has not been networked will be disconnected from the route or hotspot connected to achieve temporary communication. The maximum time for temporary communication has been reached in the thermostat, and the 485 network needs to be maintained in time.

[0084] The control method of the device provided in the embodiment of the present invention can realize the communication connection of the device by adopting different communication modes when there is a communication fault device in the target network, according to whether there is a network-configured device at present, and whether there are multiple network-configured devices, including the communication fault device. When a communication fault device appears in the target network, the original communication function can still be kept in normal use for a period of time, thereby realizing temporary communication. When there is a network-configured device, the communication connection is realized through the router of the network-configured device. When there is no network-configured device, the communication fault device opens a hotspot to realize the communication connection with other devices, and ensures safe communication through a verification mechanism. When the faulty device does not recover to the normal state for a long time, the system generates fault information and broadcasts it to all devices for display, prompting the user of the fault situation. At the same time, the system automatically disconnects the faulty device that cannot be restored after a predetermined time interval to avoid affecting the normal operation of other devices. It can effectively improve the stability, automation and system reliability of communication between devices, reduce user intervention and optimize network resource management.

[0085] Figure 3 A schematic diagram of a control device for a device provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the device specifically includes:

[0086] A judgment module 31 is used to judge whether there is a network-configured device in the target network when a communication fault device is detected in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other;

[0087] A determination module 32, configured to determine a control strategy for the device in the target network according to the determination result;

[0088] The control module 33 is used to control the communication mode of the device in the target network according to the control strategy.

[0089] In a possible implementation, the determination module is specifically used to, when the judgment result is that there is a network-configured device, determine that the control strategy is: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device;

[0090] When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

[0091] In a possible implementation manner, the determining module is specifically configured to control each device in the target network to send device information to other devices at intervals of a first duration;

[0092] When more than a preset number of devices do not receive the device information of the first device, determining that there is a communication fault device, and determining that the first device is the communication fault device;

[0093] Or, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be the communication fault device.

[0094] In a possible implementation manner, the control module is specifically configured to control the network-configured device to send network configuration information to the unconfigured device when the network-configured device is connected to the router;

[0095] Controlling the unconfigured network device to connect to the router through the network configuration information;

[0096] Control the unconfigured device to extract the first address from the device information of the configured device, so as to communicate with the configured device through the first address;

[0097] The unconfigured network device is controlled to send the second address to the router, so that the router sends the second address to the configured network device, so that the configured network device is communicatively connected with the unconfigured network device through the second address.

[0098] In a possible implementation manner, the control module is specifically used to control the device with normal communication to extract the hotspot name from the device information with communication failure;

[0099] Control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot;

[0100] When the verification is successful through the verification information, the communication fault device and the communication normal device are controlled to establish a communication connection according to the hotspot.

[0101] In a possible implementation manner, the determination module is further configured to, when there are multiple network-configured devices and the multiple network-configured devices include a communication fault device, determine a first target router to which the communication fault device is connected;

[0102] The control module is also used to control the device with normal communication to connect to the first target router according to the network configuration information of the device with communication failure, and to control the communication connection of the devices in the target network through the first target router, the third address of the device with communication failure and the fourth address of the device with normal communication.

[0103] In a possible implementation manner, the control module is further configured to, when there are multiple network-configured devices and the multiple network-configured devices do not include a communication fault device, control the communication fault device to obtain the router signal strength of each network-configured device;

[0104] The determination module is further used to determine a target network-configured device with the largest router signal strength, and to determine a second target router for the target network-configured device;

[0105] The control module is also used to control the communication fault device to connect to the second target router according to the network configuration information of the target networked device, and to control the device communication connection in the target network through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

[0106] The device provided in this embodiment can be as follows Figure 3 The device shown in FIG. 1 may perform the following steps: Figure 1-2 All steps of the control method of the device in the Figure 1-2 For details on the technical effects of the control method of the device shown, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.

[0107] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention, Figure 4 The computer device 400 shown includes: at least one processor 401, a memory 402, at least one network interface 404 and other user interfaces 403. The various components in the computer device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 405 is not shown in FIG. Figure 4 Various buses are labeled as bus system 405 .

[0108] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0109] It can be understood that the memory 402 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0110] In some implementations, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and application programs 4022 .

[0111] The operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 4022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 4022.

[0112] In the embodiment of the present invention, by calling the program or instruction stored in the memory 402, specifically, the program or instruction stored in the application 4022, the processor 401 is used to execute the method steps provided by each method embodiment, for example, including:

[0113] When a communication fault device is detected in the target network, determining whether there is a network-configured device in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other;

[0114] Determine a control strategy for the device in the target network according to the judgment result;

[0115] The communication mode of the device in the target network is controlled according to the control strategy.

[0116] In a possible implementation, when the judgment result is that there is a network-configured device, the control strategy is determined as: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device;

[0117] When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

[0118] In a possible implementation, at intervals of a first time length, each device in the target network is controlled to send device information to other devices;

[0119] When more than a preset number of devices do not receive the device information of the first device, determining that there is a communication fault device, and determining that the first device is the communication fault device;

[0120] Or, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be the communication fault device.

[0121] In a possible implementation, when the network-configured device is connected to the router, the network-configured device is controlled to send network configuration information to the unconfigured device;

[0122] Controlling the unconfigured network device to connect to the router through the network configuration information;

[0123] Control the unconfigured device to extract the first address from the device information of the configured device, so as to communicate with the configured device through the first address;

[0124] The unconfigured network device is controlled to send the second address to the router, so that the router sends the second address to the configured network device, so that the configured network device is communicatively connected with the unconfigured network device through the second address.

[0125] In a possible implementation, controlling the device with normal communication to extract a hotspot name from the device information with communication failure;

[0126] Control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot;

[0127] When the verification is successful through the verification information, the communication fault device and the communication normal device are controlled to establish a communication connection according to the hotspot.

[0128] In a possible implementation manner, when there are multiple network-configured devices and the multiple network-configured devices include a communication fault device, determining a first target router to which the communication fault device is connected;

[0129] Control the normal communication device to connect to the first target router according to the network configuration information of the communication faulty device, and control the communication connection of devices in the target network through the first target router, the third address of the communication faulty device and the fourth address of the normal communication device.

[0130] In a possible implementation, when there are multiple network-configured devices and the multiple network-configured devices do not include a communication fault device, controlling the communication fault device to obtain a router signal strength of each network-configured device;

[0131] Determine a target network-configured device with the largest router signal strength, and determine a second target router for the target network-configured device;

[0132] Control the communication fault device to connect to the second target router according to the network configuration information of the target networked device, and control the device communication connection in the target network through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

[0133] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware.

[0134] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0135] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0136] The computer device provided in this embodiment may be as follows Figure 4 The computer device shown in , can execute Figure 1-2 All steps of the control method of the device in the Figure 1-2 For details on the technical effects of the control method of the device shown, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.

[0137] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0138] When one or more programs in the storage medium can be executed by one or more processors, the control method of the device executed on the device side can be implemented.

[0139] The processor is used to execute the control program of the device stored in the memory to implement the following steps of the device control method executed on the device side:

[0140] When a communication fault device is detected in the target network, determining whether there is a network-configured device in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other;

[0141] Determine a control strategy for the device in the target network according to the judgment result;

[0142] The communication mode of the device in the target network is controlled according to the control strategy.

[0143] In a possible implementation, when the judgment result is that there is a network-configured device, the control strategy is determined as: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device;

[0144] When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

[0145] In a possible implementation, at intervals of a first time length, each device in the target network is controlled to send device information to other devices;

[0146] When more than a preset number of devices do not receive the device information of the first device, determining that there is a communication fault device, and determining that the first device is the communication fault device;

[0147] Or, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be the communication fault device.

[0148] In a possible implementation, when the network-configured device is connected to the router, the network-configured device is controlled to send network configuration information to the unconfigured device;

[0149] Controlling the unconfigured network device to connect to the router through the network configuration information;

[0150] Control the unconfigured device to extract the first address from the device information of the configured device, so as to communicate with the configured device through the first address;

[0151] The unconfigured network device is controlled to send the second address to the router, so that the router sends the second address to the configured network device, so that the configured network device is communicatively connected with the unconfigured network device through the second address.

[0152] In a possible implementation, controlling the device with normal communication to extract a hotspot name from the device information with communication failure;

[0153] Control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot;

[0154] When the verification is successful through the verification information, the communication fault device and the communication normal device are controlled to establish a communication connection according to the hotspot.

[0155] In a possible implementation manner, when there are multiple network-configured devices and the multiple network-configured devices include a communication fault device, determining a first target router to which the communication fault device is connected;

[0156] Control the normal communication device to connect to the first target router according to the network configuration information of the communication faulty device, and control the communication connection of devices in the target network through the first target router, the third address of the communication faulty device and the fourth address of the normal communication device.

[0157] In a possible implementation, when there are multiple network-configured devices and the multiple network-configured devices do not include a communication fault device, controlling the communication fault device to obtain a router signal strength of each network-configured device;

[0158] Determine a target network-configured device with the largest router signal strength, and determine a second target router for the target network-configured device;

[0159] Control the communication fault device to connect to the second target router according to the network configuration information of the target networked device, and control the device communication connection in the target network through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

[0160] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0161] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0162] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for controlling a device, characterized in that: include: When a communication fault device is detected in the target network, determining whether there is a network-configured device in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other; Determine a control strategy for the device in the target network according to the judgment result; The communication mode of the device in the target network is controlled according to the control strategy.

2. The method according to claim 1, characterized in that Determining the control strategy of the device in the target network according to the judgment result includes: When the judgment result is that there is a network-configured device, determining the control strategy is: controlling the unconfigured device to connect to the router of the network-configured device, so as to control the communication connection of the device in the target network through the router, the first address of the network-configured device and the second address of the unconfigured device; When the judgment result is that there is no network-configured device, the control strategy is determined as: controlling the communication fault device to turn on the hotspot, and controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot.

3. The method according to claim 2, characterized in that The communication fault device is determined by: At intervals of a first time length, controlling each device in the target network to send device information to other devices; When more than a preset number of devices do not receive the device information of the first device, determining that there is a communication fault device, and determining that the first device is the communication fault device; Or, when the second device does not receive the device information sent by any other device, it is determined that there is a communication fault device, and the second device is determined to be the communication fault device.

4. The method according to claim 3, characterized in that The controlling the connection between the unconfigured device and the router of the configured device, so as to control the communication connection of the device in the target network through the router, the first address of the configured device and the second address of the unconfigured device, includes: When the network-configured device is connected to the router, controlling the network-configured device to send network configuration information to the unconfigured device; Controlling the unconfigured network device to connect to the router through the network configuration information; Control the unconfigured device to extract the first address from the device information of the configured device, so as to communicate with the configured device through the first address; The unconfigured network device is controlled to send the second address to the router, so that the router sends the second address to the configured network device, so that the configured network device is communicatively connected with the unconfigured network device through the second address.

5. The method according to claim 3, characterized in that: The controlling the communication normal device in the target network to communicate with the communication fault device through the hotspot comprises: Control the device with normal communication to extract the hotspot name from the device information with communication failure; Control the device with normal communication to connect to the hotspot according to the hotspot name, so as to send verification information to the device with communication failure through the hotspot; When the verification is successful through the verification information, the communication fault device and the communication normal device are controlled to establish a communication connection according to the hotspot.

6. The method according to claim 2, characterized in that The method further comprises: When there are multiple network-configured devices, and the multiple network-configured devices include a communication fault device, determining a first target router to which the communication fault device is connected; Control the normal communication device to connect to the first target router according to the network configuration information of the communication faulty device, and control the communication connection of devices in the target network through the first target router, the third address of the communication faulty device and the fourth address of the normal communication device.

7. The method according to claim 2, characterized in that The method further comprises: When there are multiple network-configured devices, and the multiple network-configured devices do not include a communication fault device, controlling the communication fault device to obtain the router signal strength of each network-configured device; Determine a target network-configured device with the largest router signal strength, and determine a second target router for the target network-configured device; Control the communication fault device to connect to the second target router according to the network configuration information of the target networked device, and control the device communication connection in the target network through the second target router, the third address of the communication fault device and the fifth address of the target networked device.

8. A control device for an equipment, characterized in that: include: A judgment module, used for judging whether there is a network-configured device in the target network when a communication fault device is detected in the target network, wherein the target network includes a plurality of devices that are in communication connection with each other; A determination module, used to determine a control strategy for the device in the target network according to the determination result; A control module is used to control the communication mode of the device in the target network according to the control strategy.

9. A computer device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a control program of the device stored in the memory to implement the control method of the device according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the control method of the device in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Communication fault detection method and system based on two-way forwarding detection protocol

    CN101697626A

  • Communication connection method and related equipment

    CN112203252A

  • Fault detection method and electronic terminal

    CN114371963A

  • Information updating method and device, storage medium and electronic device

    CN115842769A