A gateway switching method, system, computer device and readable storage medium

Through the main and backup gateway switching method, the gateway status is monitored and switched, and the data communication interruption caused by the failure of the Internet of Things gateway is solved, and the reliability of data transmission is improved.

CN115695157BActive Publication Date: 2024-12-17BEIJING TIMES LINGYU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211378690.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2024-12-17
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

When the existing Internet of Things gateway fails, data communication cannot be carried out normally between the device terminal and the platform terminal, reducing the reliability of data transmission.

Method used

The main and backup gateway switching method is adopted, and the inquiry signal is sent to the main gateway every preset time through the power controller, the status is monitored and the backup gateway is switched to the backup gateway when no reply signal is received, ensuring the continuity of data communication.

Benefits of technology

Improve the reliability of data transmission through the gateway, ensure that the main gateway fails and restore normal data communication between the device terminal and the platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695157B_ABST
    Figure CN115695157B_ABST
Patent Text Reader

Abstract

The present application provides a gateway switching method, system, computer device and readable storage medium, which are applied to a power supply controller of a gateway switching system, wherein the system also includes a main gateway, a backup gateway, a gateway status monitor and a main power supply, wherein the method includes: after each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends an inquiry signal, and the second device is a device that receives an inquiry signal; if the first device does not receive a reply signal fed back by the second device based on the inquiry signal within the preset reply time, then controlling the main power supply to perform a main-backup switching to stop using the main gateway and start the backup gateway. The above method can improve the reliability of data transmission through the gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things communication technology, and in particular to a gateway switching method, system, computer equipment and readable storage medium. Background Art

[0002] The IoT gateway is responsible for connecting the IoT platform and the device terminal, and is used to transmit the data of the device terminal to the IoT platform. As the only device connecting online and offline, the gateway plays the role of a transmission hub in the IoT system. In the prior art, each IoT data transmission system only has one gateway as a connection intermediary between the device terminal and the platform to achieve data interoperability between the device terminal and the platform.

[0003] The inventors discovered during their research that when the gateway fails, such as power outages, network cable interruptions, machine failures, abnormal shutdowns, etc., it may cause the device terminal to be unable to communicate normally with the platform, or cause data loss at the device terminal during data transmission, thereby reducing the reliability of data transmission through the gateway. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a gateway switching method, system, computer device and readable storage medium, which can improve the reliability of data transmission through the gateway.

[0005] In a first aspect, an embodiment of the present application provides a gateway switching method, which is applied to a power controller of a gateway switching system, wherein the system further includes a main gateway, a backup gateway, a gateway status monitor and a main power supply, wherein when the main power supply supplies power to the main gateway, the main gateway sends a first inquiry signal to a terminal device once every preset sending time for detecting the state of a first communication link between the main gateway and the device terminal, and the main gateway sends a second inquiry signal to a platform end once every preset sending time for detecting the state of a second communication link between the main gateway and the platform end, and the gateway status monitor sends a third inquiry signal to the main gateway once every preset sending time for detecting the running state of the main gateway, wherein the method includes:

[0006] After each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal;

[0007] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to perform a master-slave switch to stop using the main gateway and start the standby gateway.

[0008] Optionally, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes:

[0009] If the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to continue to supply power to the main gateway.

[0010] Optionally, when the first device is a main gateway and the second device is a device terminal, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes:

[0011] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the main gateway is marked as a terminal access unit failure of the main gateway;

[0012] The fault status of the main gateway is sent to the platform end.

[0013] Optionally, when the first device is a main gateway and the second device is a platform end, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes:

[0014] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end;

[0015] If the first device is the gateway status monitor and the second device is the platform end, the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, then the fault state of the main gateway is marked as a network unit failure of the main gateway;

[0016] The fault status of the main gateway is sent to the platform end.

[0017] Optionally, when the first device is the gateway status monitor and the second device is the platform end, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end, the method further includes:

