CN111786840A - Gateway switching method and device based on network access platform - Google Patents

Gateway switching method and device based on network access platform Download PDF

Info

Publication number
CN111786840A
CN111786840A CN202010734781.2A CN202010734781A CN111786840A CN 111786840 A CN111786840 A CN 111786840A CN 202010734781 A CN202010734781 A CN 202010734781A CN 111786840 A CN111786840 A CN 111786840A
Authority
CN
China
Prior art keywords
gateway
state
network access
access platform
main
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
CN202010734781.2A
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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202010734781.2A priority Critical patent/CN111786840A/en
Publication of CN111786840A publication Critical patent/CN111786840A/en
Pending legal-status Critical Current

Links

Images

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/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • 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/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/12Reselecting a serving backbone network switching or routing node

Landscapes

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

Abstract

The method comprises the steps that a standby gateway acquires a first state message periodically sent by a main gateway, the main gateway is used for accessing the network access platform and acquiring data service, and the first state message is used for indicating the service state of the main gateway; according to the received first state message, sending a state modification message to the main gateway, wherein the state modification message is used for indicating the main gateway to carry out access state switching and releasing a unique service network address used for accessing a network access platform; and acquiring the unique service network address released by the main gateway, and accessing the network access platform according to the unique service network address to acquire the data service. According to the method, the gateway switching operation can be automatically completed under the condition that only one gateway is allowed to log in the network access platform for the same account, the switching process efficiency is improved, the service non-response time is shortened, and the gateway reliability is improved.

Description

