Control method and device of equipment, computer device and storage medium

By detecting the presence of network-connected devices in the target network and using router or hotspot strategies to achieve stable communication connections between thermostats, the system instability caused by 485 communication network failures is resolved, ensuring information transmission between devices and system reliability.

CN119148545BActive Publication Date: 2026-01-20GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing temperature controller cannot maintain linkage when the 485 communication network fails, resulting in system instability or failure, and cannot cope with the situation where a device in the communication network fails.

Method used

By detecting whether there are network-configured devices in the target network, a control strategy is determined based on the judgment result. The communication connection between devices is realized by using the router of the network-configured device or the hotspot of the communication failure device, including the connection between the unconfigured device and the router of the network-configured device or the hotspot connection between the communication normal device and the communication failure device, so as to ensure information transmission.

Benefits of technology

In the event of a communication failure, it ensures the transmission of information between devices, prevents system loss of control, and achieves stable communication connections between devices in the 485 communication network, thereby improving the reliability and automation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148545B_ABST
    Figure CN119148545B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a kind of device control method, device, computer equipment and storage medium, by when detecting that there is communication failure equipment in target network, judge whether there is already networked device in the target network, the target network includes multiple mutually communicated connection equipment;According to the control strategy of determining the equipment in the target network according to the judgment result;According to the control strategy, the communication mode of the equipment in the target network is controlled. Therefore, when there is communication failure equipment in target network, according to whether there is already networked device in current target network to determine the corresponding control strategy, to control the communication mode of equipment by control strategy, it is realized that communication network can still be normal communication connection when certain equipment appears communication failure, guarantee the information transmission between each equipment, avoid the out of control of system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] The temperature controller is a device for directly controlling the driving of the load, and is widely used in systems such as air conditioners that require temperature adjustment. At present, the temperature controller on the market is usually in the mode of a single device corresponding to a single air conditioner. When multiple temperature controllers need to be linked, network communication of the devices such as 485 communication network is usually used for synchronous control to ensure that the states of the temperature controllers remain consistent. However, in actual application, once the 485 communication network fails or is disconnected, the communication between the temperature controllers will be interrupted, and the original linkage function cannot be continued. In this case, the temperature controllers cannot synchronize their states, which may cause the system to run unstably or fail.

[0003] The prior art cannot cope with the situation of failure of a device in the communication network. When the device communication fails, the temperature controllers in the system cannot continue to operate in linkage, and therefore, how to ensure the communication connection between the devices when a device in the 485 communication network fails has become a problem to be solved. SUMMARY

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

[0005] In a first aspect, embodiments of the present application provide a device control method, comprising:

[0006] When a communication failure device is detected in a target network, it is determined whether there is a networked device in the target network, the target network comprising a plurality of devices connected to each other in communication;

[0007] A control strategy for the devices in the target network is determined according to the determination result;

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

[0009] In one possible implementation, the control strategy for the devices in the target network is determined according to the determination result, comprising:

[0010] When the determination result is that there is a networked device, the control strategy is determined to control the connection of a non-networked device to a router of the networked device, so as to control the communication connection of the devices in the target network through the router, a first address of the networked device and a second address of the non-networked device;

[0011] When the determination result is that there is no already configured network device, the control strategy is determined as: controlling the communication failure device to start a hotspot, and controlling the communication normal device in the target network to be connected with the communication failure device through the hotspot.

[0012] In one possible implementation, the communication failure device is determined by:

[0013] Every interval of a first duration, 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 a first device, it is determined that there is a communication failure device, and the first device is determined as the communication failure device;

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

[0016] In one possible implementation, the control of the unconfigured network device to be connected with the router of the already configured network device to control the device communication connection in the target network through the router, the first address of the already configured network device and the second address of the unconfigured network device includes:

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

[0018] Controlling the unconfigured network device to be connected with the router through the configuration information;

[0019] Controlling the unconfigured network device to extract the first address from the device information of the already configured network device to be connected with the already configured network device through the first address;

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

[0021] In one possible implementation, the control of the communication normal device in the target network to be connected with the communication failure device through the hotspot includes:

[0022] Controlling the communication normal device to extract the hotspot name from the device information of the communication failure device;

[0023] Controlling the communication normal device to be connected with the hotspot according to the hotspot name, so as to send verification information to the communication failure device through the hotspot.

[0024] When the verification succeeds through the verification information, the communication failure device and the communication normal device are controlled to establish a communication connection according to the hot spot.

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

[0026] When the network-configured devices are multiple, and the multiple network-configured devices include the communication failure device, a first target router connected by the communication failure device is determined;

[0027] The communication normal device is controlled to connect the first target router according to the network configuration information of the communication failure device, and the devices in the target network are controlled to communicate through the first target router, a third address of the communication failure device and a fourth address of the communication normal device.

