CN117097606A - Fault processing method, system, computer equipment and storage medium of gateway - Google Patents

Fault processing method, system, computer equipment and storage medium of gateway Download PDF

Info

Publication number
CN117097606A
CN117097606A CN202311065164.8A CN202311065164A CN117097606A CN 117097606 A CN117097606 A CN 117097606A CN 202311065164 A CN202311065164 A CN 202311065164A CN 117097606 A CN117097606 A CN 117097606A
Authority
CN
China
Prior art keywords
gateway
target
terminal
docking
master
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311065164.8A
Other languages
Chinese (zh)
Inventor
尚振辉
周政武
孙凯
黄国昆
焦玉旻
周新亚
汪超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Trina Solar Changzhou Technology Co ltd
Trina Solar Co Ltd
Original Assignee
Trina Solar Changzhou Technology Co ltd
Trina Solar Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Trina Solar Changzhou Technology Co ltd, Trina Solar Co Ltd filed Critical Trina Solar Changzhou Technology Co ltd
Priority to CN202311065164.8A priority Critical patent/CN117097606A/en
Publication of CN117097606A publication Critical patent/CN117097606A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1034Reaction to server failures by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a fault processing method, a fault processing system, computer equipment and a storage medium of a gateway. The method comprises the following steps: when the gateway fault exists in the gateway cluster, the main gateway determines a target gateway with the fault; the main gateway is a gateway with terminal scheduling authority in a gateway cluster; each gateway in the gateway cluster is respectively connected with corresponding terminal equipment in a butt joint mode; the master gateway distributes the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks the target terminal; the docking gateway is at least part of the gateways except the target gateway in the gateway cluster; and when the target gateway is monitored to be recovered to be normal, the main gateway distributes the target terminal which is in butt joint with the butt joint gateway to the target gateway so as to enable the target gateway to be in butt joint with the target terminal again. The application can reduce the waste of service resources.

Description

