Communication line switching system, communication line switching method, host equipment, slave equipment, air conditioning unit and storage medium
By adding backup communication modules and switching modules to the master and slave devices, and dynamically switching communication lines, the problem of low communication stability between the master and slave devices is solved, and the stability of the system is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GREE ELECTRIC APPLIANCE INC OF ZHUHAI
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, host devices and slave devices typically use a single communication line for data exchange, resulting in low communication stability and making the system stability susceptible to failures such as line disconnection or noise interference.
A backup communication module and a switching module are added to both the host and slave devices. The communication status is detected by the master control module and the slave control module, and the communication line is dynamically switched according to the detection results, so as to realize the dynamic switching of the communication line between the host and slave devices.
The stability of the communication lines between the host and slave devices has been improved, thereby enhancing the overall stability of the system.
Smart Images

Figure CN121907752A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial control technology, and in particular to a communication line switching system, a communication line switching method, a host device, a slave device, an air conditioning unit, and a storage medium. Background Technology
[0002] In industrial control systems, stable communication between master and slave devices is crucial for ensuring normal system operation. However, current technologies typically use a single communication line for data exchange, such as the Recommended Standard 485 (RS485), Controller Area Network (CAN), or Universal Asynchronous Receiver and Transmitter (UART). If this communication line malfunctions—such as due to a broken line, noise interference, or signal attenuation—communication between the master and slave devices will fail, impacting system stability. Therefore, improving the stability of communication between master and slave devices is a pressing technical challenge. Summary of the Invention
[0003] This application provides a communication line switching system, a communication line switching method, a host device, a slave device, an air conditioning unit, and a storage medium to solve the problem that in the prior art, the host device and the slave device usually use a single communication line for data interaction, resulting in low communication stability between the host device and the slave device.
[0004] In a first aspect, embodiments of this application provide a communication line switching system, the communication line switching system including a host device and a slave device; The host device includes a main control module, a first main communication module, a first backup communication module, and a first switching module. The first main communication module, the first backup communication module, and the first switching module are all connected to the main control module. The main control module is used to detect the communication status of the host device itself in the event of a communication failure between the host device and the slave device, and to control the first switching module according to the detection result to switch the communication lines in the host device. The slave device includes a slave control module, a second master communication module, a second backup communication module, and a second switching module. The second master communication module, the second backup communication module, and the second switching module are all connected to the slave control module. The slave control module is used to detect the communication status of the slave device itself in the event of a communication failure between the master device and the slave device, and to control the second switching module according to the detection result to switch the communication line in the slave device.
[0005] Optionally, the first switching module includes a first switching unit and a second switching unit; The first switch unit is disposed between the communication interface of the first main communication module and the host device, and the second switch unit is disposed between the communication interface of the first backup communication module and the host device. Both the first switch unit and the second switch unit are electrically connected to the main control module. The main control module is used to control the switching state of the first switch unit and the second switch unit according to the detection results, so as to switch the communication line in the host device.
[0006] Optionally, the first switching module further includes a third switching unit, a fourth switching unit, and a fifth switching unit; The third switch unit is located between the first main communication module and the first backup communication module. The main control module is connected to the first main communication module via a first data line and a second data line, and the fourth switch unit is disposed between the first data line and the second data line; The main control module is connected to the first backup communication module via a third data line and a fourth data line, and the fifth switch unit is disposed between the third data line and the fourth data line; The third, fourth, and fifth switch units are all electrically connected to the main control module. The main control module is used to control the switching states of the third, fourth, and fifth switch units in order to detect the communication status of the host device itself.
[0007] Optionally, the second switching module includes a sixth switching unit and a seventh switching unit; The sixth switch unit is disposed between the communication interface of the second main communication module and the slave device, and the seventh switch unit is disposed between the communication interface of the second backup communication module and the slave device. Both the sixth and seventh switch units are electrically connected to the slave control module. The slave control module is used to switch the switching states of the sixth and seventh switch units according to the detection results, so as to switch the communication lines in the slave device.
[0008] Optionally, the second switching module further includes an eighth switching unit, a ninth switching unit, and a tenth switching unit; The eighth switch unit is located between the second main communication module and the second backup communication module. The slave control module is connected to the second master communication module via a fifth data line and a sixth data line, and the ninth switch unit is disposed between the fifth data line and the sixth data line; The control module and the second backup communication module are connected via a seventh data line and an eighth data line, and the tenth switch unit is disposed between the seventh data line and the eighth data line; The eighth, ninth, and tenth switch units are all electrically connected to the slave control module. The slave control module is used to control the switching states of the eighth, ninth, and tenth switch units in order to detect the communication status of the slave device itself.
[0009] Secondly, embodiments of this application also provide a communication line switching method, applied to a host device in the communication line switching system described in the first aspect, the method comprising: In the event of a communication failure between the host device and the slave device, the communication status of the host device itself is detected. Based on the detection results, the first switching module is controlled to switch the communication lines in the host device.
[0010] Optionally, controlling the first switching module based on the detection result to switch the communication line in the host device includes: If the detection results indicate a fault in the first main communication module, the first switch unit is opened and the second switch unit is closed to allow communication between the first backup communication module and the slave device; or... If the detection results indicate that the first backup communication module is faulty, the first switch unit is closed and the second switch unit is opened to enable communication between the first master communication module and the slave device.
[0011] Optionally, detecting the communication status of the host device itself includes: The third switch unit is closed, while the fourth and fifth switch units are open; A preset data packet is sent to the first data line, and it is determined whether the preset data packet is received from the fourth data line to obtain a first detection result. The first detection result is used to characterize whether there is a fault in the closed loop line formed by the main control module, the first main communication module and the first backup communication module. The third switch unit is controlled to open, while the fourth and fifth switch units are closed; A preset data packet is sent to the first data line and the third data line respectively, and it is detected whether the preset data packet is received from the second data line and the fourth data line to obtain a second detection result. The second detection result is used to characterize whether there is a fault in the line between the main control module and the first main communication module, and the line between the main control module and the first backup communication module. The communication status of the host device itself is determined by combining the first detection result and the second detection result.
[0012] Optionally, the method further includes: In the event that both the host device and the slave device are faulty, the first switch unit and the second switch unit are sequentially controlled to close individually, and the communication quality of each communication line is obtained. After the slave device completes the communication module switching, it controls the first switch unit and the second switch unit to close individually again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; Based on the optimal communication line, the switching states of the first switching unit and the second switching unit are controlled.
[0013] Thirdly, embodiments of this application also provide a communication line switching method, applied to a slave device in the communication line switching system described in the first aspect, the method comprising: In the event of a communication failure between the host device and the slave device, the communication status of the slave device itself is detected. Based on the detection results, the second switching module is controlled to switch the communication lines in the slave device.
[0014] Optionally, controlling the second switching module based on the detection result to switch the communication line in the slave device includes: If the detection results indicate a fault in the second main communication module, the sixth switch unit is opened and the seventh switch unit is closed to allow communication between the second backup communication module and the host device; or... If the test results indicate that the second backup communication module is faulty, the sixth switch unit is closed and the seventh switch unit is opened to enable communication between the second main communication module and the host device.
[0015] Optionally, detecting the communication status of the slave device itself includes: The eighth switch unit is controlled to close, while the ninth and tenth switch units are opened. A preset data packet is sent to the fifth data line, and it is determined whether the preset data packet is received from the eighth data line to obtain a third detection result. The third detection result is used to characterize whether there is a fault in the closed loop formed by the slave control module, the second master communication module and the second backup communication module. The eighth switch unit is controlled to open, while the ninth and tenth switch units are closed; A preset data packet is sent to the fifth data line and the seventh data line respectively, and it is detected whether the preset data packet is received from the sixth data line and the eighth data line to obtain a fourth detection result. The fourth detection result is used to characterize whether there is a fault in the line from the control module to the second main communication module and the line from the control module to the second backup communication module. The communication status of the slave device is determined by combining the third and fourth detection results.
[0016] Optionally, the method further includes: In the event that both the host device and the slave device are faulty, the sixth switch unit and the seventh switch unit are sequentially controlled to close individually, and the communication quality of each communication line is obtained. After the host device completes the communication module switching, it controls the sixth switch unit and the seventh switch unit to close individually again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; Based on the optimal communication line, the switching states of the sixth and seventh switching units are controlled.
[0017] Fourthly, embodiments of this application also provide a host device, the host device including a main control module, a first main communication module, a first backup communication module and a first switching module, the first main communication module, the first backup communication module and the first switching module are all connected to the main control module, the main control module is used to execute the communication line switching method described in the second aspect.
[0018] Fifthly, embodiments of this application also provide a slave device, which includes a slave control module, a second master communication module, a second backup communication module, and a second switching module. The second master communication module, the second backup communication module, and the second switching module are all connected to the slave control module. The slave control module is used to execute the communication line switching method described in the third aspect.
[0019] Sixthly, embodiments of this application also provide an air conditioning unit, the air conditioning unit including the host device described in the fourth aspect and at least one slave device described in the fifth aspect.
[0020] In a seventh aspect, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the communication line switching method described in the second aspect, or implements the communication line switching method described in the third aspect when executed.
[0021] Compared with the prior art, the technical solution provided in this application has the following advantages: The communication line switching system provided in this application includes a host device and a slave device; wherein, the host device includes a main control module, a first main communication module, a first backup communication module, and a first switching module, the first main communication module, the first backup communication module, and the first switching module are all connected to the main control module, the main control module is used to detect the communication status of the host device itself when the communication between the host device and the slave device fails, and control the first switching module according to the detection result to switch the communication line in the host device; the slave device includes a slave control module, a second main communication module, a second backup communication module, and a second switching module, the second main communication module, the second backup communication module, and the second switching module are all connected to the slave control module, the slave control module is used to detect the communication status of the slave device itself when the communication between the host device and the slave device fails, and control the second switching module according to the detection result to switch the communication line in the slave device. In this way, by adding a first backup communication module and a first switching module to the master device, and a second backup communication module and a second switching module to the slave device, when a communication failure occurs between the master device and the slave device, the master device and the slave device can be triggered to detect their own communication status respectively, and control the first switching module and the second switching module respectively according to their respective detection results. This realizes the dynamic switching of communication lines between the master device and the slave device, improves the stability of the communication lines between the master device and the slave device, and also improves the stability of the system. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] One embodiment or practice is illustrated by way of example with the corresponding pictures in the accompanying drawings. These illustrative descriptions do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0025] Figure 1 This is a schematic diagram of a communication line switching system provided in an embodiment of this application; Figure 2 A schematic diagram of yet another communication line switching system provided in the embodiments of this application; Figure 3 A flowchart illustrating a communication line switching method provided in an embodiment of this application; Figure 4 A flowchart illustrating another communication line switching method provided in this application embodiment; Figure 5 This is a schematic diagram of the structure of a host device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a slave device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an air conditioning unit provided in an embodiment of this application. Attached image description: 100. Communication line switching system; 200. Host device; 300. Slave device; 400. Air conditioning unit; 210. First main communication module; 220. First backup communication module; 230. First switching module; 240. Main control module; 310. Second main communication module; 320. Second backup communication module; 330. Second switching module; 340. Slave control module; K1. First switching unit; K2. Second switching unit; K3. Third switching unit; K4. Fourth switching unit; K5. Fifth switching unit; K6. Sixth switching unit; K7. Seventh switching unit; K8. Eighth switching unit; K9. Ninth switching unit; K10. Tenth switching unit. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0029] To address the problem that the master and slave devices in the prior art typically use a single communication line for data interaction, resulting in low communication stability between the master and slave devices, this application provides a communication line switching system, a communication line switching method, a master device, a slave device, an air conditioning unit, and a storage medium, which can improve the communication stability between the master and slave devices.
[0030] See Figure 1 , Figure 1 This is a schematic diagram of a communication line switching system provided in an embodiment of this application. Figure 1 As shown, the communication line switching system 100 includes a host device 200 and a slave device 300; The host device 200 includes a main control module (not shown in the figure), a first main communication module 210, a first backup communication module 220, and a first switching module 230. The first main communication module 210, the first backup communication module 220, and the first switching module 230 are all connected to the main control module. The main control module is used to detect the communication status of the host device 200 itself in the event of a communication failure between the host device 200 and the slave device 300, and to control the first switching module 230 according to the detection result to switch the communication lines in the host device 200. The slave device 300 includes a slave control module (not shown in the figure), a second master communication module 310, a second backup communication module 320, and a second switching module 330. The second master communication module 310, the second backup communication module 320, and the second switching module 330 are all connected to the slave control module. The slave control module is used to detect the communication status of the slave device 300 itself in the event of a communication failure between the master device 200 and the slave device 300, and to control the second switching module 330 to switch the communication lines in the slave device 300 based on the detection results.
[0031] Specifically, the first backup communication module 220 is a newly added backup communication module in the host device 200. The number of first backup communication modules 220 can be one or more. As the number of first backup communication modules 220 increases, the number of selectable communication lines within the host device 200 also increases. As an optional implementation, to save hardware costs and space, the number of first backup communication modules 220 can be set to one. The second backup communication module 320 is a newly added backup communication module in the slave device 300. The number of second backup communication modules 320 can be one or more. As the number of second backup communication modules 320 increases, the number of selectable communication lines within the slave device 300 also increases. As an optional implementation, to save hardware costs and space, the number of first backup communication modules 220 and second backup communication modules 320 can each be set to one. For better explanation, the following embodiments will use one first backup communication module 220 and one second backup communication module 320 as examples.
[0032] The first switching module 230 described above can switch the communication lines in the host device 200, and may include multiple switching units disposed on different communication lines in the host device 200. The main control module can control the switching states of these multiple switching units, thereby realizing the switching function of the communication lines in the host device 200. The second switching module 330 described above can switch the communication lines in the slave device 300, and may include multiple switching units disposed on different communication lines in the slave device 300. The slave control module can control the switching states of these multiple switching units, thereby realizing the switching function of the communication lines in the slave device 300.
[0033] Since the first main communication module 210, the first backup communication module 220, and the first switching module 230 are all connected to the main control module, the main control module can detect the communication status of the main device 200 itself in the event of a communication failure between the main device 200 and the slave device 300, and control the first switching module 230 to switch the communication lines in the main device 200 based on the detection results. Simultaneously, since the second main communication module 310, the second backup communication module 320, and the second switching module 330 are all connected to the slave control module, the slave control module can detect the communication status of the slave device 300 itself in the event of a communication failure between the main device 200 and the slave device 300, and control the second switching module 330 to switch the communication lines in the slave device 300 based on the detection results.
[0034] In this way, by adding a first backup communication module 220 and a first switching module 230 to the host device 200, and adding a second backup communication module 320 and a second switching module 330 to the slave device 300, when a communication failure occurs between the host device 200 and the slave device 300, the host device 200 and the slave device 300 can be triggered to detect their own communication status respectively, and control the first switching module 230 and the second switching module 330 respectively according to their respective detection results. This realizes the dynamic switching of communication lines between the host device 200 and the slave device 300, improves the stability of the communication lines between the host device 200 and the slave device 300, and also improves the stability of the system.
[0035] In an optional embodiment, the first switching module 230 includes a first switching unit K1 and a second switching unit K2; The first switch unit K1 is disposed between the communication interface A of the first main communication module 210 and the host device 200, and the second switch unit K2 is disposed between the communication interface A of the first backup communication module 220 and the host device 200. The first switch unit K1 and the second switch unit K2 are both electrically connected to the main control module. The main control module is used to control the switching state of the first switch unit K1 and the second switch unit K2 according to the detection results, so as to switch the communication line in the host device 200.
[0036] Specifically, the first switch unit K1 and the second switch unit K2 mentioned above can be single-head double-throw switches or other switch types. The communication interface A of the host device 200 is used to connect the internal communication lines of the host device 200 to the external connection lines, and then communicate with the slave device 300 through the communication interface B of the slave device 300.
[0037] Since the first switch unit K1 is located between the communication interface A of the first main communication module 210 and the host device 200, and the second switch unit K2 is located between the communication interface A of the first backup communication module 220 and the host device 200, when the first main communication module 210 in the host device 200 malfunctions, the first switch unit K1 can be controlled to open and the second switch unit K2 to close, so that the first backup communication module 220 can take over the operation of the first main communication module 210 and communicate with the slave device 300. When the first backup communication module 220 in the host device 200 malfunctions, the first switch unit K1 can be controlled to close and the second switch unit K2 to open, so that the first main communication module 210 can communicate with the slave device 300.
[0038] In this way, the host device 200 can control the switching state of the first switching unit K1 and the second switching unit K2 according to its own detection results, so as to dynamically switch the communication lines in the host device 200, effectively avoid the communication lines with faults, and thus improve the stability of the communication lines of the host device 200.
[0039] In an alternative embodiment, please refer to Figure 2 The first switching module 230 also includes a third switching unit K3, a fourth switching unit K4 and a fifth switching unit K5; The third switch unit K3 is located between the first main communication module 210 and the first backup communication module 220. The main control module 240 is connected to the first main communication module 210 via a first data line and a second data line, and the fourth switch unit K4 is disposed between the first data line and the second data line. The main control module 240 is connected to the first backup communication module 220 via a third data line and a fourth data line, and the fifth switch unit K5 is located between the third data line and the fourth data line. The third switch unit K3, the fourth switch unit K4, and the fifth switch unit K5 are all electrically connected to the main control module 240. The main control module 240 is used to control the switching states of the third switch unit K3, the fourth switch unit K4, and the fifth switch unit K5 in order to detect the communication status of the host device 200 itself.
[0040] Specifically, the third switch unit K3, the fourth switch unit K4, and the fifth switch unit K5 can be single-head double-throw switches or other switch types. The first and second data lines are the two data lines between the main control module 240 and the first main communication module 210, wherein the first data line is used to send data packets and the second data line is used to receive data packets. The third and fourth data lines are the two data lines between the main control module 240 and the first backup communication module 220, wherein the third data line is used to send data packets and the fourth data line is used to receive data packets.
[0041] When the third switch unit K3 is closed and the fourth switch unit K4 and the fifth switch unit K5 are open, a closed loop is formed between the main control module 240, the first main communication module 210, and the first backup communication module 220. The main control module 240 can send a preset data packet to the first main communication module 210 and check whether it receives the preset data packet from the first backup communication module 220, thereby determining whether there is a fault in the closed loop formed by the main control module 240, the first main communication module 210, and the first backup communication module 220. If there is no fault in the closed loop, it means that there is no problem with communication on the host device 200 side, and the problem is likely to occur on the slave device 300 side. If there is a fault in the closed loop, control of the fourth switch unit K4 and the fifth switch unit K5 can continue.
[0042] When the fourth switch unit K4 is closed and the third switch unit K3 is open, the main control module 240 can send a preset data packet to the first data line and detect whether the preset data packet is received from the second data line. This determines the line detection function between the main control module 240 and the first main communication module 210, such as determining whether the interface connecting the main control module 240 to the first data line or the second data line has poor contact, or whether the first data line or the second data line is disconnected.
[0043] When the fifth switch unit K5 is closed and the third switch unit K3 is open, the main control module 240 can send a preset data packet to the third data line and detect whether the preset data packet is received from the fourth data line. This determines the line detection function between the main control module 240 and the first backup communication module 220, such as determining whether the interface between the main control module 240 and the third or fourth data line is not in good contact, or whether the third or fourth data line is disconnected.
[0044] In this way, when a fault is detected in the host device 200, the host device 200 can check each line in different locations to locate the fault and facilitate subsequent fault handling.
[0045] In an optional embodiment, the second switching module 330 includes a sixth switching unit K6 and a seventh switching unit K7; The sixth switch unit K6 is located between the communication interface B of the second main communication module 310 and the slave device 300, and the seventh switch unit K7 is located between the communication interface B of the second backup communication module 320 and the slave device 300. Both the sixth switch unit K6 and the seventh switch unit K7 are electrically connected to the slave control module. The slave control module is used to switch the switching states of the sixth switch unit K6 and the seventh switch unit K7 according to the detection results, so as to switch the communication lines in the slave device 300.
[0046] Specifically, the sixth switch unit K6 and the seventh switch unit K7 mentioned above can be single-head double-throw switches or other switch types. The communication interface B of the slave device 300 is used to connect the internal communication line of the slave device 300 to the external connection line, and then communicate with the host device 200 through the communication interface A of the host device 200.
[0047] Since the sixth switch unit K6 is located between the communication interface B of the second main communication module 310 and the slave device 300, and the seventh switch unit K7 is located between the second backup communication module 320 and the communication interface B of the slave device 300, when the second main communication module 310 in the slave device 300 malfunctions, the sixth switch unit K6 can be controlled to open and the seventh switch unit K7 to close, so that the second backup communication module 320 can take over from the second main communication module 310 to communicate with the master device 200. Conversely, when the second backup communication module 320 in the slave device 300 malfunctions, the sixth switch unit K6 can be controlled to close and the seventh switch unit K7 to open, so that the second main communication module 310 can communicate with the master device 200.
[0048] In this way, the slave device 300 can control the switching states of the sixth switch unit K6 and the seventh switch unit K7 based on its own detection results, so as to dynamically switch the communication lines in the slave device 300, effectively avoid faulty communication lines, and thus improve the stability of the communication lines of the slave device 300.
[0049] In an optional embodiment, the second switching module 330 further includes an eighth switching unit K8, a ninth switching unit K9, and a tenth switching unit K10; The eighth switch unit K8 is located between the second main communication module 310 and the second backup communication module 320. The control module 340 is connected to the second main communication module 310 via the fifth data line and the sixth data line, and the ninth switch unit K9 is located between the fifth data line and the sixth data line; The control module 340 and the second backup communication module 320 are connected via the seventh data line and the eighth data line, and the tenth switch unit K10 is located between the seventh data line and the eighth data line; The eighth switch unit K8, the ninth switch unit K9, and the tenth switch unit K10 are all electrically connected to the slave control module 340. The slave control module 340 is used to control the switching states of the eighth switch unit K8, the ninth switch unit K9, and the tenth switch unit K10 in order to detect the communication status of the slave device 300 itself.
[0050] Specifically, the aforementioned eighth switch unit K8, ninth switch unit K9, and tenth switch unit K10 can be single-head double-throw switches or other switch types. The aforementioned fifth and sixth data lines are two data lines between the control module 340 and the second main communication module 310, wherein the fifth data line is used to send data packets, and the sixth data line is used to receive data packets. The aforementioned seventh and eighth data lines are two data lines between the control module 340 and the second backup communication module 320, wherein the seventh data line is used to send data packets, and the eighth data line is used to receive data packets.
[0051] When the eighth switch unit K8 is closed and the ninth and tenth switch units K9 and K10 are open, a closed loop is formed between the control module 340, the second main communication module 310, and the second backup communication module 320. The control module 340 can send a preset data packet to the second main communication module 310 and check whether it receives the preset data packet from the second backup communication module 320, thereby determining whether there is a fault in the closed loop formed by the control module 340, the second main communication module 310, and the second backup communication module 320. If there is no fault in the closed loop, it indicates that there is no problem with communication on the slave device 300 side, and the problem is likely on the master device 200 side. If there is a fault in the closed loop, control of the ninth switch unit K9 and the tenth switch unit K10 can continue.
[0052] When the ninth switch unit K9 is closed and the eighth switch unit K8 is open, the slave control module 340 can send a preset data packet to the fifth data line and detect whether the preset data packet is received from the sixth data line. This determines the line detection function between the slave control module 340 and the second main communication module 310, such as determining whether the interface connecting the slave control module 340 to the fifth or sixth data line has poor contact, or whether the fifth or sixth data line is disconnected.
[0053] When the tenth switch unit K10 is closed and the eighth switch unit K8 is open, the control module 340 can send a preset data packet to the seventh data line and detect whether the preset data packet is received from the eighth data line. This determines the line detection function between the control module 340 and the second backup communication module 320, such as determining whether the interface between the control module 340 and the seventh or eighth data line has poor contact, or whether the seventh or eighth data line is disconnected.
[0054] In this way, when a fault is detected in the slave device 300, the slave device 300 can check the lines at different locations of itself one by one to locate the fault location, which facilitates subsequent fault handling.
[0055] See Figure 3 , Figure 3This is a flowchart illustrating a communication line switching method provided in an embodiment of this application, as shown below. Figure 3 As shown, this communication line switching method is applied to the host device in the aforementioned communication line switching system, and the communication line switching method may include the following steps: Step S301: In the event of a communication failure between the host device and the slave device, the communication status of the host device itself is detected.
[0056] Specifically, the host device can continuously monitor the communication status during communication with the slave device. If the number of communication failures reaches a preset threshold (e.g., three consecutive failed transmissions), it is determined that there is a communication failure between the host device and the slave device. At this time, the host device can also check its own communication status to determine whether there is a fault in itself.
[0057] Step S302: Based on the detection results, control the first switching module to switch the communication lines in the host device.
[0058] After obtaining its own detection results, the host device can control the first switching module based on the detection results to switch the communication line in the host device to a line that can communicate normally.
[0059] In this way, when a communication failure occurs between the host device and the slave device, the host device can be triggered to detect its own communication status and control the first switching module according to its own detection results. This enables dynamic switching of the communication lines within the host device, thereby improving the stability of the host device's communication lines and thus enhancing the overall system stability.
[0060] In an optional embodiment, step S302, controlling the first switching module based on the detection result to switch the communication line in the host device, includes: If the test results indicate a fault in the first main communication module, the first switch unit is opened and the second switch unit is closed to allow communication with the slave device using the first backup communication module; or, If the test results indicate that the first backup communication module is faulty, the first switch unit is closed and the second switch unit is opened to enable communication between the first master communication module and the slave device.
[0061] In this way, the host device can control the switching state of the first and second switching units based on its own detection results, so as to dynamically switch the communication lines in the host device and improve the stability of the communication lines of the host device.
[0062] In an optional embodiment, step S301, detecting the communication status of the host device itself, includes: The third switch unit is closed, while the fourth and fifth switch units are open; A preset data packet is sent to the first data line, and it is determined whether the preset data packet is received from the fourth data line to obtain a first detection result. The first detection result is used to characterize whether there is a fault in the closed loop line formed by the main control module, the first main communication module and the first backup communication module. The third switch unit is opened, and the fourth and fifth switch units are closed; Preset data packets are sent to the first data line and the third data line respectively, and it is detected whether preset data packets are received from the second data line and the fourth data line to obtain a second detection result. The second detection result is used to characterize whether there is a fault in the line between the main control module and the first main communication module, and the line between the main control module and the first backup communication module. The first and second detection results are used to determine the communication status of the host device itself.
[0063] Specifically, when the third switch unit is closed and the fourth and fifth switch units are open, a closed loop is formed between the main control module, the first main communication module, and the first backup communication module. The main control module can send a preset data packet to the first main communication module and check whether it receives the preset data packet from the first backup communication module, thereby determining whether there is a fault in the closed loop formed by the main control module, the first main communication module, and the first backup communication module. If there is no fault in the closed loop, it indicates that there is no problem with communication on the master device side, and the problem is likely on the slave device side. If there is a fault in the closed loop, control of the fourth and fifth switch units can continue.
[0064] When the fourth switch unit is closed and the third switch unit is open, the main control module can send a preset data packet to the first data line and detect whether the preset data packet is received from the second data line. This determines the line detection function between the main control module and the first main communication module, such as determining whether the interface connecting the main control module to the first data line or the second data line has poor contact, or whether the first data line or the second data line is disconnected.
[0065] When the fifth switch unit is closed and the third switch unit is open, the main control module can send a preset data packet to the third data line and detect whether the preset data packet is received from the fourth data line. This determines the line detection function between the main control module and the first backup communication module, such as determining whether the interface connecting the main control module to the third or fourth data line has poor contact, or whether the third or fourth data line is disconnected.
[0066] This allows for individual testing of different lines when a fault is detected in the host device, accurately pinpointing the location of the fault and facilitating subsequent troubleshooting.
[0067] In an optional embodiment, the method further includes: In the event of a fault in both the master device and the slave device, the first switch unit and the second switch unit are closed sequentially to obtain the communication quality of each communication line. After the slave device completes the communication module switching, it controls the first and second switch units to close separately again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; The switching states of the first and second switching units are controlled based on the optimal communication line.
[0068] Specifically, the communication quality of each communication line can be determined by the integrity of the data transmitted on each communication line. For example, assuming the main control module sends 10 preset data packets, the number of data packets received from each communication line can be checked to see if there are 10 data packets, thereby determining the communication quality of each communication line.
[0069] When both the host device and the slave device are detected to be faulty, the host device can sequentially control the first switch unit and the second switch unit to close individually and obtain the communication quality of each communication line. After the slave device completes the communication module switching, it can control the first switch unit and the second switch unit to close individually again and obtain the communication quality of each communication line again. Then, based on the obtained communication quality of each communication line, the optimal communication line is determined, and based on the optimal communication line, the switching state of the first switch unit and the second switch unit is controlled to keep the communication line in the host device on the optimal communication line.
[0070] In this way, the host device can perform cross-communication verification with the slave device to select the communication line with the best communication quality, and then use the best communication line to communicate, which further improves the stability of communication between the host device and the slave device.
[0071] See Figure 4 , Figure 4 A flowchart illustrating another communication line switching method provided in this application embodiment is shown below. Figure 4 As shown, this communication line switching method is applied to the slave device in the above-mentioned communication line switching system, and the communication line switching method may include the following steps: Step S401: In the event of a communication failure between the host device and the slave device, the communication status of the slave device itself is detected.
[0072] Specifically, the slave device can continuously monitor the communication status during communication with the master device. If the number of communication failures reaches a preset threshold (e.g., three consecutive failed transmissions), it is determined that there is a communication failure between the master device and the slave device. At this time, the communication status of the slave device itself can be checked to determine whether there is a fault in itself.
[0073] Step S402: Based on the detection results, control the second switching module to switch the communication line in the slave device.
[0074] After obtaining its own detection results, the slave device can control the second switching module based on the detection results to switch the communication line in the slave device to a line that can communicate normally.
[0075] In this way, when a communication failure occurs between the master device and the slave device, the slave device can be triggered to detect its own communication status and control the second switching module according to its own detection results. This enables dynamic switching of the communication lines within the slave device, thereby improving the stability of the slave device's communication lines and thus enhancing the overall system stability.
[0076] In an optional embodiment, step S402, controlling the second switching module based on the detection result to switch the communication line in the slave device, includes: If the test results indicate a fault in the second main communication module, the sixth switch unit is opened and the seventh switch unit is closed to allow communication with the host device using the second backup communication module; or, If the test results indicate that the second backup communication module is faulty, the sixth switch unit is closed and the seventh switch unit is opened to enable communication between the second main communication module and the host device.
[0077] In this way, the slave device can control the switching states of the sixth and seventh switching units based on its own detection results, so as to dynamically switch the communication lines in the slave device and thus improve the stability of the communication lines of the slave device.
[0078] In an optional embodiment, step S401, detecting the communication status of the slave device itself, includes: Control the eighth switch unit to close, and the ninth and tenth switch units to open; Send a preset data packet to the fifth data line and determine whether the preset data packet is received from the eighth data line to obtain a third detection result. The third detection result is used to characterize whether there is a fault in the closed loop formed by the slave control module, the second main communication module and the second backup communication module. Control the eighth switch unit to open, and the ninth and tenth switch units to close; Preset data packets are sent to the fifth and seventh data lines respectively, and it is detected whether preset data packets are received from the sixth and eighth data lines to obtain a fourth detection result. The fourth detection result is used to characterize whether there is a fault in the line between the slave control module and the second main communication module, and the line between the slave control module and the second backup communication module. The third and fourth detection results are used to determine the communication status of the slave device itself.
[0079] Specifically, when the eighth switch unit is closed and the ninth and tenth switch units are open, a closed loop is formed between the control module, the second main communication module, and the second backup communication module. The control module can send a preset data packet to the second main communication module and check whether it receives the preset data packet from the second backup communication module, thereby determining whether there is a fault in the closed loop formed by the control module, the second main communication module, and the second backup communication module. If there is no fault in the closed loop, it indicates that there is no problem with communication on the slave device side, and the problem is likely on the master device side. If there is a fault in the closed loop, control of the ninth and tenth switch units can continue.
[0080] When the ninth switch unit is closed and the eighth switch unit is open, the slave control module can send a preset data packet to the fifth data line and detect whether the preset data packet is received from the sixth data line. This determines the line detection function between the slave control module and the second main communication module, such as determining whether the interface connecting the slave control module to the fifth or sixth data line has poor contact, or whether the fifth or sixth data line is disconnected.
[0081] When the tenth switch unit is closed and the eighth switch unit is open, the slave control module can send a preset data packet to the seventh data line and detect whether the preset data packet is received from the eighth data line. This determines the line detection function between the slave control module and the second backup communication module, such as determining whether the interface connecting the slave control module to the seventh or eighth data line has poor contact, or whether the seventh or eighth data line is disconnected.
[0082] In this way, when a fault is detected in the slave device, different lines can be tested one by one to accurately locate the fault location, which facilitates subsequent fault handling.
[0083] In an optional embodiment, the method further includes: In the event of a fault in both the master and slave devices, the sixth and seventh switch units are closed sequentially and individually to obtain the communication quality of each communication line. After the host device completes the communication module switching, it controls the sixth and seventh switch units to close individually again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; The switching states of the sixth and seventh switching units are controlled based on the optimal communication line.
[0084] Specifically, when both the host device and the slave device are detected to be faulty, the slave device can sequentially control the sixth and seventh switch units to close individually and obtain the communication quality of each communication line. After the host device completes the communication module switching, it can control the sixth and seventh switch units to close individually again and obtain the communication quality of each communication line again. Then, based on the obtained communication quality of each communication line, the optimal communication line is determined. Finally, based on the optimal communication line, the switching states of the sixth and seventh switch units are controlled so that the communication line in the slave device is on the optimal communication line.
[0085] In this way, the slave device can perform cross-communication verification with the master device to select the communication line with the best communication quality, and then use the best communication line to communicate, which further improves the stability of communication between the master device and the slave device.
[0086] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a host device provided in an embodiment of this application, such as... Figure 5 As shown, the host device 200 includes a main control module 240, a first main communication module 210, a first backup communication module 220, and a first switching module 230. The first main communication module 210, the first backup communication module 220, and the first switching module 230 are all connected to the main control module 240. The main control module 240 is used to perform the aforementioned... Figure 3 The communication line switching method shown in the method embodiment can achieve the same technical effect, and will not be described in detail here.
[0087] See Figure 6 , Figure 6 This is a schematic diagram of the structure of a slave device provided in an embodiment of this application, such as... Figure 6As shown, the slave device 300 includes a slave control module 340, a second master communication module 310, a second backup communication module 320, and a second switching module 330. The second master communication module 310, the second backup communication module 320, and the second switching module 330 are all connected to the slave control module 340. The slave control module 340 is used to execute the aforementioned... Figure 4 The communication line switching method shown in the method embodiment can achieve the same technical effect, and will not be described in detail here.
[0088] See Figure 7 , Figure 7 This is a schematic diagram of the structure of an air conditioning unit provided in an embodiment of this application, as shown below. Figure 7 As shown, the air conditioning unit 400 includes a main unit 200 and at least one slave unit 300. The main unit 200 and each slave unit 300 can form a communication line switching system.
[0089] It should be noted that the host device 200 has the same function as the host device in the aforementioned embodiments, and the slave device 300 has the same function as the slave device in the aforementioned embodiments, which will not be repeated here. In addition, this application embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the communication line switching method provided in any of the aforementioned method embodiments.
[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0092] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0093] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A communication line switching system, characterized in that, The communication line switching system includes a host device and a slave device; The host device includes a main control module, a first main communication module, a first backup communication module, and a first switching module. The first main communication module, the first backup communication module, and the first switching module are all connected to the main control module. The main control module is used to detect the communication status of the host device itself in the event of a communication failure between the host device and the slave device, and to control the first switching module according to the detection result to switch the communication lines in the host device. The slave device includes a slave control module, a second master communication module, a second backup communication module, and a second switching module. The second master communication module, the second backup communication module, and the second switching module are all connected to the slave control module. The slave control module is used to detect the communication status of the slave device itself in the event of a communication failure between the master device and the slave device, and to control the second switching module according to the detection result to switch the communication line in the slave device.
2. The communication line switching system according to claim 1, characterized in that, The first switching module includes a first switching unit and a second switching unit; The first switch unit is disposed between the communication interface of the first main communication module and the host device, and the second switch unit is disposed between the communication interface of the first backup communication module and the host device. Both the first switch unit and the second switch unit are electrically connected to the main control module. The main control module is used to control the switching state of the first switch unit and the second switch unit according to the detection results, so as to switch the communication line in the host device.
3. The communication line switching system according to claim 2, characterized in that, The first switching module further includes a third switching unit, a fourth switching unit, and a fifth switching unit; The third switch unit is located between the first main communication module and the first backup communication module. The main control module is connected to the first main communication module via a first data line and a second data line, and the fourth switch unit is disposed between the first data line and the second data line; The main control module is connected to the first backup communication module via a third data line and a fourth data line, and the fifth switch unit is disposed between the third data line and the fourth data line; The third, fourth, and fifth switch units are all electrically connected to the main control module. The main control module is used to control the switching states of the third, fourth, and fifth switch units in order to detect the communication status of the host device itself.
4. The communication line switching system according to claim 1, characterized in that, The second switching module includes a sixth switching unit and a seventh switching unit; The sixth switch unit is disposed between the communication interface of the second main communication module and the slave device, and the seventh switch unit is disposed between the communication interface of the second backup communication module and the slave device. Both the sixth and seventh switch units are electrically connected to the slave control module. The slave control module is used to switch the switching states of the sixth and seventh switch units according to the detection results, so as to switch the communication lines in the slave device.
5. The communication line switching system according to claim 4, characterized in that, The second switching module also includes an eighth switching unit, a ninth switching unit, and a tenth switching unit; The eighth switch unit is located between the second main communication module and the second backup communication module. The slave control module is connected to the second master communication module via a fifth data line and a sixth data line, and the ninth switch unit is disposed between the fifth data line and the sixth data line; The control module and the second backup communication module are connected via a seventh data line and an eighth data line, and the tenth switch unit is disposed between the seventh data line and the eighth data line; The eighth, ninth, and tenth switch units are all electrically connected to the slave control module. The slave control module is used to control the switching states of the eighth, ninth, and tenth switch units in order to detect the communication status of the slave device itself.
6. A communication line switching method, characterized in that, The method, applied to a host device in the communication line switching system according to any one of claims 1-5, comprises: In the event of a communication failure between the host device and the slave device, the communication status of the host device itself is detected. Based on the detection results, the first switching module is controlled to switch the communication lines in the host device.
7. The communication line switching method according to claim 6, characterized in that, The step of controlling the first switching module based on the detection results to switch the communication lines in the host device includes: If the detection results indicate a fault in the first main communication module, the first switch unit is opened and the second switch unit is closed to allow communication between the first backup communication module and the slave device; or... If the detection results indicate that the first backup communication module is faulty, the first switch unit is closed and the second switch unit is opened to enable communication between the first master communication module and the slave device.
8. The communication line switching method according to claim 6, characterized in that, The detection of the communication status of the host device itself includes: The third switch unit is closed, while the fourth and fifth switch units are open; A preset data packet is sent to the first data line, and it is determined whether the preset data packet is received from the fourth data line to obtain a first detection result. The first detection result is used to characterize whether there is a fault in the closed loop line formed by the main control module, the first main communication module and the first backup communication module. The third switch unit is controlled to open, while the fourth and fifth switch units are closed; A preset data packet is sent to the first data line and the third data line respectively, and it is detected whether the preset data packet is received from the second data line and the fourth data line to obtain a second detection result. The second detection result is used to characterize whether there is a fault in the line between the main control module and the first main communication module, and the line between the main control module and the first backup communication module. The communication status of the host device itself is determined by combining the first detection result and the second detection result.
9. The communication line switching method according to claim 6, characterized in that, The method further includes: In the event that both the host device and the slave device are faulty, the first switch unit and the second switch unit are sequentially controlled to close individually, and the communication quality of each communication line is obtained. After the slave device completes the communication module switching, it controls the first switch unit and the second switch unit to close individually again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; Based on the optimal communication line, the switching states of the first switching unit and the second switching unit are controlled.
10. A communication line switching method, characterized in that, The method, applied to a slave device in the communication line switching system according to any one of claims 1-5, comprises: In the event of a communication failure between the host device and the slave device, the communication status of the slave device itself is detected. Based on the detection results, the second switching module is controlled to switch the communication lines in the slave device.
11. The communication line switching method according to claim 10, characterized in that, The step of controlling the second switching module based on the detection results to switch the communication line in the slave device includes: If the detection results indicate a fault in the second main communication module, the sixth switch unit is opened and the seventh switch unit is closed to allow communication between the second backup communication module and the host device; or... If the test results indicate that the second backup communication module is faulty, the sixth switch unit is closed and the seventh switch unit is opened to enable communication between the second main communication module and the host device.
12. The communication line switching method according to claim 10, characterized in that, The detection of the communication status of the slave device itself includes: The eighth switch unit is closed, while the ninth and tenth switch units are open; A preset data packet is sent to the fifth data line, and it is determined whether the preset data packet is received from the eighth data line to obtain a third detection result. The third detection result is used to characterize whether there is a fault in the closed loop formed by the slave control module, the second master communication module and the second backup communication module. The eighth switch unit is controlled to open, while the ninth and tenth switch units are closed; A preset data packet is sent to the fifth data line and the seventh data line respectively, and it is detected whether the preset data packet is received from the sixth data line and the eighth data line to obtain a fourth detection result. The fourth detection result is used to characterize whether there is a fault in the line from the control module to the second main communication module and the line from the control module to the second backup communication module. The communication status of the slave device is determined by combining the third and fourth detection results.
13. The communication line switching method according to claim 10, characterized in that, The method further includes: In the event that both the host device and the slave device are faulty, the sixth switch unit and the seventh switch unit are sequentially controlled to close individually, and the communication quality of each communication line is obtained. After the host device completes the communication module switching, it controls the sixth switch unit and the seventh switch unit to close individually again to reacquire the communication quality of each communication line; Based on the obtained communication quality of each communication line, the optimal communication line is determined; Based on the optimal communication line, the switching states of the sixth and seventh switching units are controlled.
14. A host device, characterized in that, The host device includes a main control module, a first main communication module, a first backup communication module, and a first switching module. The first main communication module, the first backup communication module, and the first switching module are all connected to the main control module. The main control module is used to execute the communication line switching method according to any one of claims 6-9.
15. A slave device, characterized in that, The slave device includes a slave control module, a second master communication module, a second backup communication module, and a second switching module. The second master communication module, the second backup communication module, and the second switching module are all connected to the slave control module. The slave control module is used to execute the communication line switching method according to any one of claims 10-13.
16. An air conditioning unit, characterized in that, The air conditioning unit includes the main unit as described in claim 14 and at least one slave unit as described in claim 15.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the communication line switching method according to any one of claims 6-9, or when it is executed, it implements the communication line switching method according to any one of claims 10-13.