[0028] In one possible implementation, when the network-configured devices are multiple, and the multiple network-configured devices do not include the communication failure device, the communication failure device is controlled to acquire a router signal strength of each network-configured device;

[0029] A target network-configured device with the maximum router signal strength is determined, and a second target router of the target network-configured device is determined;

[0030] The communication failure device is controlled to connect the second target router according to the network configuration information of the target network-configured device, and the devices in the target network are controlled to communicate through the second target router, a third address of the communication failure device and a fifth address of the target network-configured device.

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

[0032] A judging module is configured to, when detecting that there is a communication failure device in a target network, judge whether there is a network-configured device in the target network, the target network including multiple devices connected in communication with each other;

[0033] A determining module is configured to determine a control strategy of the devices in the target network according to a judgment result;

[0034] A control module is configured to control a communication mode of the devices in the target network according to the control strategy.

[0035] In a third aspect, an embodiment of the present application provides a computer device, including a processor and a memory, the processor being configured to execute a device control program stored in the memory, so as to implement the device control method of any one of the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a storage medium, which stores one or more programs, and the one or more programs are executable by one or more processors to implement the control method of the device according to any one of the first aspect.

[0037] The control scheme of the device provided by the embodiment of the present application can determine the control strategy of the device in the target network according to whether there is a network configuration device in the target network when detecting that there is a communication failure device in the target network, the target network comprising a plurality of devices connected in communication with each other; and control the communication mode of the device in the target network according to the control strategy. Thus, 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 configuration device in the current target network, so as to control the communication mode of the device through the control strategy, thereby realizing that the communication network can still be normally connected when a certain device has a communication failure, ensuring the information transmission between devices, and avoiding the out-of-control of the system. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 A flowchart of a control method of a device provided by the embodiment of the present application is shown in the figure;

[0039] Figure 2 A flowchart of another control method of a device provided by the embodiment of the present application is shown in the figure;

[0040] Figure 3 A structure diagram of a control device of a device provided by the embodiment of the present application is shown in the figure;

[0041] Figure 4 A structure diagram of a computer device provided by the embodiment of the present application is shown in the figure;

[0042] Figure 5 A flowchart of another control method of a device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0043] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0044] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0045] Figure 1 A flowchart of a control method of a device provided by an embodiment of the present application is shown in Figure 1 The method specifically includes the following steps.

[0046] S11, when a communication failure device is detected in a target network, determining whether there is a networked device in the target network, the target network including a plurality of devices connected to each other for communication.

[0047] The control method of the device provided by the embodiment of the present application is applied to a computer device, which can include but is not limited to a server, a desktop computer, a controller (for example, a programmable logic controller PLC), a central system, etc. The target network can be a communication network established based on the RS-485 standard, and the target network includes a plurality of devices that can be connected to each other for communication. The computer device can issue a control instruction 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 mode is determined according to whether there is a networked device in the current target network, so as to perform communication connection through the communication connection mode.

[0048] In this embodiment, the device can include but is not limited to a temperature control device (for example, a temperature controller, a thermostat, a temperature and humidity controller, etc.) that can be connected in the target network. Each device in the target network can transmit control instructions, device information, network configuration information, etc. to each other to realize linkage and message synchronization of all devices. When a device has a communication failure, the device cannot receive information transmitted by other devices, nor can it transmit information to other devices. Therefore, the way to determine whether there is a communication failure device currently can include that every interval of a preset time period, each device is controlled to transmit its own device information and network configuration information (only the networked device needs to transmit) to other devices. When a device cannot transmit or receive device information to or from other devices in a certain round of information transmission, it is determined that the device is a communication failure device. Alternatively, an RS-485 communication protocol analyzer or a serial port debugging tool can be used to monitor the data transmission of the devices in the network. By checking the reception and transmission of data packets, devices that do not respond or have incomplete data can be identified. If it is found that a device does not respond or data is lost, it is possible that the device has a communication failure. Error frames can be captured to check whether there is a CRC error, a check failure, etc. If so, it is determined that the device is a communication failure device. Alternatively, in the target network, the computer device can act as a master device, which usually communicates with a plurality of devices through polling. The polling request sent by the master device can be monitored by software, and it can be checked whether each device responds normally. If a device fails to return data or the response times out in polling, it is determined to be a communication failure device.

[0049] S12, determining a control strategy of the device in the target network according to the determination result.

[0050] S13, controlling a communication mode of the device in the target network according to the control strategy.

[0051] In the embodiment, the steps S12 and S13 are described uniformly. When the result of the judgment is that there is the network-configured device, it is determined that the control strategy is to control the non-network-configured device to connect with 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 non-network-configured device.