Fault processing method, system, computer equipment and storage medium of gateway
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, a system, a computer device, and a storage medium for processing a gateway fault.
Background
In the micro lan environment, to ensure high availability of the gateway, a multi-instance deployment scheme of one master and multiple slaves is generally adopted, i.e. one master gateway and multiple slaves are deployed in a gateway cluster. In general, the service pressure of the deployment scheme is concentrated on the master gateway, while the slave gateway does not provide any gateway service, which limits the service capability of the gateway, and there is serious service resource waste.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a fault handling method, system, computer device, computer readable storage medium, and computer program product for a gateway, which can reduce waste of service resources.
In a first aspect, the present application provides a method for processing a fault of a gateway, including:
when the gateway fault exists in the gateway cluster, the main gateway determines a target gateway with the fault; the main gateway is a gateway with terminal scheduling authority in a gateway cluster; each gateway in the gateway cluster is respectively connected with corresponding terminal equipment in a butt joint mode;
the master gateway distributes the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks the target terminal; the docking gateway is at least part of the gateways except the target gateway in the gateway cluster;
And when the target gateway is monitored to be recovered to be normal, the main gateway distributes the target terminal which is in butt joint with the butt joint gateway to the target gateway so as to enable the target gateway to be in butt joint with the target terminal again.
In a second aspect, the present application provides a fault handling system for a gateway, including: gateways in the gateway cluster; the gateway comprises a main gateway, a target gateway and a butt joint gateway;
the main gateway is used for determining a target gateway with a fault when the gateway fault exists in the gateway cluster; the main gateway is a gateway with terminal scheduling authority in a gateway cluster; each gateway in the gateway cluster is respectively connected with corresponding terminal equipment in a butt joint mode;
the main gateway is also used for distributing the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks the target terminal; the docking gateway is at least part of the gateways except the target gateway in the gateway cluster;
and the main gateway is also used for distributing the target terminal docked with the docking gateway to the target gateway when the target gateway is monitored to be recovered to be normal, so that the target gateway is docked with the target terminal again.
In some embodiments, the master gateway is further configured to receive heartbeat signals periodically sent by each slave gateway; each slave gateway is a gateway which does not have terminal scheduling authority in a gateway cluster. The master gateway is also used for determining the slave gateway which does not send the heartbeat signal in a preset period as the target gateway with faults.
In some embodiments, the master gateway stores terminal device information sent by each slave gateway respectively, where the terminal device information is used to characterize terminal devices currently docked to each slave gateway respectively. The main gateway is also used for marking the target gateway as an invalid gateway and marking the terminal equipment information corresponding to the invalid gateway as original terminal equipment information.
In some embodiments, when it is monitored that the target gateway marked as the failed gateway is recovered to be normal, the master gateway determines a target terminal to be allocated to the target gateway from the terminal devices docked with the docking gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway, so that the target gateway docks the target terminal again.
In some embodiments, when it is monitored that a gateway fault exists in the gateway cluster, a new primary gateway is used to determine a target gateway that has a fault; the new master gateway is determined in the process that each slave gateway performs master gateway contention through a lock contention mechanism under the condition that each slave gateway monitors that the master gateway is out of connection with the storage device in a preset time period; the new primary gateway is the gateway that obtains exclusive access to the storage device.
In some embodiments, the new primary gateway is further configured to assign the target terminal currently docked with the target gateway to the docking gateway, such that the docking gateway docks the target terminal.
In some embodiments, the master gateway is used for updating and maintaining the stored terminal equipment information of each slave gateway each time, and synchronizing the updated terminal equipment information to each slave gateway each time. The new main gateway is also used for marking the target gateway as a failure gateway and determining terminal equipment information corresponding to the failure gateway from the terminal equipment information synchronized by the last main gateway; and marking the terminal equipment information corresponding to the failure gateway as original terminal equipment information.
In some embodiments, when the target gateway marked as the failed gateway is monitored to be recovered to normal, the new master gateway is further used to join the target gateway as a slave gateway to the gateway cluster; and determining a target terminal to be allocated to the target gateway from all terminal equipment in butt joint with the butt joint gateway according to the original terminal equipment information corresponding to the target gateway, and allocating the target terminal to the target gateway so as to enable the target gateway to butt joint the target terminal again.
In a third aspect, the application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above.
In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, carries out the steps of the method described above.
According to the fault processing method, the system, the computer equipment, the computer readable storage medium and the computer program product of the gateway, the gateway cluster is formed by the gateways, and the gateways in the gateway cluster are all in butt joint with the corresponding terminal equipment, so that the simultaneous operation of the gateways is ensured, the butt joint pressure of the terminal equipment is averagely shared, the situation that all the terminal equipment are in butt joint with the same gateway to bear all the service pressure is avoided, and the service resource waste is reduced. In addition, when the gateway fault exists in the gateway cluster, the main gateway with the terminal calling authority can also determine the target gateway with the fault and distribute the target terminal currently in butt joint with the target gateway to the butt joint gateway so as to enable the butt joint gateway to butt joint the target terminal; the docking gateway is at least part of the gateway cluster except for the target gateway. In this way, the connection service of the terminal device interfacing with the failed target gateway is terminated only briefly, and the master gateway immediately distributes the terminal device interfacing with the failed target gateway to other gateways, i.e., to the interfacing gateway, in an even manner, so that the range of influence of the failure can be reduced. When the target gateway is monitored to be recovered to be normal, the target gateway can continue to be docked with the terminal equipment, and at the moment, in order to share the pressure of other gateways for docking the terminal equipment, the main gateway can also distribute the target terminal docked with the docking gateway to the target gateway, so that the target gateway is docked with the target terminal again, the service capacity of all the gateways is fully exerted, and the waste of service resources is further reduced.
Drawings
Fig. 1 is an application environment diagram of a fault handling method of a gateway according to an embodiment of the present application;
fig. 2 is a flow chart of a fault handling method of a gateway according to an embodiment of the present application;
fig. 3 is a schematic diagram of an interaction relationship among gateways, terminal devices and distributed locks according to an embodiment of the present application;
fig. 4 is a block diagram of a fault handling system of a gateway according to an embodiment of the present application;
FIG. 5 is a diagram illustrating an internal architecture of a computer device according to an embodiment of the present application;
fig. 6 is an internal structure diagram of another computer device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The gateway fault processing method provided by the embodiment of the application can be applied to an application environment shown in figure 1. The gateway cluster includes a master gateway 102 and one or more slave gateways 104, where the failed target gateway may be the master gateway 102 or the slave gateway 104, and the target gateway interfaces with the target terminal 106 through a communication network. When the target gateway is a slave gateway 104, the docking gateway may then be the master gateway 102 or a slave gateway 104 other than the target gateway, the master gateway 102 communicating with the slave gateway 104 including the target gateway and the docking gateway, respectively. The master gateway 102 allocates the target terminal 106 to the docking gateway for docking, and reallocates the target terminal 106 to the target gateway when the target gateway returns to normal. When the target gateway is the master gateway 102, the master gateway 102 needs to be determined again from the slave gateways 104 that are operating normally, and the docking gateway may be the determined master gateway 102 or the slave gateway 104 other than the target gateway, and the determined master gateway 102 may communicate with the slave gateway 104 including the target terminal 106 and the docking gateway, respectively. The redetermined primary gateway 102 allocates the target terminal 106 to the docking gateway for docking, and reassigns the target terminal 106 to the target gateway when the target gateway returns to normal. It should be noted that, the data storage system may store data that needs to be processed by the primary gateway 102, and the data storage system may be integrated on the primary gateway 102, or may be placed on a cloud or other network servers.
It should be noted that, the target terminal 106 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, etc. The portable wearable device may be a smart watch, smart bracelet, headset, or the like.
As shown in fig. 2, an embodiment of the present application provides a method for processing a fault of a gateway, which may be implemented through interaction between a master gateway 102 and a slave gateway 104 in fig. 1, and the method includes the following steps:
s202, when the gateway fault exists in the gateway cluster, the main gateway determines the target gateway with the fault.
Wherein, the gateway cluster refers to a logic cluster formed by combining a plurality of gateway instances. The gateway comprises a soft gateway, and the soft gateway is a network device realized by software and is used for connecting communication among different networks or subnets and providing forwarding, routing and security functions.
The master gateway is a gateway with terminal scheduling authority in the gateway cluster, and the slave gateway is a gateway without terminal scheduling authority except the master gateway in the gateway cluster. The terminal scheduling authority refers to the authority of scheduling each terminal device to each gateway.
In some embodiments, each gateway in the gateway cluster needs to contend for the master gateway through a lock contention mechanism, such as through a distributed lock contention mechanism, and determine that none of the gateways contended successfully are slave gateways before determining the master gateway and the slave gateway in the gateway cluster. After the master gateway generates, each slave gateway needs to send the information of the terminal devices respectively butted to the master gateway, and the master gateway stores the information of the terminal devices respectively butted to each gateway and sends the information to each slave gateway for synchronous storage.
Lock contention mechanism refers to a mechanism that controls access to shared resources in a multi-threaded or multi-process environment. When multiple threads or processes attempt to access the shared resource at the same time, the lock contention mechanism may ensure that only one thread or process can successfully acquire the lock and perform operations on the shared resource at the same time, with the other threads or processes being in a wait state.
In practical application, the information of the terminal devices respectively docked with each slave gateway is stored in a hash structure, and when the data stored in the hash structure is changed, for example, a new gateway is added in a gateway cluster, or when the information of the terminal docks docked with the gateway is changed, the new information of the terminal docks needs to be retransmitted to each slave gateway, so that each slave gateway has the information of the terminal docks stored in the master gateway synchronously.
The terminal docking information is used for representing terminal equipment currently docked with each gateway respectively. For example, the gateway cluster includes a master gateway, a slave gateway a and a slave gateway B, and the terminal devices to be docked include a terminal device a, a terminal device B, a terminal device C, a terminal device D, a terminal device E and a terminal device F, and the master gateway can dock each terminal device to each gateway including itself. For example, the master gateway interfaces terminal device a and terminal device B, the slave gateway a interfaces terminal device C and terminal device D, and the slave gateway B interfaces terminal device E and terminal device F.
Gateway failure refers to a situation in which one or more gateways in a gateway cluster fail or fail.
Specifically, the master gateway may monitor whether each slave gateway in the gateway cluster has a fault, determine the slave gateway having the fault, and obtain the target gateway. Each slave gateway can also monitor whether the master gateway has a fault, determine a new master gateway after determining the master gateway has a fault, and determine the target gateway with the fault by the new gateway.
S204, the master gateway distributes the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks the target terminal.
Wherein the docking gateway is at least part of the gateways in the gateway cluster except the target gateway, i.e. one or more normally functioning gateways.
Docking gateway refers to one or more gateways that need to dock to a target terminal.
Specifically, when the target gateway is a slave gateway, the master gateway selects terminal equipment information corresponding to the target gateway from the terminal equipment information synchronized by the slave gateways, so as to obtain a target terminal currently docked with the target gateway through the terminal docking information, so that the docking gateway docks with the target terminal. And under the condition that the target gateway is a master gateway, determining a new master gateway from all slave gateways which normally operate, and distributing the target terminal which is currently in butt joint with the original master gateway, namely the target gateway, to the butt joint gateway so as to enable the butt joint gateway to butt joint the target terminal.
And S206, when the target gateway is monitored to be recovered to be normal, the main gateway distributes the target terminal docked with the docking gateway to the target gateway so as to enable the target gateway to dock the target terminal again.
Specifically, when the target gateway is monitored to be recovered to be normal, if the target gateway is a slave gateway, the master gateway reallocates the target terminal docked with the docking gateway to the target gateway so as to enable the target gateway to dock the target terminal again. When the target gateway is monitored to be recovered to be normal, if the target gateway is a main gateway, the new main gateway reallocates the target terminal which is docked with the docking gateway to the target gateway so as to enable the target gateway to dock the target terminal again.
In some embodiments, as shown in fig. 3, the gateway cluster includes a master gateway, a slave gateway 1 and a slave gateway 2, where each gateway may perform lock contention for the distributed lock to determine the master gateway before determining the master gateway and the slave gateway, and the master gateway may then communicate with the slave gateway 1 and the slave gateway 2, respectively, to perform data interaction. Each gateway is respectively connected with corresponding terminal equipment. For example, the master gateway interfaces with the terminal device 1, the terminal device 2 and the terminal device 3, the slave gateway 1 interfaces with the terminal device 4, the terminal device 5 and the terminal device 6, and the slave gateway 3 interfaces with the terminal device 7, the terminal device 8 and the terminal device 9 for data acquisition.
According to the fault processing method of the gateway, the gateway clusters are formed through the gateways, and the corresponding terminal equipment is butted with the gateways in the gateway clusters, so that the simultaneous operation of the gateways is guaranteed, the butting pressure of the terminal equipment is averagely shared, the situation that all the terminal equipment is butted with the same gateway to bear all the service pressure is avoided, and the service resource waste is reduced. In addition, when the gateway fault exists in the gateway cluster, the main gateway with the terminal calling authority can also determine the target gateway with the fault and distribute the target terminal currently in butt joint with the target gateway to the butt joint gateway so as to enable the butt joint gateway to butt joint the target terminal; the docking gateway is at least part of the gateway cluster except for the target gateway. In this way, the connection service of the terminal device which is in butt joint with the failed target gateway is terminated only briefly, and the main gateway immediately distributes the terminal device which is in butt joint with the failed target gateway to other gateways, namely the butt joint gateways, so that the influence range of the failure can be reduced. When the target gateway is monitored to be recovered to be normal, the target gateway can continue to be docked with the terminal equipment, and at the moment, in order to share the pressure of other gateways for docking the terminal equipment, the main gateway can also distribute the target terminal docked with the docking gateway to the target gateway, so that the target gateway is docked with the target terminal again, the service capacity of all the gateways is fully exerted, and the waste of service resources is further reduced.
In some embodiments, the fault handling method of the gateway of the present application specifically further includes, but is not limited to, including: the master gateway receives heartbeat signals periodically transmitted by each slave gateway. Step 202 specifically includes, but is not limited to, including: and the master gateway determines the slave gateway which does not send the heartbeat signal in a preset period as the target gateway with faults.
Wherein each slave gateway is a gateway which does not have terminal scheduling authority in the gateway cluster.
The heartbeat signal is a periodically transmitted signal used for confirming the normal running state of the equipment or the system. In the application, each slave gateway sends a heartbeat signal periodically to indicate the normal operation of the slave gateway, and the master gateway receives the heartbeat signal sent by each slave gateway so as to judge whether the slave gateway operates normally according to the condition of receiving the heartbeat signal.
Specifically, each slave gateway periodically transmits a heartbeat signal to the master gateway, respectively. If a certain slave gateway does not send a heartbeat signal to the master gateway in a preset period, for example, N periods, the master gateway can determine that the slave gateway is a target gateway with a fault. Therefore, the target gateway with faults can be found out in time, and the target terminal currently docked with the target gateway is allocated to other gateways for docking by the main gateway in time, so that the influence of the service interruption of the gateway is controlled within the range of the terminal equipment docked with the fault gateway.
In some embodiments, after determining the target terminal currently interfacing with the target terminal, the primary gateway needs to equally distribute the target terminal to other normally operating gateways, i.e., the interfacing gateway. It should be noted that the docking gateway may be the master gateway itself or one or more slave gateways.
In some embodiments, if the target terminal is one, the primary gateway may randomly assign the target terminal to one of the docking gateways. If the target terminals are multiple, the main gateway needs to determine a current target terminal to be allocated from the multiple target terminals, allocate the current target terminal to one of the docking gateways, then determine a current target terminal to be allocated from the unassigned target terminals, and allocate the current target terminal to the other docking gateway until all the target terminals are allocated or until each docking gateway is docked with one target terminal. If each docking gateway is docked with a target terminal and the target terminal is not allocated, the end of the first round of terminal equipment allocation is indicated, and at least one round of terminal equipment allocation operation identical to the first round of terminal equipment needs to be started until after the terminal equipment of multiple rounds is allocated, the main gateway allocates all the target terminals to the docking gateway uniformly.
For example, assuming that the docking gateway includes the docking gateway 1, the docking gateway 2, and the docking gateway 3, the target terminal currently docked with the target gateway includes the target terminal 1, the target terminal 2, the target terminal 3, the target terminal 4, and the target terminal 5, the master gateway may allocate the target terminal 1 to the docking gateway 1 for docking, then allocate the target terminal 2 to the docking gateway 2 for docking, and allocate the target terminal 3 to the docking gateway 3 for docking, and since the three docking gateways are each docked with one target terminal, and the target terminals are not completely allocated, the master gateway may further allocate the target terminal 4 to the docking gateway 1 for docking, and allocate the target terminal 5 to the docking gateway 2 for docking, so as to complete allocation of all the target terminals. After the main gateway finishes the distribution of the terminal equipment, the docking gateway 1 also docks the target terminal 1 and the target terminal 4 on the basis of docking the original terminal equipment, the docking gateway 2 also docks the target terminal 2 and the target terminal 5 on the basis of docking the original terminal equipment, and the docking gateway 3 also docks the target terminal 3 on the basis of docking the original equipment.
In some embodiments, the master gateway stores terminal device information sent by each slave gateway respectively, where the terminal device information is used to characterize terminal devices currently docked to each slave gateway respectively. The fault handling method of the gateway of the present application specifically further includes, but is not limited to, the following steps: the main gateway marks the target gateway as a failure gateway and marks the terminal equipment information corresponding to the failure gateway as original terminal equipment information. Step 206 specifically includes, but is not limited to, including: when the target gateway marked as the failure gateway is monitored to be recovered to be normal, the main gateway determines a target terminal to be allocated to the target gateway from all terminal devices in butt joint with the butt joint gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to butt joint the target terminal again.
Specifically, after the master gateway allocates the target terminal to the docking gateway, new terminal device information currently docked with the master gateway and each slave gateway may be sent to each slave gateway. At the same time, the master gateway may also mark the target gateway as a failed gateway, indicating that the gateway is temporarily unable to interface with the terminal device to provide a corresponding service, and mark terminal device information that was previously interfaced with the failed gateway as the original terminal device information. Once the main gateway fails, other slave gateways in the gateway cluster can automatically and evenly distribute the terminal equipment butted by the failed gateway to other gateways according to the information of each terminal equipment synchronized by the main gateway and the original equipment information of the target gateway so as to realize automatic load balancing. When the target gateway marked as the failure gateway is monitored to be recovered to be normal, in order to reduce the service pressure of each butt joint gateway, the main gateway can also determine the target terminal which is butt-jointed with the target gateway before from the terminal devices which are butt-jointed with the butt joint gateway according to the original terminal device information corresponding to the target gateway, and allocate the target terminal to the target gateway so as to enable the target gateway to butt-joint the target terminal again.
In some embodiments, step 202 specifically further includes, but is not limited to including: when the gateway fault exists in the gateway cluster, a new main gateway is used for determining the target gateway with the fault.
The new master gateway is determined in the process that each slave gateway performs master gateway contention through a lock contention mechanism under the condition that each slave gateway monitors that the master gateway is out of connection with the storage device in a preset time period; the new primary gateway is the gateway that obtains exclusive access to the storage device.
The storage device refers to a device which is communicated with the main gateway independently and is built with a corresponding database. The database may store relevant data that the primary gateway needs to store, such as terminal device information for each gateway.
Exclusive access refers to rights to communicate with the storage device alone only.
In some embodiments, each normally operating slave gateway re-performs master gateway contention through a lock contention mechanism to contend for obtaining exclusive access rights to the storage device, and determines the slave gateway obtaining the exclusive access rights as a new master gateway, so that the new master gateway performs subsequent terminal device allocation operations.
In particular, each slave gateway may each monitor the communication between the master gateway and the storage device, such as monitoring whether the master gateway is writing data to the storage device frequently. If the slave gateway finds that the master gateway does not write data into the storage device within the preset time period, the master gateway can be determined to be disconnected, and the disconnected master gateway can be considered to be a failed target gateway, and the target gateway can not be connected with the terminal device temporarily and can not distribute the terminal device to the slave gateways. At this time, in order to ensure the normal operation of the gateway cluster, a new master gateway needs to be selected from all the slave gateways which are in normal operation. The new main gateway is responsible for determining the target terminal currently docked with the target gateway and distributing the target terminal to the docking gateway so that the docking gateway docks the target terminal and fully plays the service capability of all the gateways.
In some embodiments, the master gateway is used for updating and maintaining the stored terminal equipment information of each slave gateway each time, and synchronizing the updated terminal equipment information to each slave gateway each time. After the step of "executing, based on the new primary gateway, that the primary gateway allocates the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks with the target terminal", the fault handling method of the gateway of the present application specifically further includes, but is not limited to, the following steps: the new main gateway marks the target gateway as a failure gateway and determines terminal equipment information corresponding to the failure gateway from the terminal equipment information synchronized by the last main gateway; and marking the terminal equipment information corresponding to the failure gateway as original terminal equipment information. Step 206 specifically further includes, but is not limited to, including: when the target gateway marked as the failure gateway is monitored to be recovered to be normal, the new master gateway takes the target gateway as a slave gateway to be added into the gateway cluster; and the new main gateway determines a target terminal to be allocated to the target gateway from all terminal devices butted with the butted gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to be butted with the target terminal again.
Specifically, the new master gateway marks the target gateway as a failure gateway, which means that the gateway can not be docked with the terminal equipment temporarily to provide corresponding service, determines terminal equipment information corresponding to the failure gateway from the terminal equipment information synchronized by the previous master gateway, marks the terminal equipment information corresponding to the failure gateway as original terminal equipment information, and updates the terminal equipment information to synchronize the updated terminal equipment information to each slave gateway. When the target gateway marked as the failure gateway is monitored to be recovered to be normal, the new master gateway takes the target gateway as the slave gateway to be added into the gateway cluster in order to relieve the service pressure of each butt-joint gateway. And the new main gateway determines a target terminal to be allocated to the target gateway from all terminal devices butted with the butted gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to be butted with the target terminal again.
In some embodiments, the fault handling method of the gateway of the present application specifically includes the following steps:
(1) Each gateway in the gateway cluster performs primary gateway contention through a lock contention mechanism to contend for exclusive access to the storage device.
(2) The gateway that acquired exclusive access rights is determined as a master gateway, and the gateway that did not acquire exclusive access rights is determined as a slave gateway.
(3) Each slave gateway periodically transmits heartbeat signals to the master gateway and monitors the communication condition between the master gateway and the storage device. If the master gateway monitors that the slave gateway which does not send the heartbeat signal exists in the preset period, the slave gateway is in fault, the steps (4) to (8) are executed, if the slave gateway determines that the master gateway is out of connection with the storage device in the preset period, the master gateway is in fault, and the steps (9) to (16) are executed.
(4) And the master gateway determines the slave gateway which does not send the heartbeat signal in a preset period as the target gateway with faults.
(5) And the master gateway distributes the target terminal currently docked with the target gateway to the docking gateway so that the docking gateway docks the target terminal.
(6) The main gateway marks the target gateway as a failure gateway and marks the terminal equipment information corresponding to the failure gateway as original terminal equipment information.
(7) The master gateway updates the terminal equipment information corresponding to each gateway respectively according to the condition of the terminal equipment connected with each gateway (comprising the master gateway and each slave gateway), and synchronizes the updated terminal equipment information and the original terminal equipment information to each slave gateway.
(8) When the target gateway marked as the failure gateway is monitored to be recovered to be normal, the main gateway determines a target terminal to be allocated to the target gateway from all terminal devices in butt joint with the butt joint gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to butt joint the target terminal again.
(9) Each normally operated slave gateway performs master gateway contention through a lock contention mechanism to contend for exclusive access to the storage device.
(10) The slave gateway that acquired exclusive access rights is determined to be the new master gateway.
(11) And distributing the target terminal currently docked with the target gateway to the docking gateway based on the new main gateway so that the docking gateway docks the target terminal.
(12) The new main gateway marks the target gateway as a failure gateway, and determines the terminal equipment information corresponding to the failure gateway from the terminal equipment information synchronized by the last main gateway.
(13) The new main gateway marks the terminal equipment information corresponding to the failure gateway as the original terminal equipment information.
(14) The new main gateway updates the terminal equipment information corresponding to each gateway respectively according to the condition of the terminal equipment which is butted by each current gateway (comprising the new main gateway and each slave gateway), and synchronizes the updated terminal equipment information and the original terminal equipment information to each slave gateway.
(15) When the target gateway marked as the failure gateway is monitored to be recovered to be normal, the new master gateway takes the target gateway as the slave gateway to be added into the gateway cluster.
(16) And the new main gateway determines a target terminal to be allocated to the target gateway from all terminal devices butted with the butted gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to be butted with the target terminal again.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a fault processing system of the gateway. The implementation of the solution provided by the system is similar to the implementation described in the above method, so the specific limitation in the embodiments of the fault handling system for one or more gateways provided below may be referred to the limitation of the fault handling method for a gateway hereinabove, and will not be described herein.
As shown in fig. 4, an embodiment of the present application provides a fault handling system for a gateway, including: gateways in the gateway cluster; the gateways include a primary gateway 402, a target gateway 404, and a docking gateway 406;
a primary gateway 402, configured to determine, when it is monitored that a gateway fault exists in the gateway cluster, a target gateway 404 that has a fault; the main gateway 402 is a gateway having terminal scheduling authority in a gateway cluster; each gateway in the gateway cluster is respectively connected with corresponding terminal equipment in a butt joint mode;
a master gateway 402, configured to allocate a target terminal currently docked with the target gateway 404 to the docking gateway 406, so that the docking gateway 406 docks the target terminal; docking gateway 406 is at least a portion of the gateway cluster other than target gateway 404;
and the master gateway 402 is configured to allocate, when it is monitored that the target gateway 404 is restored to normal, the target terminal docked with the docking gateway 406 to the target gateway 404, so that the target gateway 404 re-docks the target terminal.
According to the fault processing system of the gateway, the gateway clusters are formed through the gateways, and the gateways in the gateway clusters are all in butt joint with the corresponding terminal equipment, so that the simultaneous operation of the gateways is guaranteed, the butt joint pressure of the terminal equipment is averagely shared, the situation that all the terminal equipment is in butt joint with the same gateway to bear all the service pressure is avoided, and the service resource waste is reduced. In addition, when it is monitored that a gateway fault exists in the gateway cluster, the master gateway 402 with the terminal calling authority can also determine the target gateway 404 with the fault and allocate the target terminal currently docked with the target gateway 404 to the docking gateway 406, so that the docking gateway 406 docks with the target terminal; docking gateway 406 is at least a portion of the gateway cluster other than target gateway 404. In this way, the connection service of the terminal device that interfaces with the failed target gateway 404 is terminated only briefly, and the master gateway 402 will immediately and evenly distribute the terminal device that interfaces with the failed target gateway 404 to other gateways, i.e., the docking gateway 406, so that the impact range of the failure can be reduced. When it is monitored that the target gateway 404 is recovered, the target gateway 404 may continue to dock with the terminal device, and at this time, in order to share the pressure of other gateways for docking with the terminal device, the main gateway 402 may further allocate the target terminal docked with the docking gateway 406 to the target gateway 404, so that the target gateway 404 docks with the target terminal again, thereby fully playing the service capability of all the gateways, and further reducing the waste of service resources.
In some embodiments, the master gateway is further configured to receive heartbeat signals periodically sent by each slave gateway; each slave gateway is a gateway which does not have terminal scheduling authority in a gateway cluster. The master gateway 402 is further configured to determine, as the target gateway 404 having a failure, a slave gateway that does not send a heartbeat signal within a preset period.
In some embodiments, the master gateway 402 stores terminal device information sent by each slave gateway separately, where the terminal device information is used to characterize the terminal devices currently docked to each slave gateway separately. The primary gateway 402 is further configured to mark the target gateway 404 as a failed gateway, and mark terminal device information corresponding to the failed gateway as original terminal device information.
In some embodiments, when it is monitored that the target gateway 404 marked as the failed gateway is restored to normal, the master gateway 402 determines, from the terminal devices docked with the docking gateway 406, a target terminal to be allocated to the target gateway 404 according to the original terminal device information corresponding to the target gateway 404, and allocates the target terminal to the target gateway 404, so that the target gateway 404 re-docks the target terminal.
In some embodiments, when a gateway failure is monitored to exist in the gateway cluster, a new primary gateway 402 is used to determine the failed target gateway 404; the new master gateway 402 is determined in the process that each slave gateway contends for the master gateway 402 through a lock contention mechanism under the condition that each slave gateway monitors that the master gateway 402 is out of connection with the storage device in a preset time period; the new primary gateway 402 is the gateway that obtains exclusive access to the storage device.
In some embodiments, the new primary gateway 402 is further configured to assign the target terminal currently docked with the target gateway 404 to the docking gateway 406, so that the docking gateway 406 docks the target terminal.
In some embodiments, each time the master gateway 402 is determined, the master gateway is configured to update and maintain the stored terminal device information of each slave gateway, and synchronize each updated terminal device information to each slave gateway. A new primary gateway 402, configured to mark the target gateway 404 as a failed gateway, and determine terminal device information corresponding to the failed gateway from the terminal device information synchronized by the previous primary gateway 402; and marking the terminal equipment information corresponding to the failure gateway as original terminal equipment information.
In some embodiments, when the target gateway 404 marked as a failed gateway is monitored to return to normal, the new master gateway 402 is also used to join the target gateway 404 as a slave gateway to the gateway cluster; according to the original terminal equipment information corresponding to the target gateway 404, determining a target terminal to be allocated to the target gateway 404 from the terminal equipment docked with the docking gateway 406, and allocating the target terminal to the target gateway 404, so that the target gateway 404 is docked again with the target terminal.
In some embodiments, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store data related to fault handling of the gateway. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the steps in the above-described method for processing a fault of a gateway.
In some embodiments, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements the steps in the above-described method for processing a fault of a gateway. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer equipment can be a touch layer covered on a display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 5 or 6 are merely block diagrams of portions of structures associated with aspects of the application and are not intended to limit the computer device to which aspects of the application may be applied, and that a particular computer device may include more or fewer components than those shown, or may combine certain components, or may have a different arrangement of components.
In some embodiments, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the method embodiments described above when the computer program is executed.
In some embodiments, a computer readable storage medium is provided, the computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In some embodiments, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described embodiment methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (12)