[0018] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server;

[0019] The fault status of the main gateway is sent to the platform end.

[0020] Optionally, when the first device is the gateway status monitor and the second device is the master gateway, after each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes:

[0021] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the master gateway is marked as a main control unit failure of the master gateway;

[0022] The fault status of the main gateway is sent to the platform end.

[0023] Optionally, the system further includes a backup power supply, and the method further includes:

[0024] When it is detected that the main gateway is disconnected from the main power supply, enabling the backup power supply to supply power to the main gateway;

[0025] Or, when it is monitored that the main gateway is disconnected from the backup power supply, the backup power supply is enabled to supply power to the backup gateway.

[0026] In a second aspect, an embodiment of the present application provides a gateway switching system, the system comprising a main gateway, a backup gateway, a gateway status monitor, a main power supply and a power supply controller;

[0027] When the main power supply supplies power to the main gateway, the main gateway is used to send a first inquiry signal for detecting the state of a first communication link between the main gateway and the device terminal to the terminal device once every preset sending time, and is also used to send a second inquiry signal for detecting the state of a second communication link between the main gateway and the platform end to the platform end once every preset sending time, and the gateway state monitor is used to send a third inquiry signal for detecting the operating state of the main gateway to the main gateway once every preset sending time;

[0028] After each time the first device sends an inquiry signal to the second device, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal;

[0029] If the first device does not receive a response signal fed back by the second device based on the inquiry signal within a preset response time, the power controller is used to control the main power supply to perform a main-standby switch to stop using the main gateway and start the standby gateway.

[0030] Optionally, after the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time each time after the first device sends an inquiry signal to the second device, it is also used to:

[0031] If the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to continue to supply power to the main gateway.

[0032] Optionally, when the first device is a main gateway and the second device is a device terminal, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time after each time the first device sends an inquiry signal to the second device, and is also used to:

[0033] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the main gateway is marked as a terminal access unit failure of the main gateway;

[0034] The fault status of the main gateway is sent to the platform end.

[0035] Optionally, when the first device is a main gateway and the second device is a platform end, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time after each time the first device sends an inquiry signal to the second device, and is also used to:

[0036] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end;

[0037] If the first device is the gateway status monitor and the second device is the platform end, the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, and marks the fault state of the main gateway as a network unit failure of the main gateway;

[0038] The fault status of the main gateway is sent to the platform end.

[0039] Optionally, when the first device is the gateway status monitor and the second device is the platform end, after the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, when the first device is the gateway status monitor and the second device is the platform end, the power controller is also used to:

[0040] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server;

[0041] The fault status of the main gateway is sent to the platform end.

[0042] Optionally, when the first device is the gateway status monitor and the second device is the master gateway, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time after each time the first device sends an inquiry signal to the second device, and is also used to:

[0043] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the master gateway is marked as a main control unit failure of the master gateway;

[0044] The fault status of the main gateway is sent to the platform end.

[0045] Optionally, the system further comprises a backup power supply, and when it is detected that the main gateway is disconnected from the main power supply, the power supply controller is used to enable the backup power supply to supply power to the main gateway;

[0046] Or, when it is monitored that the main gateway is disconnected from the backup power supply, the power supply controller is used to enable the backup power supply to supply power to the backup gateway.

[0047] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of a gateway switching method described in any optional implementation manner of the first aspect above are performed.