[0052] Specifically, when the network configuration of any device is completed, the network configuration information is synchronously sent to each device through the target network to enable each device to store the network configuration information. The network configuration information can include the first address of the network-configured device and the information of the connected router. When the communication failure device occurs, it means that the device cannot be connected with other devices through the target network. Whether the network-configured device is the communication failure device or not, the communication connection between each device can be realized through the router. At this time, the current communication failure device can be determined by each device through the method of step S11. The non-network-configured device is controlled to determine the network configuration information of the network-configured device from the pre-stored network configuration information, and the network configuration is performed based on the network configuration information. The router connected with the network-configured device can be connected, and the non-network-configured device can be connected with the network-configured device through the router according to the pre-stored first address. The router can allocate a network address as a second address for the non-network-configured device. The non-network-configured device and the network-configured device can obtain and store the allocated second address, and the network-configured device can be connected with the non-network-configured device through the router according to the second address. 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 non-network-configured devices.

[0053] For example, when the communication failure device is the non-network-configured device, the communication failure device is controlled to connect with the same router as the network-configured device. When there is a group control instruction or information that needs to be synchronized, the communication failure device can receive the information or control instruction forwarded by the network-configured device, and other communication normal devices can also communicate in the target network. When the communication failure device is the network-configured device, any communication normal device in the other devices is controlled to connect with the same router as the communication failure device. When there is a group control instruction or information that needs to be synchronized, the communication failure device can receive the information or control instruction forwarded by the communication normal device through the router, and other communication normal devices can also communicate in the target network. Alternatively, all the other devices are controlled to connect with the same router as the communication failure device, and the sending of messages and control instructions is realized through the router. In this way, all the devices in the target network can realize the communication connection with each other.

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

[0055] Specifically, when there is no network-configured device in the target network, the communication-faulty device automatically opens the wireless hotspot function, at this time, the communication-faulty device generates a temporary wireless hotspot signal, so that other communication-normal devices in the target network can discover and connect to the hotspot.

[0056] Specifically, the device information synchronized by the devices in the target network every interval of the preset time length contains the hotspot name of each device, that is, each device will pre-store the hotspot name of other devices, the communication-normal device in the target network is controlled to scan the available network nearby, and after discovering the hotspot name opened by the communication-faulty device, the communication-normal device is controlled to automatically connect to the hotspot to establish a temporary communication channel with the communication-faulty device.

[0057] Data interaction and state synchronization can be performed through the hotspot of the communication-faulty device. Even if the communication-faulty device cannot access the target network, other devices can still perform linkage control through the temporary communication mode.

[0058] In one possible implementation, the connection state of the communication-faulty device can be continuously monitored, when the fault device re-recovers normal communication with the router or the target network, the hotspot function of the device can be controlled to be closed, and the normal network communication path is restored. 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, realizing seamless communication.

[0059] The device control method provided by the embodiment of the application can determine the control strategy according to whether there is a network-configured device in the target network when it is detected that there is a communication-faulty device in the target network, the target network contains a plurality of devices that are communicatively connected with each other, control the communication mode of the devices in the target network according to the control strategy. Therefore, when there is a communication-faulty 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, the communication mode of the device is controlled through the control strategy, the communication network can still normally communicate and connect when a certain device appears communication fault, the information transmission between devices is ensured, and the out-of-control of the system is avoided.

[0060] Figure 2 Another flowchart of the device control method provided by the embodiment of the application is shown in FIG. 2, and the method specifically includes the following steps. Figure 2

[0061] ​S21, every interval of a first time length, control 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 a first device, determine that there is a communication failure device, and determine that the first device is the communication failure device.

[0062] In this embodiment, every interval of a preset first time length, each device in the target network sends the current device information of the device to all other devices once, to realize timely device information synchronization. The device information can include but is not limited to: device identification, communication address, device self-bar code information, device hotspot name, etc. When each device receives the device information sent by other devices, all device information is stored for subsequent communication.

[0063] After sending the device information once, when 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 the message that the first device is a communication failure device.

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

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

[0066] In this embodiment, after the device in the target network is connected to the router for network configuration and is completed, the networked device sends its own network configuration information to each other device, so that each device stores the network configuration information of the networked device. The network configuration information is used for connecting the router for network configuration, and can include but is not limited to: router name, password, address, etc.

[0067] Further, when it is determined that the communication failure device exists and the currently existing device has been configured, it is not necessary to determine whether the communication failure device is the configured device, and the unconfigured device can be controlled to connect to the router of the configured device according to the configuration information, so that all devices are connected to the same router and are connected through the router, and the unconfigured device can determine the device information of the configured device from the stored device information, extract the first address of the configured device, and send a message to the configured device through the router according to the first address. The configured device can also forward the received message to other devices, so that all devices in the target network are connected.

[0068] S23, control 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 connected to the unconfigured device through the second address.

[0069] In this embodiment, after the unconfigured device is connected to the router, the router can allocate a second address to the unconfigured device, or the unconfigured device sends the second address carried by itself 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 a message to the unconfigured device through the router according to the second address.

[0070] In one possible implementation, when the configured device is multiple and the multiple configured devices include the communication failure device, the first target router connected by the communication failure device is determined; the communication normal device is controlled to connect to the first target router according to the configuration information of the communication failure device, and the devices in the target network are controlled to be connected through the first target router, the third address of the communication failure device and the fourth address of the communication normal device.

[0071] In the embodiment, when there are multiple network-configured devices, it is judged whether the communication failure device is a network-configured device, and when the result of the judgment is yes, it is determined that the router currently connected by the communication failure device is the first target router, and other communication normal devices or other non-network-configured communication normal devices are controlled to connect the first target router according to the pre-stored network configuration information, so as to realize the communication connection among all devices through the first target router. The third address of the communication failure device 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 failure device through the third address. Meanwhile, the first target router can forward the fourth address of the received communication normal device and send it to the communication failure device for storage, so that the communication failure device can communicate with the communication normal device according to the fourth address through the first target router. Any communication normal device connected to the first target router can receive the message of the communication failure device and forward it to other devices through the target network, that is, as long as the communication connection between the communication failure 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 the network-configured devices are multiple and the communication failure device is not included in the multiple network-configured devices, the communication failure device is controlled to acquire the router signal strength of each network-configured device; a target network-configured device with the maximum router signal strength is determined, and a second target router of the target network-configured device is determined; the communication failure device is controlled to connect the second target router according to the network configuration information of the target network-configured device, and the devices in the target network are controlled to communicate through the third address of the communication failure device and the fifth address of the target network-configured device through the second target router.

[0073] In the embodiment, when there are multiple network-configured devices, it is determined whether the communication failure device is a network-configured device. When the determination result is no, the communication failure device needs to connect the router of the network-configured device. At this time, the router signal strength of all routers that can be searched is obtained, the device with the maximum router signal strength is determined as the target network-configured device of the to-be-connected router, the router of the target network-configured device is determined as the second target router, the communication failure device is controlled to connect 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 failure device, or the communication failure device sends its third address to the second target router, so that the second target router sends the third address to the target network-configured device, so that the target network-configured device can send a message to the communication failure device through the second target router according to the third address, and the second target router sends a fifth address of the target network-configured device to the communication failure device, so that the communication failure 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 failure device to other devices through the target network, thereby realizing the communication connection between all devices.

[0074] S24, when there is no network-configured device, the communication failure device is controlled to start a hotspot, and the communication normal device is controlled to extract the hotspot name from the communication failure device information; the communication normal device is controlled to connect the hotspot according to the hotspot name, so as to send the verification information to the communication failure device through the hotspot; when the verification is successful through the verification information, the communication failure device and the communication normal device are controlled to establish a communication connection according to the hotspot.

[0075] In the embodiment, when there is no network-configured device in the target network, the communication failure device is controlled to start a hotspot. At this time, if there is only one hotspot, the communication normal device can directly connect the hotspot to realize temporary communication between devices. Among them, only one communication normal device can be controlled to connect the hotspot. When the communication normal device receives the message sent by the communication failure device, the message can be forwarded to other devices through the target network. Thus, the number of hotspot connections can be reduced, and the processing pressure can be reduced. Each communication normal device can also be controlled to communicate with the communication failure device through the hotspot, so that each communication normal device can timely receive the message of the communication failure device.

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

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

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

[0079] In this embodiment, when the communication connection is established, the failure information containing the related information of the communication failure device is generated, which can include, but is not limited to, the name and unique identifier of the communication failure device, the time of the failure occurrence, the type of the failure (such as communication interruption, network timeout, etc.), the possible cause of the failure (such as insufficient signal coverage, network interruption, hardware failure, etc.), etc. The system sends the generated failure information to all communication normal devices in the target network through the established communication connection. Each device receiving the failure information can use it for display to prompt the user that there is a communication failure device in the current network. The second time interval is used to wait for the automatic recovery of the communication failure device. If the communication failure device successfully recovers the connection with the target network after the second time interval, the failure information is updated to all devices to inform other devices that the failure has been resolved and the device has returned to normal work. If the communication failure device still does not recover the normal connection after the end of the second time interval, the state of the communication failure device is detected again to confirm that it cannot recover the communication, and the communication failure device is controlled to disconnect from the target network (for example, forcibly logging out the device, clearing the network information of the device or marking it as an unusable device, etc.) to prevent the failure device from affecting other normally running devices. At the same time, after the communication failure device is disconnected from the target network, the updated failure information is sent to other devices in the network again to prompt that the device has been forcibly disconnected. Other devices can adjust their linkage operations or notify the user to handle the problem according to this information.