1. A method for processing a gateway failure, comprising:
when the gateway fault exists in the gateway cluster, the main gateway determines a target gateway with the fault; the main gateway is a gateway with terminal scheduling authority in the gateway cluster; each gateway in the gateway cluster is respectively in butt joint with corresponding terminal equipment;
the master gateway distributes a target terminal currently docked with the target gateway to a docking gateway so that the docking gateway docks the target terminal; the docking gateway is at least part of the gateways except the target gateway in the gateway cluster;
And when the target gateway is monitored to be recovered to be normal, the main gateway distributes the target terminal which is docked with the docking gateway to the target gateway so as to enable the target gateway to dock the target terminal again.
2. The method according to claim 1, wherein the method further comprises:
the master gateway receives heartbeat signals sent by each slave gateway periodically, wherein each slave gateway is a gateway which does not have terminal scheduling authority in the gateway cluster;
when the gateway fault exists in the gateway cluster, the main gateway determines the target gateway with the fault, which comprises the following steps:
and the master gateway determines the slave gateway which does not send the heartbeat signal in a preset period as a target gateway with faults.
3. The method according to claim 2, wherein the master gateway stores terminal device information transmitted by each slave gateway separately; the terminal equipment information is used for representing the terminal equipment currently and respectively docked with each slave gateway; the method further comprises the steps of:
the main gateway marks the target gateway as an invalid gateway and marks the terminal equipment information corresponding to the invalid gateway as original terminal equipment information.
4. A method according to claim 3, wherein the primary gateway, when monitoring that the target gateway is restored to normal, allocates a target terminal docked with the docking gateway to the target gateway to cause the target gateway to re-dock the target terminal, comprising:
when the target gateway marked as the failure gateway is monitored to be recovered to be normal, the main gateway determines a target terminal to be allocated to the target gateway from all terminal devices in butt joint with the butt joint gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to be in butt joint with the target terminal again.
5. The method according to any one of claims 1 to 4, wherein when it is monitored that a gateway fault exists in the gateway cluster, the primary gateway determines that the target gateway has the fault, including:
when the gateway fault exists in the gateway cluster, the new main gateway determines a target gateway with the fault; the new master gateway is determined in the process that each slave gateway performs master gateway contention through a lock contention mechanism under the condition that each slave gateway monitors that the master gateway is out of connection with a storage device in a preset time period; the new primary gateway is a gateway that obtains exclusive access to the storage device.
6. The method of claim 5, wherein the primary gateway assigns a target terminal currently interfacing with the target gateway to a docking gateway to cause the docking gateway to dock the target terminal, comprising:
and executing the main gateway based on the new main gateway to allocate the target terminal currently docked with the target gateway to the docking gateway so as to enable the docking gateway to dock the target terminal.
7. The method of claim 6, wherein each time the master gateway is determined, the master gateway is configured to update and maintain the stored terminal device information of each slave gateway, and synchronize each updated terminal device information to each slave gateway; after the new-based master gateway performs the master gateway to allocate a target terminal currently docked with the target gateway to a docking gateway so that the docking gateway docks with the target terminal, the method further includes:
the new main gateway marks the target gateway as a failure gateway, and determines terminal equipment information corresponding to the failure gateway from the terminal equipment information synchronized by the last main gateway;
and the new main gateway marks the terminal equipment information corresponding to the failure gateway as the original terminal equipment information.
8. The method of claim 7, wherein the primary gateway, when monitoring that the target gateway is restored to normal, allocates a target terminal docked with the docking gateway to the target gateway to cause the target gateway to re-dock the target terminal, comprising:
when the target gateway marked as the failure gateway is monitored to be recovered to be normal, the new master gateway takes the target gateway as a slave gateway to be added into the gateway cluster;
and the new main gateway determines a target terminal to be allocated to the target gateway from all terminal devices butted with the butt joint gateway according to the original terminal device information corresponding to the target gateway, and allocates the target terminal to the target gateway so as to enable the target gateway to be in butt joint with the target terminal again.
9. A fault handling system for a gateway, comprising: gateways in the gateway cluster; the gateway comprises a main gateway, a target gateway and a butt joint gateway;
the main gateway is used for determining a target gateway with a fault when the gateway fault exists in the gateway cluster; the main gateway is a gateway with terminal scheduling authority in the gateway cluster; each gateway in the gateway cluster is respectively in butt joint with corresponding terminal equipment;
The main gateway is further configured to allocate a target terminal currently docked with the target gateway to a docking gateway, so that the docking gateway docks the target terminal; the docking gateway is at least part of the gateways except the target gateway in the gateway cluster;
and the main gateway is also used for distributing the target terminal docked with the docking gateway to the target gateway when the target gateway is monitored to be recovered to be normal, so that the target gateway is docked with the target terminal again.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 8 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.
CN202311065164.8A 2023-08-23 2023-08-23 Fault processing method, system, computer equipment and storage medium of gateway Pending CN117097606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311065164.8A CN117097606A (en) 2023-08-23 2023-08-23 Fault processing method, system, computer equipment and storage medium of gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311065164.8A CN117097606A (en) 2023-08-23 2023-08-23 Fault processing method, system, computer equipment and storage medium of gateway