[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a gateway switching method described in any optional implementation manner in the first aspect above are executed.

[0049] The technical solution provided by this application includes but is not limited to the following beneficial effects:

[0050] When the main power supply supplies power to the main gateway, the main gateway sends a first inquiry signal to the terminal device once every preset sending time for detecting the state of the first communication link between the main gateway and the device terminal, and the main gateway sends a second inquiry signal to the platform end once every preset sending time for detecting the state of the second communication link between the main gateway and the platform end, and the gateway status monitor sends a third inquiry signal to the main gateway once every preset sending time for detecting the operating state of the main gateway; through the above steps, the state of the main gateway itself and the connection state of the communication link between the main gateway and each device can be monitored respectively according to the communication principle of the main gateway.

[0051] After each time the first device sends an inquiry signal to the second device, monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal; if the first device does not receive a reply signal fed back by the second device based on the inquiry signal within the preset reply time, control the main power supply to perform a master-slave switch to stop using the main gateway and start the backup gateway; through the above steps, when data communication between the device terminal and the platform end cannot be normally achieved through the main gateway, switch to the backup gateway to connect the device terminal and the platform end to restore normal data communication between the device terminal and the platform end.

[0052] By adopting the above method, the status of the main gateway itself, the communication link between the main gateway and the device terminal, and the communication link between the main gateway and the platform are monitored. After detecting that the above status is abnormal, the main power supply is controlled to stop supplying power to the main gateway and supply power to the backup gateway at the same time, so as to use the backup gateway to realize data communication, which can improve the reliability of data transmission through the gateway.

[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0055] Figure 1 A flow chart of a gateway switching method provided in Embodiment 1 of the present invention is shown;

[0056] Figure 2 A flowchart of a method for sending a fault status provided by Embodiment 1 of the present invention is shown;

[0057] Figure 3 A flowchart of another fault status sending method provided by the first embodiment of the present invention is shown;

[0058] Figure 4 A flowchart of another fault status sending method provided by the first embodiment of the present invention is shown;

[0059] Figure 5 A flowchart of another fault status sending method provided by the first embodiment of the present invention is shown;

[0060] Figure 6 A schematic diagram of the structure of a gateway switching system provided by Embodiment 2 of the present invention is shown;

[0061] Figure 7 A schematic diagram showing the structure of another gateway switching system provided in the second embodiment of the present invention is shown;

[0062] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention is shown. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0064] Embodiment 1

[0065] To facilitate understanding of this application, Figure 1 The contents described in the flowchart of a gateway switching method provided in the first embodiment of the present invention are described in detail in the first embodiment of the present application.

[0066] See also Figure 1 As shown, Figure 1 A flowchart of a gateway switching method provided in Embodiment 1 of the present invention is shown, which is applied to a power supply controller of a gateway switching system, wherein the system further comprises a main gateway, a backup gateway, a gateway status monitor and a main power supply, wherein when the main power supply supplies power to the main gateway, the main gateway sends a first inquiry signal for detecting the status of a first communication link between the main gateway and a device terminal to a terminal device once every preset sending time, the main gateway sends a second inquiry signal for detecting the status of a second communication link between the main gateway and the platform end to a platform end once every preset sending time, and the gateway status monitor sends a third inquiry signal for detecting the operating status of the main gateway to the main gateway once every preset sending time, wherein the method comprises steps S101 to S102:

[0067] S101: After each time a first device sends an inquiry signal to a second device, monitor whether the first device receives a response signal fed back by the second device based on the inquiry signal within a preset response time, wherein the first device is a device that sends an inquiry signal and the second device is a device that receives an inquiry signal.

[0068] Specifically, a gateway is a computer system or device that performs conversion tasks and can serve as a communication intermediary to connect two systems or devices with different communication protocols, data formats or architectures; the main gateway and backup gateway in this application are gateways used to connect the Internet of Things platform and the user device terminal. When the gateway is enabled, the main power controller is first used to control the main power supply to supply power to the main gateway to enable the main gateway; when the main gateway can work normally, the backup gateway is not enabled, and only the main gateway is guaranteed to operate.

[0069] When the main gateway is working, it establishes communication links with the device terminal and the platform end respectively to realize data communication between the device terminal and the platform end; when the first communication link between the main gateway and the device terminal, or the second communication link between the main gateway and the platform end, or the main gateway itself is abnormal, the device terminal and the platform end cannot perform normal data communication; in order to determine whether the device terminal and the platform end can realize data communication, it is necessary to monitor the operating status of the first communication link, the second communication link and the main gateway itself respectively.

[0070] When the main power supply supplies power to the main gateway, the specific monitoring method is as follows: when detecting the first communication link, the first device is the main gateway, and the second device is the device terminal, that is, the main gateway sends a first inquiry signal to the terminal device once every preset sending time for detecting the state of the first communication link between the main gateway and the device terminal; when detecting the second communication link, the first device is the main gateway, and the second device is the platform end, that is, the main gateway sends a second inquiry signal to the platform end once every preset sending time for detecting the state of the second communication link between the main gateway and the platform end; when detecting the operating state of the main gateway itself, the first device is the gateway state monitor, and the second device is the main gateway, that is, the gateway state monitor sends a third inquiry signal to the main gateway once every preset sending time for detecting the operating state of the main gateway.

[0071] S102: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, control the main power supply to perform a master-slave switch to stop using the main gateway and start the backup gateway.

[0072] Specifically, when the first device is the main gateway and the second device is the device terminal, if the first device does not receive the reply signal fed back by the second device based on the inquiry signal within the preset response time, it means that the first communication link has failed; when the first device is the main gateway and the second device is the platform terminal, if the first device does not receive the reply signal fed back by the second device based on the inquiry signal within the preset response time, it means that the second communication link has failed; when the first device is the gateway status monitor and the second device is the main gateway, if the first device does not receive the reply signal fed back by the second device based on the inquiry signal within the preset response time, it means that the main gateway itself has failed.

[0073] When any of the above situations occurs, the communication between the device terminal and the platform cannot be achieved through the main gateway. It is necessary to control the main power supply to perform master-slave switching to stop using the main gateway and start the backup gateway to achieve communication between the device terminal and the platform.

[0074] In a feasible implementation, each time after the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a response signal fed back by the second device based on the inquiry signal within a preset response time, the method further includes:

[0075] If the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to continue to supply power to the main gateway.

[0076] Specifically, if the first device receives a reply signal from the second device based on the inquiry signal within a preset reply time, that is, when the first device is a main gateway and the second device is a device terminal, if the first device receives a reply signal from the second device based on the inquiry signal within the preset reply time, it means that the first communication link is not faulty; when the first device is a main gateway and the second device is a platform end, if the first device receives a reply signal from the second device based on the inquiry signal within the preset reply time, it means that the second communication link is not faulty; when the first device is a gateway status monitor and the second device is a main gateway, if the first device receives a reply signal from the second device based on the inquiry signal within the preset reply time, it means that the main gateway itself is not faulty; when the first communication link, the second communication link and the main gateway itself are not faulty, it means that the main gateway can realize communication between the device terminal and the platform end, and the main power supply continues to be used to power the main gateway.

[0077] In one possible embodiment, see Figure 2 As stated, Figure 2A flowchart of a fault status sending method provided by the first embodiment of the present invention is shown, wherein when the first device is a main gateway and the second device is a device terminal, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method includes steps S201 to S202:

[0078] S201: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a terminal access unit failure of the main gateway.

[0079] S202: Send the fault status of the main gateway to the platform end.

[0080] Specifically, when the first communication link fails, the fault state of the main gateway is marked as a terminal access unit failure of the main gateway, and the fault state of the main gateway is sent to the platform end so that the administrator of the platform end can know the fault state in time.

[0081] In one possible embodiment, see Figure 3 As stated, Figure 3 A flowchart of another fault status sending method provided in the first embodiment of the present invention is shown, wherein when the first device is a main gateway and the second device is a platform end, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method includes steps S301 to S303:

[0082] S301: If the first device does not receive the reply signal fed back by the second device based on the inquiry signal within the preset reply time, monitor whether the first device receives the reply signal fed back by the second device based on the inquiry signal within the preset reply time when the first device is the gateway status monitor and the second device is the platform end.

[0083] Specifically, when the second communication link fails, it is necessary to further determine whether it is because the main gateway cannot connect to the Internet or because the main gateway cannot connect to the platform server; then, when the first device is the gateway status monitor and the second device is the platform end, monitor whether the first device receives the reply signal fed back by the second device based on the inquiry signal within the preset response time.

[0084] S302: If the first device is the gateway status monitor and the second device is the platform end, and within a preset response time, the first device receives a response signal from the second device based on the query signal feedback, then the fault state of the main gateway is marked as a network unit failure of the main gateway.

[0085] S303: Send the fault status of the main gateway to the platform end.

[0086] Specifically, under normal circumstances, it is impossible for the main gateway to be unable to connect to the Internet and the main gateway to be unable to connect to the platform server at the same time. Therefore, when the first device is the gateway status monitor and the second device is the platform end, within the preset response time, the first device receives the reply signal fed back by the second device based on the inquiry signal, indicating that the second communication link fails because the main gateway can connect to the platform server but the main gateway cannot connect to the Internet. In this case, the failure state of the main gateway is marked as a network unit failure of the main gateway.

[0087] In one possible embodiment, see Figure 4 As stated, Figure 4 A flowchart of another fault status sending method provided by Embodiment 1 of the present invention is shown, wherein when the first device is the gateway status monitor and the second device is the platform end, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method includes steps S401 to S402:

[0088] S401: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server.

[0089] S402: Send the fault status of the main gateway to the platform end.

[0090] Specifically, if the first device does not receive a reply signal fed back by the second device based on the inquiry signal within the preset response time, it means that the second communication link fails because the main gateway can connect to the Internet but the main gateway cannot connect to the platform server. In this case, the failure state of the main gateway is marked as a connection failure with the platform server.

[0091] In one possible embodiment, see Figure 5 As stated, Figure 5A flowchart of another fault status sending method provided in the first embodiment of the present invention is shown, wherein when the first device is the gateway status monitor and the second device is the master gateway, after each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method includes steps S501 to S502:

[0092] S501: If the first device does not receive a response signal fed back by the second device based on the inquiry signal within a preset response time, the failure state of the master gateway is marked as a failure of the main control unit of the master gateway.

[0093] S502: Send the fault status of the main gateway to the platform end.

[0094] Specifically, when the main gateway itself fails, the failure state of the main gateway is marked as a failure of the main control unit of the main gateway, and the failure state is sent to the platform end.

[0095] In a feasible embodiment, the system further includes a backup power supply, and the method further includes:

[0096] When it is detected that the main gateway is disconnected from the main power supply, the backup power supply is enabled to supply power to the main gateway; or, when it is detected that the main gateway is disconnected from the backup power supply, the backup power supply is enabled to supply power to the backup gateway.

[0097] Specifically, the system also includes a backup power supply. When the main power supply can work normally (when the main gateway or the backup gateway is powered normally), the backup power supply is not put into use. When it is monitored that the main gateway is disconnected from the main power supply, the backup power supply is enabled to power the main gateway, or when it is monitored that the main gateway is disconnected from the backup power supply, the backup power supply is enabled to power the backup gateway, so as to ensure the normal operation of the main gateway or the backup gateway by supplying power through the backup power supply when the main power supply cannot be supplied.

[0098] Embodiment 2

[0099] See also Figure 6 As shown, Figure 6 A schematic diagram of the structure of a gateway switching system provided in the second embodiment of the present invention is shown, wherein the system includes a main gateway 601, a backup gateway 602, a gateway status monitor 603, a main power supply 604 and a power supply controller 605;

[0100] When the main power supply supplies power to the main gateway, the main gateway is used to send a first inquiry signal for detecting the state of a first communication link between the main gateway and the device terminal to the terminal device once every preset sending time, and is also used to send a second inquiry signal for detecting the state of a second communication link between the main gateway and the platform end to the platform end once every preset sending time, and the gateway state monitor is used to send a third inquiry signal for detecting the operating state of the main gateway to the main gateway once every preset sending time;

[0101] After each time the first device sends an inquiry signal to the second device, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal;

[0102] If the first device does not receive a response signal fed back by the second device based on the inquiry signal within a preset response time, the power controller is used to control the main power supply to perform a main-standby switch to stop using the main gateway and start the standby gateway.

[0103] In a feasible implementation, the power controller is used to monitor whether the first device receives a response signal fed back by the second device based on the query signal within a preset response time each time the first device sends the query signal to the second device, and is also used to:

[0104] If the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to continue to supply power to the main gateway.

[0105] In a feasible implementation scheme, when the first device is a main gateway and the second device is a device terminal, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time each time the first device sends an inquiry signal to the second device, and is also used to:

[0106] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the main gateway is marked as a terminal access unit failure of the main gateway;

[0107] The fault status of the main gateway is sent to the platform end.

[0108] In a feasible implementation scheme, when the first device is a main gateway and the second device is a platform end, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time after each time the first device sends an inquiry signal to the second device, and is also used to:

[0109] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end;

[0110] If the first device is the gateway status monitor and the second device is the platform end, the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, and marks the fault state of the main gateway as a network unit failure of the main gateway;

[0111] The fault status of the main gateway is sent to the platform end.

[0112] In a feasible implementation scheme, when the first device is the gateway status monitor and the second device is the platform end, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end, and is also used to:

[0113] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server;

[0114] The fault status of the main gateway is sent to the platform end.

[0115] In a feasible implementation, when the first device is the gateway status monitor and the second device is the master gateway, the power controller is used to monitor whether the first device receives a response signal fed back by the second device based on the query signal within a preset response time after each time the first device sends an inquiry signal to the second device, and is also used to:

[0116] If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the master gateway is marked as a main control unit failure of the master gateway;

[0117] The fault status of the main gateway is sent to the platform end.

[0118] In one possible embodiment, see Figure 7 As shown, Figure 7 A schematic diagram of the structure of another gateway switching system provided in Embodiment 2 of the present invention is shown, wherein the system further includes a backup power supply 701, and when it is detected that the main gateway is disconnected from the main power supply, the power supply controller is used to enable the backup power supply to power the main gateway;

[0119] Or, when it is monitored that the main gateway is disconnected from the backup power supply, the power supply controller is used to enable the backup power supply to supply power to the backup gateway.

[0120] Embodiment 3

[0121] Based on the same application concept, see Figure 8 As shown, Figure 8 FIG. 4 shows a schematic diagram of the structure of a computer device provided by Embodiment 3 of the present invention, wherein: Figure 8 As shown, a computer device 800 provided in Embodiment 3 of the present application includes:

[0122] A processor 801, a memory 802 and a bus 803, wherein the memory 802 stores machine-readable instructions executable by the processor 801. When the computer device 800 is running, the processor 801 communicates with the memory 802 through the bus 803. When the machine-readable instructions are executed by the processor 801, the steps of a gateway switching method shown in the first embodiment are executed.

[0123] Embodiment 4

[0124] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a gateway switching method described in any one of the above embodiments are executed.

[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0126] The computer program product for performing gateway switching provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.

[0127] A gateway switching system provided in an embodiment of the present invention may be specific hardware on a device or software or firmware installed on a device. The system provided in an embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0128] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0130] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0131] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0132] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0133] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A gateway switching method, characterized in that: In a power supply controller applied to a gateway switching system, the system further includes a main gateway, a standby gateway, a gateway status monitor and a main power supply. When the main power supply supplies power to the main gateway, the main gateway sends a first inquiry signal for detecting the state of a first communication link between the main gateway and a device terminal to a terminal device once every preset sending time, the main gateway sends a second inquiry signal for detecting the state of a second communication link between the main gateway and the platform end to a platform end once every preset sending time, and the gateway status monitor sends a third inquiry signal for detecting the operating state of the main gateway to the main gateway once every preset sending time. The method includes: After each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal; If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to perform a master-slave switch to stop using the main gateway and start the standby gateway; When the first device is a main gateway and the second device is a platform end, after each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end; If the first device is the gateway status monitor and the second device is the platform end, the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, then the fault state of the main gateway is marked as a network unit failure of the main gateway; Sending the fault status of the main gateway to the platform end; When the first device is the gateway status monitor and the second device is the platform end, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server; Sending the fault status of the main gateway to the platform end; When the first device is the gateway status monitor and the second device is the master gateway, after each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the master gateway is marked as a main control unit failure of the master gateway; The fault status of the main gateway is sent to the platform end.

2. The method according to claim 1, characterized in that After each time the first device sends an inquiry signal to the second device, after monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes: If the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the main power supply is controlled to continue to supply power to the main gateway.

3. The method according to claim 1, characterized in that When the first device is a main gateway and the second device is a device terminal, after each time the first device sends an inquiry signal to the second device, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the method further includes: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the main gateway is marked as a terminal access unit failure of the main gateway; The fault status of the main gateway is sent to the platform end.

4. The method according to claim 1, characterized in that: The system also includes a backup power supply, and the method further includes: When it is detected that the main gateway is disconnected from the main power supply, enabling the backup power supply to supply power to the main gateway; Or, when it is monitored that the main gateway is disconnected from the backup power supply, the backup power supply is enabled to supply power to the backup gateway.

5. A gateway switching system, characterized in that: The system includes a main gateway, a backup gateway, a gateway status monitor, a main power supply and a power supply controller; When the main power supply supplies power to the main gateway, the main gateway is used to send a first inquiry signal for detecting the state of a first communication link between the main gateway and the device terminal to the terminal device once every preset sending time, and is also used to send a second inquiry signal for detecting the state of a second communication link between the main gateway and the platform end to the platform end once every preset sending time, and the gateway state monitor is used to send a third inquiry signal for detecting the operating state of the main gateway to the main gateway once every preset sending time; After each time the first device sends an inquiry signal to the second device, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, wherein the first device is a device that sends the inquiry signal and the second device is a device that receives the inquiry signal; If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the power controller is used to control the main power supply to perform a main-standby switch, so as to stop using the main gateway and start the standby gateway; When the first device is a main gateway and the second device is a platform end, the power controller is used to monitor whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time after the first device sends an inquiry signal to the second device each time, and is also used to: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, monitoring whether the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time when the first device is the gateway status monitor and the second device is the platform end; If the first device is the gateway status monitor and the second device is the platform end, the first device receives a reply signal fed back by the second device based on the inquiry signal within a preset reply time, and marks the fault state of the main gateway as a network unit failure of the main gateway; Sending the fault status of the main gateway to the platform end; When the first device is the gateway status monitor and the second device is the platform end, the power controller is used to monitor whether the first device receives a response signal fed back by the second device based on the inquiry signal within a preset response time. Then, the power controller is further used to: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the failure state of the main gateway is marked as a connection failure with the platform server; Sending the fault status of the main gateway to the platform end; When the first device is the gateway status monitor and the second device is the master gateway, the power controller is used to monitor whether the first device receives a response signal fed back by the second device based on the query signal within a preset response time each time the first device sends a query signal to the second device, and is also used to: If the first device does not receive a reply signal fed back by the second device based on the inquiry signal within a preset reply time, the fault state of the master gateway is marked as a main control unit failure of the master gateway; The fault status of the main gateway is sent to the platform end.

6. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of a gateway switching method as described in any one of claims 1 to 4 are performed.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a gateway switching method as claimed in any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Artificial intelligence early warning system

    CN109447048A

  • Automated testing of emergency lights

    US20190326777A1