Gateway switching method and device based on network access platform
Technical Field
The present application relates to the field of gateway control, and in particular, to a method and an apparatus for switching a gateway based on a network access platform, an electronic device, and a storage medium.
Background
With the development of network access platform technology, more and more enterprises access the gateway server to the network access platform, and provide gateway services to users through the network access platform. Network applications, especially high-timeliness network applications such as stock exchange, generally have a standby gateway, and when a main gateway fails, the standby gateway is switched to continue to perform service. The main gateway and the standby gateway need to log in a network access platform when starting.
At present, a network access platform generally does not allow a plurality of gateway services to log in simultaneously by using the same platform account, so when a main gateway and a standby gateway need to be switched, system maintenance personnel are required to stop the main gateway service and the background service firstly, then, gateway information of the background service is updated to information of a standby gateway service, and finally, the standby gateway and the background service are started.
However, the above switching process needs to be performed in cooperation between the main and standby gateway services and the background service, and manual operation is needed for starting and stopping the background service and the main and standby gateways in the switching process, which results in a long duration of the switching process, a long time for no response to a service, and reduced gateway reliability.
Disclosure of Invention
Based on the technical problems, the application provides a gateway switching method and device based on a network access platform, so that under the condition that only one gateway is allowed to log in the network access platform for the same account, the switching operation of a main gateway and a standby gateway is automatically completed, the switching process efficiency is improved, the service non-response time is shortened, and the gateway reliability is improved.
According to an aspect of the present application, a gateway switching method based on a network access platform is provided, where the network access platform is used to provide data services for an accessed gateway, and the method includes: the standby gateway acquires a first state message periodically transmitted by a main gateway, the main gateway is used for accessing a network access platform and acquiring data service, and the first state message is used for indicating the service state of the main gateway; according to the received first state message, sending a state modification message to the main gateway, wherein the state modification message is used for indicating the main gateway to carry out access state switching and releasing a unique service network address used for accessing a network access platform; and acquiring the unique service network address released by the main gateway, and accessing the network access platform according to the unique service network address to acquire the data service.
In an exemplary embodiment, sending a state modification packet to the active gateway according to the received first state packet includes: acquiring priority information contained in the received first state message; and if the priority information indicates that the priority of the standby gateway is higher than the self priority of the main gateway, sending a state modification message to the main gateway.
In an exemplary embodiment, sending a state modification packet to the active gateway according to the received first state packet includes: the standby gateway records the receiving time of the first state message; and if the first state message sent by the main gateway is not received within the preset time length, sending a state modification message to the main gateway.
In an exemplary embodiment, after acquiring the unique service network address released by the active gateway and accessing the network access platform according to the unique service network address, the method further includes: and switching the access state of the standby gateway from the standby state to the main state, and updating the priority information locally stored by the standby gateway.
In an exemplary embodiment, the method further comprises: acquiring priority information of other gateways except the main gateway; and when the priority information indicates that the priority of the standby gateway is the highest, executing the steps of acquiring the unique service network address released by the main gateway and accessing the network access platform according to the unique service network address.
According to another aspect of the present application, there is also provided a gateway handover method based on a network access platform, where the network access platform is used to provide data services for an accessed gateway, the method includes: the method comprises the steps that a main gateway obtains a state modification message sent by a standby gateway, and the main gateway is used for accessing a network access platform and obtaining data service; according to the state modification message, switching the self access state from the main state to a standby state, and releasing a unique service network address for accessing the network access platform; and suspending the data service acquisition to the network access platform and receiving a first state message sent by a target gateway with an access state being a main state, wherein the first state message is used for indicating the service state of the main gateway.
According to an aspect of the present application, there is provided a gateway switching apparatus based on a network access platform, the apparatus including: the first obtaining module is used for obtaining a first state message periodically sent by a main gateway, the main gateway is used for accessing a network access platform and obtaining data service, and the first state message is used for indicating the service state of the main gateway; the sending module is used for sending a state modification message to the main gateway according to the received first state message, wherein the state modification message is used for indicating the main gateway to carry out access state switching and releasing a unique service network address used for accessing the network access platform; and the access module acquires the unique service network address released by the main gateway and accesses the network access platform according to the unique service network address to acquire the data service.
According to another aspect of the present application, there is also provided a gateway switching apparatus based on a network access platform, the apparatus including: the second acquisition module is used for acquiring the state modification message sent by the standby gateway, and the main gateway is used for accessing the network access platform and acquiring data service; the switching module is used for switching the self access state from the main state to the standby state according to the state modification message and releasing the unique service network address for accessing the network access platform; the receiving module is used for suspending data service acquisition to the network access platform and receiving a first state message sent by a target gateway with an access state being a main state, wherein the first state message is used for indicating the service state of the main gateway.
According to an aspect of the present application, there is provided an electronic device comprising a processor and a memory, the memory having stored thereon computer readable instructions, which when executed by the processor, implement the method as described above.
According to an aspect of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the method as described above.
In the embodiment of the application, the standby gateway acquires the state of the main gateway according to the received first state message, and if the state of the main gateway is poor, the standby gateway sends a state modification message to the main gateway to indicate the main gateway to be switched into the standby state and release the unique service network address, and then acquires the unique service network address and accesses the network access platform.
By the method, in the process of switching the main and standby gateways, the service network address for providing the service is not changed, so that background service participation is not needed in the switching process, and the gateway switching operation is automatically completed under the condition that only one gateway is allowed to log in the network access platform for the same account, so that the switching process efficiency is improved, the service non-response time is shortened, and the gateway reliability is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application:
FIG. 1 is a schematic illustration of an implementation environment to which the present application relates, according to an example embodiment;
fig. 2 is a flowchart of a gateway handover method based on a network access platform according to an example embodiment;
FIG. 3 is a flow chart of one embodiment of step 220 in the embodiment of FIG. 2;
FIG. 4 is a flow chart of step 220 in another embodiment of the embodiment of FIG. 2;
fig. 5 is a flowchart of a gateway handover method based on a network access platform according to another exemplary embodiment;
fig. 6 is a flowchart of a gateway handover method based on a network access platform according to another exemplary embodiment;
fig. 7 is a flowchart of a gateway handover method based on a network access platform according to another exemplary embodiment;
fig. 8 is a block diagram of a network access platform based gateway switching apparatus according to an example embodiment;
fig. 9 is a block diagram of a network access platform based gateway switching apparatus according to another example embodiment;
fig. 10 is a block diagram illustrating a hardware configuration of an electronic device according to an example embodiment.
While certain embodiments of the present application have been illustrated by the accompanying drawings and described in detail below, such drawings and description are not intended to limit the scope of the inventive concepts in any manner, but are rather intended to explain the concepts of the present application to those skilled in the art by reference to the particular embodiments.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present application.
Furthermore, the drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
FIG. 1 illustrates a schematic diagram of an implementation environment to which the present application relates, according to an example embodiment. It should be noted that this implementation environment is only an example adapted to the invention and should not be taken as providing any limitation to the scope of use of the invention.
As shown in fig. 1, the implementation environment includes a network access platform 110, an active gateway 120, a standby gateway 130, and a backend server 140.
The network access platform 110 is a system that implements functions such as unified access to multiple networks, forwarding of requests of an external network, and support of automatic load balancing. After various applications access the network access platform 110, the network access platform 110 may provide services to the various applications in a domain name manner, and the network access platform 110 supports network access of various operators.
The background server 140 is a server that receives external data and provides actual business services to the outside. The network addresses used by the active gateway 120 and the standby gateway 130 are recorded in the background server 140, and communication with the active gateway 120 and the standby gateway 130 is performed based on the network addresses.
The primary gateway 120 and the standby gateway 130 are gateway servers, which may be physical servers or virtual servers. In one embodiment, the active gateway 120 and the standby gateway 130 are virtual servers and are deployed on different physical servers, respectively.
The active gateway 120 and the standby gateway 130 both communicate with the background server 140, and the active gateway 120 needs to log in the network access platform when operating. Typically, the external information is sent to the active gateway 120 through the network access platform 110 and forwarded by the active gateway 120 to the background server 140, and vice versa. When the active gateway 120 cannot operate normally due to various reasons such as failure, maintenance, and device update, the standby gateway 130 replaces the active gateway 120 to access the network access platform 110. It should be noted that the accounts used by the active gateway 120 or the standby gateway 130 when accessing the network access platform 110 are the same account, and the network access platform 110 does not allow the two gateways to log on online at the same time by using the same account, so that the standby gateway 130 does not establish a connection with the network access platform 110 when the active gateway 120 operates normally. It should be understood that although only one standby gateway 130 is shown in fig. 1, in other embodiments, there may be two or more standby gateways 130. In addition, the primary gateway 120 and the standby gateway 130 may convert the description of the service roles in which the gateway servers are located when performing the switching, and do not indicate that there is a sequential relationship between the gateway servers. For example, the active gateway 120 may be referred to as a standby gateway 130 after switching to the role of the standby gateway service.
Fig. 2 is a flowchart illustrating a gateway switching method based on a network access platform according to an exemplary embodiment, which may be specifically executed by the standby gateway 130 in the implementation environment shown in fig. 1.
In an exemplary embodiment, as shown in fig. 2, the gateway handover method based on the network access platform at least includes the following steps:
step 210, the standby gateway obtains a first status message periodically sent by the main gateway, where the main gateway is used to access the network access platform and obtain data services, and the first status message is used to indicate a service status of the main gateway.
The main gateway and the standby gateway are roles that the gateway server can play, the main gateway refers to a current gateway which provides gateway service, and the standby gateway refers to a redundant gateway which does not provide gateway service and can take over the continuous service of the current gateway. The main gateway and the standby gateway can be mutually converted. And the standby gateway takes over the main gateway to continue service when the main gateway can not normally serve.
The network access platform is a system for realizing the functions of multi-network unified access, external network request forwarding, automatic load balancing support and the like. After the gateway is accessed to the network access platform, the gateway service can be provided for the external request according to the data service provided by the network access platform.
It should be noted that, in this embodiment, the network access platform only allows one gateway to access one login account, so that the gateway accessing the network access platform is referred to as an active gateway, and the access state of the gateway accessing the network access platform is an active state. Correspondingly, at least one gateway which is not accessed to the network access platform is called a standby gateway, and the access state of the gateways which are not accessed to the network access platform is a standby state. The primary gateway may periodically send a status packet to the standby gateway, where the status packet may include information such as a gateway address and a status packet sending time, so as to report a service status to the standby gateway.
Step 220, according to the received first state message, sending a state modification message to the primary gateway, where the state modification message is used to instruct the primary gateway to perform access state switching, and release a unique service network address used for accessing the network access platform.
It should be noted that, the unique service network address is a virtual network address, and the active gateway or the standby gateway needs to perform access of the gateway access platform through the unique service network address to request the network access platform to acquire data service.
As described above, the first status packet sent by the primary gateway contains the service status of the primary gateway, so that the standby gateway can know whether the primary gateway operates normally, i.e., whether the primary gateway provides gateway service for the outside, according to the first status packet sent by the primary gateway. If the main gateway is abnormal in operation, the standby gateway needs to replace the main gateway to acquire data service from the network access platform, so that a state modification message needs to be sent to the main gateway.
The main gateway switches the self access state from the main state to the standby state according to the indication of the state modification message, and releases the unique service network address for accessing the network access platform, so that the standby gateway accesses the network access platform according to the released unique service network address, and further replaces the abnormal main gateway to continue to acquire data service from the network access platform.
When the main gateway switches the access state from the main state to the standby state, the main gateway stops local gateway service to disconnect the connection with the network access platform, so that other standby gateways use the unique service network address to access the network platform, and the limitation that the network access platform only allows one gateway of the same login account number to acquire data service is realized.
Step 230, acquiring the unique service network address released by the master gateway, and accessing the network access platform according to the unique service network address to acquire the data service.
The standby gateway acquires the unique service network address released by the main gateway, and logs in the network access platform by using the account same as the account used by the main gateway according to the unique service network address so as to acquire the data service from the network access platform.
By the method, in the process of switching the main and standby gateways, the service network address for providing the service is not changed, so that background service participation is not needed in the switching process, and the gateway switching operation is automatically completed under the condition that only one gateway is allowed to log in the network access platform for the same account, so that the switching process efficiency is improved, the service non-response time is shortened, and the gateway reliability is improved.
Fig. 3 is a flow diagram of details of step 220 of the corresponding embodiment of fig. 2. In an exemplary embodiment, as shown in FIG. 3, this step 220 includes at least the following steps:
step 221, acquiring priority information contained in the received first status message;
in this embodiment, the active gateway and the standby gateway each have a corresponding priority. The primary gateway adds the priority to the first status packet and sends the first status packet to the standby gateway. And the standby gateway acquires the priority of the main gateway from the received first state message.
The priorities identify how prioritized the gateways are relative to each other. The range of values for the priority may depend on the particular implementation. In one embodiment, the priority ranges from 0 to 255. The available value range is 1 to 254, 0 represents that the corresponding gateway exits from the service, 255 represents that the physical address of the gateway is the same as the unique service network address, that is, the gateway is the default most preferred gateway. In this embodiment, after receiving the first state packet, the standby gateway first reads the priority information in the packet, and if the priority information is greater than 0, it indicates that the active gateway is still in a normal state, and the standby gateway does not start the active/standby switching process and continues to monitor the first state packet.
Step 222, if the priority information indicates that the priority of the standby gateway is higher than the priority of the main gateway, sending a state modification message to the main gateway.
The standby gateway compares the obtained priority of the main gateway with the local priority of the standby gateway, and if the priority of the standby gateway is higher than the priority of the main gateway, the standby gateway indicates that the service capability of the standby gateway is better than that of the main gateway, for example, the hardware configuration is better, the processing capability is stronger, and the like, so that a state modification message can be sent to the main gateway to start the main-standby switching process.
In one embodiment, when comparing the priorities of the standby gateway and the active gateway, the active gateway priority will have a weighted value to avoid unnecessary active-standby switching. For example, if the priority of the active gateway is 100, the weighting weight is 20, and the weighting manner is addition, the active-standby switching will be performed only if the priority of the standby gateway is greater than 120. Or, if the priority of the active gateway is 100, the weighting coefficient is 103, and the weighting mode is multiplication, the active-standby switching will be performed only if the priority of the standby gateway is greater than 130. The particular manner of weighting and weighting values depend on the particular implementation.
By the method, the active-standby switching can be performed among the gateways according to the service capabilities of the gateways, so that the gateway with higher service capability can provide service preferentially, the gateway with weak service capability is prevented from serving as a main gateway under the condition of larger difference of the gateway capabilities, and the service efficiency is improved.
Fig. 4 is a flowchart of the details of step 220 of the corresponding embodiment of fig. 2. In an exemplary embodiment, as shown in FIG. 4, this step 220 includes at least the following steps:
step 223, the standby gateway records the receiving time of the first status packet.
In this embodiment, after receiving the first status packet sent by the active gateway, the standby gateway records the receiving time. In one embodiment, after the active gateway switches to the standby state, or after the standby gateway is first started, the switching completion time or the start completion time is recorded.
And 224, if the first state message sent by the main gateway is not received within the preset time length, sending a state modification message to the main gateway.
Wherein the standby gateway determines whether a predetermined time period is exceeded based on the recorded reception time. If the standby gateway does not receive the first state message after the recorded receiving time elapses, it may be determined that the primary gateway is in an abnormal state, and then a state modification message is sent to the primary gateway to perform the primary-standby switching. In one embodiment, the standby gateway starts a local timer after recording the time of receipt of the first status message. If the standby gateway fails to receive the first state packet sent by the primary gateway within the preset time length, that is, before the timeout of the timer, the standby gateway may determine that the primary gateway is in an abnormal state and cannot send the first state packet as it is, and further send a state modification packet to the primary gateway, so as to perform the subsequent primary/secondary switching steps.
In one embodiment, if the standby gateway receives the first status packet within a preset time period and the priority information included in the first status packet indicates that the active gateway is in the service state, the standby gateway resets the timer and continues to monitor the first status packet.
By the method, the standby gateway can identify that the main gateway has a fault, and automatically and timely switches the main gateway and the standby gateway, so that the gateway is prevented from being in a non-response state for a long time, and the reliability of the gateway is improved.
Fig. 5 is a flow chart of additional steps of the method of the corresponding embodiment of fig. 2. In an exemplary embodiment, as shown in fig. 5, the gateway handover method based on the network access platform at least includes the following steps:
step 240, switching the access state of the standby gateway from the standby state to the active state, and updating the priority information stored locally by the standby gateway.
When the standby gateway is switched from the standby state to the active state, the local priority information is updated at the same time.
Specifically, when the standby gateway is converted into the active gateway, the priority of the standby gateway is simultaneously increased. Accordingly, when the primary gateway is converted into the standby gateway, the priority of the primary gateway is simultaneously reduced. The magnitude of the increase or decrease to the priority may vary depending on the reason for making the state switch. For example, if the standby gateway switches to the active state because the active gateway is in the abnormal state, the priority raising range may be larger, whereas if the priority of the standby gateway is higher than that of the active gateway, or the active gateway actively exits the service, the priority raising range may be smaller, or not raised. Accordingly, if the active gateway is switched to the standby state due to a failure (e.g., a downtime, a hardware failure, etc.), the priority may be greatly reduced, and if the local priority is lower than that of the standby gateway, or the service is actively exited, the priority may be reduced or not reduced by a small degree.
It should be understood that the priority level does not continuously rise or continuously fall, so as to avoid that other gateway servers cannot rob the primary gateway due to too high priority level, or that the gateway servers cannot participate in the handover process due to too low priority level.
It should be understood that although the execution order of the steps is shown in fig. 5, this is only an example and should not be construed as limiting the execution order of the steps in the method proposed by the present application. Where appropriate, the steps of the methods presented herein may be performed in any suitable order.
By the method, the priority of the gateway can be dynamically adjusted according to the specific state and the running condition of each gateway server, and then the main and standby gateways can be switched according to the actual working state of each gateway server, so that the reliability of the scheme is improved.
Fig. 6 is a flow chart of additional steps of the method of the corresponding embodiment of fig. 2. In an exemplary embodiment, as shown in fig. 6, the gateway handover method based on the network access platform at least includes the following steps:
and step 250, acquiring the priority information of other gateways except the main gateway.
In this embodiment, the active gateway has at least two standby gateways. Under the condition that the main gateway fails or actively exits the service and the like, at least two standby gateways send state modification messages to all other gateways, and the state modification messages contain priority information of the corresponding standby gateways. Therefore, in a short time, a plurality of active gateways may exist at the same time. When receiving the state modification message sent by other standby gateways, the standby gateway acquires the priority information in the state modification message and compares the priority information with the local priority.
And step 260, when the priority information indicates that the priority of the standby gateway is the highest, executing the steps of acquiring the unique service network address released by the main gateway and accessing the network access platform according to the unique service network address.
If the priority in the received state modification message is greater than the local priority, the standby gateway will stop the switching process and switch back to the standby state, and monitor the first state message sent by the main gateway. If the priorities in all the received state modification messages are smaller than the local priority, the priority of the standby gateway is the highest of all the standby gateways, the standby gateway acquires the unique service network address released by the main gateway, and the account information used by the main gateway is used for logging in a network access platform.
In one embodiment, all gateways will detect local priority information at startup. If the local priority information indicates that the gateway is the owner of the corresponding real network address of the unique service network address, namely the real network address of the gateway is the same as the unique service network address, the gateway is converted into the main gateway, and other gateways convert the gateway into the standby gateway.
In this embodiment, when there are multiple standby gateways, the priority information of all the standby gateways is obtained and compared, so that the standby gateway with the highest priority is switched to the primary gateway, and the standby gateway with the highest service capability can be ensured to be the primary gateway during switching, thereby ensuring the service efficiency and improving the reliability of the gateway.
Fig. 7 is a flowchart illustrating a gateway switching method based on a network access platform, which may be specifically executed by the active gateway 120 in the implementation environment shown in fig. 1.
In an exemplary embodiment, as shown in fig. 7, the method for switching a gateway based on a network access platform at least includes the following steps:
step 310, the primary gateway obtains the state modification message sent by the standby gateway, and the primary gateway is used for accessing the network access platform and obtaining the data service.
As mentioned above, the active gateway may periodically send the first status packet to the standby gateway. The standby gateway can acquire whether the main gateway operates normally according to the first state message sent by the main gateway. If the main gateway is abnormal in operation, the standby gateway needs to replace the main gateway to acquire data service from the network access platform, so that a state modification message needs to be sent to the main gateway.
Therefore, when the primary gateway operates abnormally, the primary gateway receives the state modification message sent by the standby gateway.
Step 320, according to the state modification message, switching the self access state from the main state to the standby state, and releasing the unique service network address for accessing the network access platform;
as described above, the primary gateway or the standby gateway needs to perform access of the gateway access platform through the unique service network address to request the network access platform to acquire data service. Therefore, when the primary gateway operates abnormally and receives the state modification message, the unique service network address needs to be released, so that the standby gateway accesses the network access platform according to the unique service network address, and further takes over the abnormal primary gateway to continue providing gateway service for the outside.
And the main gateway stops the local gateway service in the process of switching to the standby state, so that the standby gateway can log in the network access platform by using the account information same as that of the main gateway. Specifically, the primary gateway may first find whether a gateway process exists. If so, the gateway process is stopped directly.
Step 330, suspending the data service acquisition to the network access platform, and receiving a first status packet sent by the target gateway with the access state being the active state, where the first status packet is used to indicate the service state of the active gateway.
It should be understood first that the target gateway refers to a standby gateway that switches the access state to the active state, i.e. a new active gateway. Similar to the standby gateway, after the primary gateway is switched to the standby state, the primary gateway monitors a state message sent by the primary gateway and starts a local timer to detect whether the standby gateway is in a normal service state.
In one embodiment, the server of the main gateway is restarted due to a downtime or a network connection failure, and in fact, after the main gateway is restarted, whether the main gateway which is in service exists or not is detected, and if the main gateway exists, the main gateway directly enters a standby state.
In this embodiment, the active gateway responds to the state modification packet of the standby gateway, releases the unique service network address and stops acquiring the data service, and starts monitoring a new state packet sent by the active gateway.
By the method, in the process of switching the main and standby gateways, the service network address for providing the service is not changed, so that background service participation is not needed in the switching process, and the gateway switching operation is automatically completed under the condition that only one gateway is allowed to log in the network access platform for the same account, so that the switching process efficiency is improved, the service non-response time is shortened, and the gateway reliability is improved.
Fig. 8 shows a gateway switching apparatus 40 based on a network access platform, which includes a first obtaining module 410, a sending module 420 and an access module 430.
The first obtaining module 410 is configured to obtain a first status packet periodically sent by a primary gateway, where the primary gateway is used to access a network access platform and obtain a data service, and the first status packet is used to indicate a service status of the primary gateway;
the sending module 420 is configured to send a state modification packet to the primary gateway according to the received first state packet, where the state modification packet is used to instruct the primary gateway to perform access state switching, and release a unique service network address used for accessing the network access platform;
the access module 430 is configured to obtain the unique service network address released by the active gateway, and access the network access platform according to the unique service network address to obtain the data service.
In an exemplary embodiment, the sending module 420 specifically includes an obtaining unit and a sending unit.
The acquisition unit is used for acquiring priority information contained in the received first state message;
the sending unit is used for sending the state modification message to the main gateway if the priority information indicates that the priority of the standby gateway is higher than the self priority of the main gateway.
In an exemplary embodiment, the sending module 420 specifically includes a recording unit.
The recording unit is used for recording the receiving time of the first state message.
The sending unit is further configured to send a state modification packet to the primary gateway if the first state packet sent by the primary gateway is not received within the preset duration.
In an exemplary embodiment, the apparatus further includes an update module 440.
The updating module 440 is configured to switch the access state of the standby gateway from the standby state to the active state, and update the priority information locally stored in the standby gateway.
In an exemplary embodiment, the first obtaining module 410 is further configured to obtain priority information of other gateways except the active gateway.
The access module 430 is further configured to, when the priority information indicates that the priority of the standby gateway is the highest, perform a step of acquiring the unique service network address released by the active gateway, and access the network access platform according to the unique service network address.
Fig. 9 shows another gateway switching apparatus 50 based on a network access platform, which includes a second obtaining module 510, a switching module 520, and a receiving module 530.
The second obtaining module 510 is configured to obtain a state modification packet sent by a standby gateway, where the main gateway is used to access a network access platform and obtain a data service;
the switching module 520 is configured to switch the access state of the switching module from the active state to the standby state according to the state modification packet, and release a unique service network address for accessing the network access platform;
the receiving module 530 is configured to suspend obtaining data services from the network access platform, and receive a first state packet sent by a target gateway whose access state is a primary state, where the first state packet is used to indicate a service state of the primary gateway.
It should be noted that the apparatus provided in the foregoing embodiment and the method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiment, and is not described again here.
In an exemplary embodiment, an electronic device includes:
a processor; and
a memory, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, implement the gateway switching method based on the network access platform in the above embodiments
In an exemplary embodiment, a computer readable storage medium has a computer program stored thereon, and when executed by a processor, the computer program implements the network access platform based gateway switching method in the above embodiments.
Fig. 10 is a block diagram illustrating a hardware configuration of an electronic device according to an example embodiment. It should be noted that the electronic device is only an example adapted to the present invention, and should not be considered as providing any limitation to the scope of the present invention. The electronic device is also not to be construed as necessarily dependent upon or having one or more components of the exemplary electronic device illustrated in fig. 10.
The hardware structure of the electronic device may be greatly different due to different configurations or performances, as shown in fig. 10, the server 600 includes: a power supply 610, an interface 630, at least one memory 650, and at least one Central Processing Unit (CPU) 670.
The power supply 610 is used for providing an operating voltage for each hardware device on the electronic device.
The interface 630 includes at least one wired or wireless network interface 631, at least one serial-to-parallel conversion interface 633, at least one input/output interface 635, and at least one USB interface 637, etc. for communicating with external devices.
The memory 650 is used as a carrier of resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., on which the stored resources include an operating system 651, application programs 653, data 655, etc., and the storage mode may be a transient storage mode or a permanent storage mode. The operating system 651 is used for managing and controlling hardware devices and application programs 653 on the electronic device to realize the calculation and processing of the mass data 655 by the central processing unit 670, and may be windows server, Mac OS XTM, unix, linux, FreeBSDTM, FreeRTOS, and the like. Application programs 653 are computer programs that perform at least one particular task based on operating system 651, and can include at least one module (not shown in FIG. 10), each of which can contain a sequence of computer-readable instructions for the electronic device. Data 655 may be configuration data stored on disk, etc.
The central processor 670 may include one or more processors and is arranged to communicate with the memory 650 via a bus for computing and processing the mass data 655 in the memory 650.
As described in detail above, the electronic device to which the present invention is applied will read a series of computer readable instructions stored in the storage device through the central processing unit 670 to complete the gateway switching method based on the network access platform.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A gateway switching method based on a network access platform is characterized in that the network access platform is used for providing data service for an accessed gateway, and the method comprises the following steps:
a standby gateway acquires a first state message periodically sent by a main gateway, wherein the main gateway is used for accessing the network access platform and acquiring data service, and the first state message is used for indicating the service state of the main gateway;
according to the received first state message, sending a state modification message to the main gateway, wherein the state modification message is used for indicating the main gateway to carry out access state switching and releasing a unique service network address for accessing the network access platform;
and acquiring the unique service network address released by the main gateway, and accessing the network access platform according to the unique service network address to acquire the data service.
2. The method of claim 1, wherein the sending a state modification packet to the active gateway according to the received first state packet comprises:
acquiring priority information contained in the received first state message;
and if the priority information indicates that the priority of the standby gateway is higher than the self priority of the main gateway, sending a state modification message to the main gateway.
3. The method of claim 1, wherein the sending a state modification packet to the active gateway according to the received first state packet comprises:
the standby gateway records the receiving time of the first state message;
and if the first state message sent by the main gateway is not received within the preset time length, sending a state modification message to the main gateway.
4. The method according to claim 1, wherein after acquiring the unique service network address released by the active gateway and accessing the network access platform according to the unique service network address, the method further comprises:
and switching the access state of the standby gateway from the standby state to the main state, and updating the priority information locally stored by the standby gateway.
5. The method of claim 1, further comprising:
acquiring priority information of other gateways except the main gateway;
and when the priority information indicates that the priority of the standby gateway is the highest, executing the steps of acquiring the unique service network address released by the main gateway and accessing the network access platform according to the unique service network address.
6. A gateway switching method based on a network access platform is characterized in that the network access platform is used for providing data service for an accessed gateway, and the method comprises the following steps:
a main gateway acquires a state modification message sent by a standby gateway, wherein the main gateway is used for accessing the network access platform and acquiring data service;
according to the state modification message, switching the self access state from the main state to a standby state, and releasing a unique service network address for accessing the network access platform;
and suspending the data service acquisition to the network access platform, and receiving a first state message sent by a target gateway with an access state being a main state, wherein the first state message is used for indicating the service state of the main gateway.
7. A gateway switching device based on a network access platform, the device comprising:
a first obtaining module, configured to obtain a first status packet periodically sent by a primary gateway, where the primary gateway is used to access the network access platform and obtain a data service, and the first status packet is used to indicate a service status of the primary gateway;
a sending module, configured to send a state modification packet to the master gateway according to the received first state packet, where the state modification packet is used to instruct the master gateway to perform access state switching, and release a unique service network address used for accessing the network access platform;
and the access module is used for acquiring the unique service network address released by the main gateway and accessing the network access platform according to the unique service network address so as to acquire the data service.
8. A gateway switching device based on a network access platform, the device comprising:
a second obtaining module, configured to obtain a state modification packet sent by a standby gateway, where the primary gateway is used to access the network access platform and obtain a data service;
the switching module is used for switching the self access state from the main state to the standby state according to the state modification message and releasing the unique service network address for accessing the network access platform;
a receiving module, configured to suspend obtaining the data service from the network access platform, and receive a first status packet sent by a target gateway whose access status is a primary status, where the first status packet is used to indicate a service status of the primary gateway.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1 to 6 via execution of the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 6.
CN202010734781.2A 2020-07-27 2020-07-27 Gateway switching method and device based on network access platform Pending CN111786840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010734781.2A CN111786840A (en) 2020-07-27 2020-07-27 Gateway switching method and device based on network access platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010734781.2A CN111786840A (en) 2020-07-27 2020-07-27 Gateway switching method and device based on network access platform

Publications (1)

Publication Number Publication Date
CN111786840A true CN111786840A (en) 2020-10-16

Family

ID=72766403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010734781.2A Pending CN111786840A (en) 2020-07-27 2020-07-27 Gateway switching method and device based on network access platform

Country Status (1)

Country Link
CN (1) CN111786840A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953926A (en) * 2021-02-05 2021-06-11 广东电网有限责任公司 Information interaction system, method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1531262A (en) * 2003-03-11 2004-09-22 ��Ϊ�������޹�˾ Network communication method for carrying out load division
WO2007051428A1 (en) * 2005-11-05 2007-05-10 Huawei Technologies Co., Ltd. A method and serving gateway for the service forwarding between the gateways in the serving network
CN110995398A (en) * 2019-12-02 2020-04-10 浙江明度智控科技有限公司 Redundant gateway control method and industrial gateway

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1531262A (en) * 2003-03-11 2004-09-22 ��Ϊ�������޹�˾ Network communication method for carrying out load division
WO2007051428A1 (en) * 2005-11-05 2007-05-10 Huawei Technologies Co., Ltd. A method and serving gateway for the service forwarding between the gateways in the serving network
CN110995398A (en) * 2019-12-02 2020-04-10 浙江明度智控科技有限公司 Redundant gateway control method and industrial gateway

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953926A (en) * 2021-02-05 2021-06-11 广东电网有限责任公司 Information interaction system, method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10715411B1 (en) Altering networking switch priority responsive to compute node fitness
CN109274707B (en) Load scheduling method and device
US8543692B2 (en) Network system
US11734138B2 (en) Hot standby method, apparatus, and system
US20070233855A1 (en) Adaptible keepalive for enterprise extenders
CN107135279B (en) Method and device for processing long connection establishment request
US7870425B2 (en) De-centralized nodal failover handling
US20100332212A1 (en) Method and apparatus for sleep and wake of computer devices
CN101102288A (en) A method and system for realizing large-scale instant message
GB2407887A (en) Automatically modifying fail-over configuration of back-up devices
WO2018121334A1 (en) Web application service providing method, apparatus, electronic device and system
CN111615066A (en) Distributed micro-service registration and calling method based on broadcast
US20150256622A1 (en) Connection management device, communication system, connection management method, and computer program product
CN112948128A (en) Target terminal selection method, system and computer readable medium
CN111786840A (en) Gateway switching method and device based on network access platform
US9967163B2 (en) Message system for avoiding processing-performance decline
CN110661836B (en) Message routing method, device and system, and storage medium
CN114900526B (en) Load balancing method and system, computer storage medium and electronic equipment
CN116932505A (en) Data query method, data writing method, related device and system
CN109510864B (en) Forwarding method, transmission method and related device of cache request
CN110830305A (en) Method and device for accessing wireless device to WIFI network, electronic device and storage medium
US11245752B2 (en) Load balancing in a high-availability cluster
CN114745221B (en) Modbus communication system and communication method
US20230254270A1 (en) Computer-readable recording medium storing program, information processing method, and information processing system
CN112804077B (en) Data protection method, controller, control plane device and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201016