[0080] As an example, as shown in FIG. 6, the communication failure device 601 is connected to the hotspot 602, and the communication normal device 603 is connected to the hotspot 604. The communication normal device 603 sends a verification information to the communication failure device 601. After receiving the verification information, the communication failure device 601 verifies it. If the verification information is verified successfully, the communication failure device 601 sends a verification confirmation information to the communication normal device 603. When the verification confirmation information is received by the communication normal device 603, the communication connection between the two devices is formally established through the hotspot. At this time, the communication normal device 603 and the communication failure device 601 can exchange data and synchronize the state through the temporary communication path. Figure 5Fig. 1 is a flow diagram of a control method of a device according to an embodiment of the present application, the target network is a 485 network, and the device is a temperature controller. After each temperature controller is powered on, it can communicate through the 485 network. Each temperature controller synchronizes device information such as device identification and hotspot information with each other for storage. When any temperature controller successfully configures the network or the network configuration information changes, the temperature controller synchronizes the network configuration information with other temperature controllers through the 485 network. Each temperature controller can obtain the network configuration information of the currently configured device.

[0081] When a temperature controller fails, the temperature controller address point in the 485 network is checked continuously. The absence of data of a temperature controller can determine that a specific temperature controller has been offline, i.e., a communication failure device. Meanwhile, the offline temperature controller itself can also confirm that it has been offline through the method. When there is a configured temperature controller, the unconfigured temperature controller connects the same route as the configured temperature controller through the route information obtained when the communication is normal, and communicates with the configured temperature controller according to the address obtained in the 485 network. At this time, the broadcast (group control) control of the temperature controller command can be implemented. When the unconfigured temperature controller successfully communicates, the temperature controller publishes its own address to the configured temperature controller. At this time, the addresses of the configured temperature controller and the unconfigured temperature controller are known, and the data synchronization between the temperature controllers can be achieved.

[0082] If there is no configured temperature controller, temporary communication is achieved through the way of opening a hotspot of the WiFi network. When a temperature controller is detected to be offline or to fail on the 485 network, the offline temperature controller opens a hotspot. The normally communicating temperature controller searches the backup module hotspot name when the communication is normal. When the corresponding hotspot is found, the temperature controller tries to connect first. If the connection is successful, the temperature controller information of the temperature controller is checked to determine whether it is the offline temperature controller. If it is confirmed to be the offline temperature controller, the temporary communication network is successfully established.

[0083] If there are multiple configured temperature controllers, the route connected by the offline temperature controller is the main route. The normally configured temperature controllers and the temperature controllers not in the configured relationship connect the route connected by the offline temperature controller. After the connection is successful, the communication is performed. When the temporary communication network is successfully established, the user is prompted that the current communication has failed. At this time, it is temporary communication, and the temperature controller number of the offline temperature controller is displayed. The user is reminded that the current temperature controller state is not normal and needs to be repaired in time. After the temporary communication network is established, the temperature controller starts timing. When the temperature controller runs for more than 72 hours and the failure still exists, the network communication is stopped, and the original unconfigured temperature controller is disconnected from the route or hotspot connected for temporary communication. In the temperature controller, it is displayed that the maximum time of the temporary communication has been reached, and the 485 network needs to be maintained in time.

[0084] The control method of the device provided by the embodiment of the application can realize the communication connection of the device in different communication modes according to whether there is a network configuration device at present and whether the network configuration device contains a communication failure device when the communication failure device exists in the target network. The original communication function can still be normally used for a period of time when the communication failure device exists in the target network, and temporary communication is realized. When there is a network configuration device, the communication connection is realized through the router of the network configuration device, and when there is no network configuration device, the communication connection is realized through the hot spot of the communication failure device and other devices, and the safe communication is ensured through the verification mechanism. When the failure device is not restored to the normal state for a long time, the system generates failure information and broadcasts it to all devices for display, prompting the user of the failure condition. Meanwhile, the system automatically disconnects the failure device that cannot be restored after a predetermined time interval, avoiding affecting the normal operation of other devices. The stability, automation and reliability of the system can be effectively improved, the user intervention is reduced, and the network resource management is optimized.

[0085] Figure 3 A structural schematic diagram of a device control apparatus provided by the embodiment of the application is shown in Figure 3 The apparatus specifically includes:

[0086] The judgment module 31 is used for judging whether there is a network configuration device in the target network when it is detected that there is a communication failure device in the target network, and the target network contains a plurality of devices that are communicatively connected to each other.

[0087] The determination module 32 is used for determining the control strategy of the device in the target network according to the judgment result.

[0088] The control module 33 is used for controlling 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 configured to, when the judgment result is that there is a network configuration device, determine that the control strategy is to control the network configuration device and the un-network-configuration device to be connected to the router of the network configuration device, so as to control the communication connection of the device in the target network through the router, the first address of the network configuration device and the second address of the un-network-configuration device.

[0090] When the judgment result is that there is no network configuration device, the determination module is specifically configured to determine that the control strategy is to control the communication failure device to start the hot spot and control the normal communication device in the target network to be communicatively connected to the communication failure device through the hot spot.

[0091] In a possible implementation, the determination module is specifically configured to control each device in the target network to send device information to other devices every first time length.

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

[0093] or, determining that there is a communication failure device when the second device does not receive the device information sent by any other device, and determining that the second device is the communication failure device.

[0094] In one possible implementation, the control module is specifically configured to control the already-configured device to send configuration information to the un-configured device when the already-configured device is connected to the router;

[0095] control the un-configured device to connect to the router through the configuration information;

[0096] control the un-configured device to extract the first address from the device information of the already-configured device, so as to communicate with the already-configured device through the first address;

[0097] control the un-configured device to send the second address to the router, so that the router sends the second address to the already-configured device, so that the already-configured device communicates with the un-configured device through the second address.

[0098] In one possible implementation, the control module is specifically configured to control the communication normal device to extract the hotspot name from the device information of the communication failure device;

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

[0100] control the communication failure device and the communication normal device to establish a communication connection according to the hotspot when the verification is successful through the verification information.

[0101] In one possible implementation, the determination module is further configured to determine a first target router connected by the communication failure device when there are multiple already-configured devices, and the multiple already-configured devices include the communication failure device;

[0102] the control module is further configured to control the communication normal device to connect to the first target router according to the configuration information of the communication failure device, and to control the devices in the target network to communicate through the first target router, a third address of the communication failure device, and a fourth address of the communication normal device.

[0103] In a possible implementation, the control module is further configured to control the communication failure device to acquire a router signal strength of each of the already commissioned devices when the already commissioned devices are multiple and none of the multiple already commissioned devices contains the communication failure device.

[0104] The determination module is further configured to determine a target already commissioned device with a maximum router signal strength, and determine a second target router of the target already commissioned device.

[0105] The control module is further configured to control the communication failure device to connect to the second target router according to commissioning information of the target already commissioned device, and control the devices in the target network to communicate by using the second target router, a third address of the communication failure device and a fifth address of the target already commissioned device.

[0106] The apparatus provided by the embodiment can be an apparatus as shown in Figure 3 may perform all the steps of the control method of the device as shown in Figures 1-2 , and thus achieve the technical effects of the control method of the device as shown in Figures 1-2 . For details, refer to the relevant description, which will not be repeated here for brevity. Figures 1-2

[0107] Figure 4 A structural schematic diagram of a computer device provided by the embodiment of the present application is shown in Figure 4 The computer device 400 shown in the figure 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 through a bus system 405. It can be understood that the bus system 405 is used to realize the connection and communication between the components. The bus system 405 includes not only a data bus, but also a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all the buses are marked as the bus system 405 in the figure. Figure 4

[0108] The user interface 403 can include a display, a keyboard or a clicking device (for example, a mouse, a trackball, a touchpad or a touch screen, etc.).

[0109] ​​It is to be appreciated that the memory 402 in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synch link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, without being limited to, these and any other suitable types of memory.

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

[0111] Among them, the operating system 4021 contains various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs 4022 contain various application programs, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The programs for implementing the method embodiments of the present application can be contained in the application programs 4022.

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

[0113] When a communication failure device is detected in a target network, it is determined whether a network-configured device exists in the target network, the target network comprising a plurality of devices connected to each other for communication;

[0114] A control strategy for the devices in the target network is determined according to the determination result;

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

[0116] In one possible implementation, when the determination result is that the network-configured device exists, the control strategy is determined as follows: controlling a non-network-configured device to connect to a router of the network-configured device, so as to control the devices in the target network to be connected for communication through the router, a first address of the network-configured device, and a second address of the non-network-configured device.

[0117] When the determination result is that the network-configured device does not exist, the control strategy is determined as follows: controlling the communication failure device to start a hotspot, and controlling a communication normal device in the target network to be connected for communication to the communication failure device through the hotspot.

[0118] In one possible implementation, every first time interval, 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 a first device, it is determined that the communication failure device exists, and the first device is determined to be the communication failure device.

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

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

[0122] The non-network-configured device is controlled to be connected to the router through the network configuration information;

[0123] The non-network-configured device is controlled to extract the first address from the device information of the network-configured device, so as to be connected for communication to the network-configured device through the first address;

[0124] The non-network-configured device is controlled to send the second address to the router, so that the router sends the second address to the network-configured device, so that the network-configured device is connected for communication to the non-network-configured device through the second address.

[0125] In a possible implementation, the control device extracts a hotspot name from the information of the communication failure device;

[0126] The control device connects the communication normal device to the hotspot according to the hotspot name, and sends verification information to the communication failure device through the hotspot;

[0127] When the verification is successful through the verification information, the control device establishes a communication connection between the communication failure device and the communication normal device according to the hotspot.

[0128] In a possible implementation, when the network configured devices are multiple, and the multiple network configured devices include the communication failure device, the control device determines a first target router connected by the communication failure device;

[0129] The control device connects the communication normal device to the first target router according to the network configuration information of the communication failure device, and controls the communication connection of the devices in the target network through the first target router, a third address of the communication failure device and a fourth address of the communication normal device.

[0130] In a possible implementation, when the network configured devices are multiple, and the multiple network configured devices do not include the communication failure device, the control device controls the communication failure device to acquire a router signal strength of each network configured device;

[0131] The control device determines a target network configured device with the maximum router signal strength, and determines a second target router of the target network configured device;

[0132] The control device connects the communication failure device to the second target router according to the network configuration information of the target network configured device, and controls the communication connection of the devices in the target network through the second target router, a third address of the communication failure device and a fifth address of the target network configured device.

[0133] The method disclosed by the embodiments of the present application can be applied to the processor 401 or implemented by the processor 401. The processor 401 can be an integrated circuit chip having a signal processing capability. In the implementation process, each step of the above method can be completed by an integrated logic circuit or an instruction in the form of software in the processor 401. The processor 401 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software units in the code processor for execution. The software unit can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and combines the hardware to complete the steps of the above method.

[0134] It can be understood that the embodiments described herein can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units for executing the functions described in the present application or a combination thereof.

[0135] For software implementation, the technology described herein can be implemented by units performing 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 by the embodiment can be a computer device as shown in Figure 4 The computer device provided by the embodiment can execute all steps of the control method of the device as shown in Figures 1-2 The computer device provided by the embodiment can execute all steps of the control method of the device as shown in Figures 1-2 The computer device provided by the embodiment can execute all steps of the control method of the device as shown in Figures 1-2 The computer device provided by the embodiment can execute all steps of the control method of the device as shown in

[0137] The computer device provided by the embodiment can execute all steps of the control method of the device as shown in

[0138] The computer device provided by the embodiment can execute all steps of the control method of the device as shown in

[0139] The computer device provided by the embodiment can execute all steps of the control method of the device as shown in

[0140] When the communication fault device in the target network is detected, it is determined whether there is a networked device in the target network, and the target network includes a plurality of devices connected in communication with each other.

[0141] According to the determination result, a control strategy of the devices in the target network is determined.

[0142] According to the control strategy, the communication mode of the devices in the target network is controlled.

[0143] In one possible implementation, when the determination result is that there is a networked device, the control strategy is determined as follows: controlling the non-networked device to connect with the router of the networked device, so as to control the communication connection of the devices in the target network through the router, the first address of the networked device and the second address of the non-networked device.

[0144] When the determination result is that there is no networked device, the control strategy is determined as follows: controlling the communication fault device to start a hotspot, and controlling the communication normal device in the target network to connect with the communication fault device through the hotspot.

[0145] In one possible implementation, every interval of a first time length, each device in the target network is controlled to send device information to other devices.

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

[0147] or, determining that there is a communication failure device when the second device does not receive the device information sent by any other device, and determining that the second device is the communication failure device.

[0148] In one possible implementation, when the pre-configured device connects the router, the pre-configured device is controlled to send the network configuration information to the non-pre-configured device;

[0149] The non-pre-configured device is controlled to connect to the router through the network configuration information;

[0150] The non-pre-configured device is controlled to extract the first address from the device information of the pre-configured device, so as to communicate with the pre-configured device through the first address;

[0151] The non-pre-configured device is controlled to send the second address to the router, so that the router sends the second address to the pre-configured device, so that the pre-configured device communicates with the non-pre-configured device through the second address.

[0152] In one possible implementation, the communication normal device is controlled to extract the hotspot name from the device information of the communication failure device;

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

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

[0155] In one possible implementation, when there are multiple pre-configured devices, and the multiple pre-configured devices include a communication failure device, a first target router connected by the communication failure device is determined;

[0156] The communication normal device is controlled to connect to the first target router according to the network configuration information of the communication failure device, and to control the devices in the target network to communicate through the first target router, a third address of the communication failure device, and a fourth address of the communication normal device.

[0157] In one possible implementation, when there are multiple pre-configured devices, and the multiple pre-configured devices do not include a communication failure device, the communication failure device is controlled to obtain the router signal strength of each pre-configured device;

[0158] determine a target network device with the strongest signal strength of the router, and determine a second target router of the target network device;

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

[0160] Those skilled in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

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

[0162] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for controlling a device, characterized in that, include: When a communication failure device is detected in the target network, it is determined whether there are network-configured devices in the target network, wherein the target network contains multiple devices that are interconnected. The control strategy for the devices in the target network is determined based on the judgment result; The communication methods of devices in the target network are controlled according to the control strategy. When there are multiple network-configured devices, and none of the network-configured devices include a communication failure device, the communication failure device is controlled to obtain the router signal strength of each network-configured device. Identify the target network-connected device with the strongest router signal strength, and identify the second target router for the target network-connected device; The system controls the communication failure device to connect to the second target router based on the network configuration information of the target network-configured device, and controls the communication connection of devices in the target network through the second target router, the third address of the communication failure device, and the fifth address of the target network-configured device. When there are no network-configured devices in the target network, the communication failure device is controlled to turn on a hotspot. If there is only one hotspot, only one communication normal device is controlled to connect to the hotspot. When the communication normal device receives a message sent by the communication failure device, it forwards the message to other devices through the target network. When multiple hotspots are present, each normally functioning device searches for the device information of the communication failure device in the stored device information, extracts the hotspot name from it, and searches for the hotspot of the communication failure device by the hotspot name to connect.

2. The method according to claim 1, characterized in that, The step of determining the control strategy for devices in the target network based on the judgment result includes: When the determination result indicates that there is a network-configured device, the control strategy is determined to be: control 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 determination result is that there are no network-configured devices, the control strategy is determined to be: control the communication failure device to turn on a hotspot, and control the communication normal devices in the target network to communicate with the communication failure device through the hotspot.

3. The method according to claim 2, characterized in that, The communication failure device is determined in the following way: At each first time interval, control each device in the target network to send device information to other devices; When more than a preset number of devices fail to receive device information from the first device, it is determined that there is a communication failure device, and the first device is determined to be the communication failure device. Alternatively, when the second device does not receive device information sent by any other device, it is determined that there is a communication failure device, and the second device is determined to be the communication failure device.

4. The method according to claim 3, characterized in that, The step of controlling the router connection between the unconfigured network device and the configured network device, so as to control the communication connection of devices in the target network through the router, the first address of the configured network device, and the second address of the unconfigured network device, includes: When the network-configured device connects to the router, the network-configured device is controlled to send network configuration information to the unconfigured device; Control the unconfigured device to connect to the router via the configuration information; The unconfigured device is controlled 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 device is controlled 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 can communicate with the unconfigured device through the second address.

5. The method according to claim 3, characterized in that, The control of a normally functioning communication device in the target network to communicate with a communication-faulty device via the hotspot includes: The device with normal communication is controlled to extract the hotspot name from the device information of the device with communication failure; The device with normal communication is controlled 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; Once the verification is successful, the device with the communication failure and the device with normal communication establish a communication connection based on the hotspot.

6. The method according to claim 2, characterized in that, The method further includes: When there are multiple network-configured devices, and among the multiple network-configured devices is a communication failure device, the first target router connected to the communication failure device is determined; The system controls the normally functioning device to connect to the first target router based on the network configuration information of the faulty device, and controls the communication connections of devices in the target network through the first target router, the third address of the faulty device, and the fourth address of the normally functioning device.

7. A control device for an equipment, characterized in that, include: The judgment module is used to determine whether there are network-configured devices in the target network when a communication failure device is detected in the target network, wherein the target network contains multiple devices that are interconnected. The determination module is used to determine the control strategy of the devices in the target network based on the judgment result; A control module is used to control the communication mode of devices in the target network according to the control strategy; The control module is also used to control the communication failure device to obtain the router signal strength of each network-connected device when there are multiple network-connected devices and none of the multiple network-connected devices are communication failure devices. The determining module is further configured to determine the target network-connected device with the strongest router signal strength, and to determine the second target router of the target network-connected device; The control module is also used to control the communication failure device to connect to the second target router according to the network configuration information of the target network-configured device, and to control the communication connection of devices in the target network through the second target router, the third address of the communication failure device and the fifth address of the target network-configured device; When there are no network-configured devices in the target network, the communication failure device is controlled to turn on a hotspot. If there is only one hotspot, only one communication normal device is controlled to connect to the hotspot. When the communication normal device receives a message sent by the communication failure device, it forwards the message to other devices through the target network. When multiple hotspots are present, each normally functioning device searches for the device information of the communication failure device in the stored device information, extracts the hotspot name from it, and searches for the hotspot of the communication failure device by the hotspot name to connect.

8. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a device control program stored in the memory to implement the device control method of any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the control method of the device according to any one of claims 1 to 6.

Citation Information

Patent Citations

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

    CN115842769A