Publications (1)

Publication Number Publication Date
CN117097606A true CN117097606A (en) 2023-11-21

Family

ID=88778159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311065164.8A Pending CN117097606A (en) 2023-08-23 2023-08-23 Fault processing method, system, computer equipment and storage medium of gateway

Country Status (1)

Country Link
CN (1) CN117097606A (en)

Similar Documents

Publication Publication Date Title
EP3490224B1 (en) Data synchronization method and system
US10177994B2 (en) Fault tolerant federation of computing clusters
CN106899648B (en) Data processing method and equipment
US20200073655A1 (en) Non-disruptive software update system based on container cluster
US20200019479A1 (en) Disaster recovery deployment method, apparatus, and system
CN108964948A (en) Principal and subordinate's service system, host node fault recovery method and device
CN107153660B (en) Fault detection processing method and system for distributed database system
US20190075084A1 (en) Distributed Lock Management Method, Apparatus, and System
CN109376197B (en) Data synchronization method, server and computer storage medium
CN104243527A (en) Data synchronization method and device and distributed system
CN106878382B (en) Method and device for dynamically changing cluster scale in distributed arbitration cluster
CN105760519A (en) Cluster file system and file lock allocation method thereof
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN104753987B (en) A kind of distributed conversation management method and system
EP3813335B1 (en) Service processing methods and systems based on a consortium blockchain network
US10684875B2 (en) Synchronization of a virtual machine across mobile devices
CN111049886A (en) Multi-region SDN controller data synchronization method, server and system
CN115686346A (en) Data storage method and device and computer readable storage medium
CN111427689B (en) Cluster keep-alive method and device and storage medium
CN117097606A (en) Fault processing method, system, computer equipment and storage medium of gateway
CN115967611A (en) Cross-domain switching processing method, device, equipment and storage medium
CN111083192B (en) Data consensus method and device and electronic equipment
CN115705269A (en) Data synchronization method, system, server and storage medium
CN108270831B (en) Arbiter cluster implementation method and device
CN107153594B (en) HA component main selection method and system of distributed database system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination