CN113098706B - VPN server switching method and device based on cloud and storage medium - Google Patents

VPN server switching method and device based on cloud and storage medium Download PDF

Info

Publication number
CN113098706B
CN113098706B CN202110244431.2A CN202110244431A CN113098706B CN 113098706 B CN113098706 B CN 113098706B CN 202110244431 A CN202110244431 A CN 202110244431A CN 113098706 B CN113098706 B CN 113098706B
Authority
CN
China
Prior art keywords
vpn server
server
vpn
cloud
access request
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.)
Active
Application number
CN202110244431.2A
Other languages
Chinese (zh)
Other versions
CN113098706A (en
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.)
Shenzhen Genew Technologies Co Ltd
Original Assignee
Shenzhen Genew Technologies 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 Shenzhen Genew Technologies Co Ltd filed Critical Shenzhen Genew Technologies Co Ltd
Priority to CN202110244431.2A priority Critical patent/CN113098706B/en
Publication of CN113098706A publication Critical patent/CN113098706A/en
Application granted granted Critical
Publication of CN113098706B publication Critical patent/CN113098706B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a VPN server switching method, a VPN server switching device and a storage medium based on a cloud end, wherein the VPN server switching method comprises the following steps: establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as a primary server; monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server; and when the condition that the first VPN server sends heartbeat messages to the second VPN server is not monitored within the preset time, switching the second VPN server to be the main server. According to the invention, the first VPN server and the second VPN server are arranged, the first VPN server is arranged as the main server, and the second VPN server is switched to the main server when the first VPN server fails, so that the situation that the application cannot be used when the main server fails is avoided, and the user experience is improved.

Description

VPN server switching method and device based on cloud and storage medium
Technical Field
The invention relates to the technical field of networks, in particular to a VPN server switching method and device based on a cloud end and a storage medium.
Background
Many existing applications run at the cloud, for example, in some internet of things systems, a server is placed at the cloud, and various internet of things terminals run the applications through a VPN server connected with the cloud. Through the VPN technology, devices scattered around the world can construct a virtual local area network, thereby developing more specific and rich applications. For example, the camera can save the video data of self collection to the high in the clouds in real time through the VPN server of connecting the high in the clouds, and cell-phone APP can visit the video data of the real-time collection of the surveillance camera of thousands of miles away through the VPN server of connecting the high in the clouds. However, in the existing VPN technology, since the VPN server is fixed, if the VPN server has problems such as a crash, an automatic shutdown, and the like, the application operation will fail, and the user experience will be affected.
Thus, there is still a need for improvement and development of the prior art.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a cloud-based VPN server switching method, device and storage medium, aiming at solving the problem that the application operation is failed and the user experience is affected when a VPN server in the existing VPN technology is failed.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a cloud-based VPN server switching method, where the method includes:
establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as a primary server;
monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server;
and when the condition that the first VPN server sends heartbeat messages to the second VPN server is not monitored within the preset time, switching the second VPN server to be the main server.
The cloud-based VPN server switching method includes the steps of establishing communication between a first VPN server and a second VPN server:
acquiring a first internal private IP address and a second internal private IP address;
and distributing the first internal private IP address to a first internet access corresponding to the first VPN server, and distributing the second internal private IP address to a second internet access corresponding to the second VPN server.
The cloud-based VPN server switching method includes the following steps:
acquiring an external public network address;
and allocating the external public network address to a third network port corresponding to the first VPN server so as to configure the first VPN server as an active server.
The cloud-based VPN server switching method includes, after the step of configuring the first VPN server as an active server:
and controlling the first VPN server to receive an access request and send data corresponding to the access request through the external public network address.
The cloud-based VPN server switching method includes, after the step of controlling the first VPN server to receive an access request and send data corresponding to the access request via the external public network address:
and controlling the first VPN server to send the access request and the data corresponding to the access request to the second VPN server through the first internal private IP address.
The cloud-based VPN server switching method includes the steps of:
releasing the binding relationship between the third internet access and the external public network address;
and distributing the external public network address to a fourth network port corresponding to the second VPN server so as to switch the second VPN server to the main server.
The cloud-based VPN server switching method includes, after the step of switching the second VPN server to the active server:
and controlling the second VPN server to receive an access request and send data corresponding to the access request through the external public network address.
The cloud-based VPN server switching method includes, after the step of switching the second VPN server to the active server:
establishing communication between the second VPN server and a third VPN server;
and monitoring the communication state between the second VPN server and the third VPN server in real time through a heartbeat message sent between the second VPN server and the third VPN server.
In a second aspect, an embodiment of the present invention provides a cloud-based VPN server switching apparatus, including a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs configured to be executed by one or more processors include steps for executing the cloud-based VPN server switching method according to any one of the above-mentioned embodiments.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the steps of the cloud-based VPN server switching method described in any one of the above.
The invention has the beneficial effects that: the embodiment of the invention firstly establishes communication between the first VPN server and the second VPN server. Then, the first VPN server is configured as an active server. And then, monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server. And finally, when the heartbeat message sent by the first VPN server to the second VPN server is not monitored within the preset time, the second VPN server is switched to the primary server, so that the second VPN server is switched to the primary server by setting the first VPN server and the second VPN server and setting the first VPN server as the primary server when the first VPN server fails, the situation that the application cannot be used when the primary server fails is avoided, and user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a cloud-based VPN server switching method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart illustrating a process of establishing VPN server communication in the cloud-based VPN server switching method according to the embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a process of configuring a first VPN server as a primary server in the cloud-based VPN server switching method according to the embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating a process of configuring a second VPN server as a primary server in the cloud-based VPN server switching method according to the embodiment of the present invention;
fig. 5 is a schematic block diagram of an internal structure of the cloud-based VPN server switching device according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, back, 8230; etc.) are involved in the embodiment of the present invention, the directional indications are only used for explaining the relative positional relationship between the components, the motion situation, etc. in a specific posture (as shown in the figure), and if the specific posture is changed, the directional indications are correspondingly changed.
Many existing applications run at the cloud, especially some applications at the server, such as some internet of things systems, the server is placed at the cloud, the function of the VPN server is supported at the cloud, and various internet of things terminals are connected with a VPN server at the cloud. Through the VPN technology, devices scattered around the world can construct a virtual local area network, thereby developing more specific and rich applications. For example, the camera can save the video data of self collection to the high in the clouds in real time through the VPN server of connecting the high in the clouds, and cell-phone APP can visit the video data of the real-time collection of the surveillance camera of thousands of miles away through the VPN server of connecting the high in the clouds. However, in the existing VPN technology, since the VPN server is fixed, if the VPN server fails, such as a dead halt, an automatic shutdown, and the like, the application operation will fail, and the user experience will be affected. For example, if a VPN server at the cloud end fails, the camera cannot store video data acquired by the camera to the cloud end, and the mobile phone APP cannot access the video data acquired by the camera in real time.
In order to solve the problems in the prior art, this embodiment provides a cloud-based VPN server switching method, by which a second VPN server can be switched to a primary server when the primary server, that is, a first VPN server, fails, so that the problem that an application cannot be used when the primary server fails is avoided, and user experience is improved. In specific implementation, first, communication between the first VPN server and the second VPN server is established. And then, configuring the first VPN server as an active server. And then, monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server. And finally, when the heartbeat message sent by the first VPN server to the second VPN server is not monitored within the preset time, the second VPN server is switched to the primary server, so that the second VPN server is switched to the primary server by setting the first VPN server and the second VPN server and setting the first VPN server as the primary server when the first VPN server fails, the situation that the primary server fails in use is avoided, and user experience is improved.
Exemplary method
The present embodiment provides a cloud-based VPN server switching method, specifically as shown in fig. 1, the method includes:
step S100, establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as an active server.
In order to avoid that the VPN server has a problem and the application cannot run, in this embodiment, two VPN servers, that is, a first VPN server and a second VPN server, are applied to a cloud service provider, and both the first VPN server and the second VPN server are installed with VPN server software and an application program that supports switching between a main server and a standby server. In the operation process, firstly, communication between the first VPN server and the second VPN server is established, the first VPN server is configured as an active server, and the second VPN server is a standby server. In this embodiment, two VPN servers are set, and one of the VPN servers is configured as a primary server, so that when the primary server fails, the primary server can be switched to another VPN server, thereby ensuring normal operation of an application program and improving user experience.
In a specific embodiment, as shown in fig. 2, the step of establishing communication between the first VPN server and the second VPN server in step S100 includes:
step S110, a first internal private IP address and a second internal private IP address are obtained;
step S120, allocating the first internal private IP address to a first internet access corresponding to the first VPN server, and allocating the second internal private IP address to a second internet access corresponding to the second VPN server.
The first internet access and the second internet access are used for private communication between the first VPN server and the second VPN server, in this embodiment, a first internal private IP address and a second internal private IP address are preset, when communication between the first VPN server and the second VPN server is established, the first internal private IP address and the second internal private IP address are obtained, the first internal private IP address is allocated to a first internet access corresponding to the first VPN server, the second internal private IP address is allocated to a second internet access corresponding to the second VPN server, and after the internal private IP addresses are allocated to the first internet access and the second internet access, the first VPN server and the second VPN server can perform real-time communication through the first internet access and the second internet access configured with the internal private IP addresses. For example, the first internal private IP address is 192.168.100.1, the second internal private IP address is 192.168.100.2, and when communication between the first VPN server and the second VPN server is established, 192.168.100.1 is allocated to the first portal, and 192.168.100.2 is allocated to the second portal.
In a specific embodiment, as shown in fig. 3, the step of configuring the first VPN server as an active server in step S100 includes:
step S130, obtaining an external public network address;
step S140, allocating the external public network address to a third network port corresponding to the first VPN server, so as to configure the first VPN server as an active server.
Specifically, an external public network address is preset in this embodiment, the external public network address is used for the VPN server to communicate with each terminal of the internet of things, and the first VPN server is further provided with a third internet access for communicating with each terminal of the internet of things. When the first VPN server is configured as a primary server, an external public network address is firstly obtained, and then the external public network address is distributed to a third network port corresponding to the first VPN server. And the third internet access is an external internet access of the first VPN server, and after the external public network address is distributed to the third network, each internet of things terminal establishes connection with the first VPN server through VPN dialing. For example, the external public network address is 10.10.88.99, and after 10.10.88.99 is allocated to the third internet access, the connection between the camera and the mobile phone APP and the first VPN server can be established through VPN dialing.
In a specific embodiment, after the step of configuring the first VPN server as the active server in step S100, the step includes:
step S150, controlling the first VPN server to receive an access request and send data corresponding to the access request through the external public network address.
In the foregoing step, after the external public network address is allocated to the third port corresponding to the first VPN server, each internet of things terminal may establish a connection with the first VPN server through VPN dialing. After the internet of things terminals are connected with the first VPN server, each internet of things terminal can send an access request to the first VPN server and receive data corresponding to the access request returned by the first VPN server, and the first VPN server can also receive the access request sent by the internet of things terminals and send the data corresponding to the access request to the internet of things terminals. For example, after the camera and the mobile phone APP can establish connection with the first VPN server through VPN dialing, the camera can store video data acquired by the camera to a cloud end, the mobile phone APP requests the cloud end for the video data acquired by the camera, and the cloud end receives an access request of the mobile phone APP through the first VPN server and sends the video data acquired by the camera to the mobile phone.
In a specific embodiment, after the step of configuring the first VPN server as the active server in step S100, the method further includes:
step S160, controlling the first VPN server to send the access request and the data corresponding to the access request to the second VPN server through the first internal private IP address.
In order to continue to receive an access request and send data corresponding to the access request through a second VPN server after a failure occurs in a first VPN server, in this embodiment, while controlling the first VPN server to receive the access request and send the data corresponding to the access request through the external public network address, the first VPN server is also controlled to send the access request and the data corresponding to the access request to the second VPN server through the first internal private IP address in real time, so that when the first VPN server fails, the second VPN server can continue to receive the access request and send the data corresponding to the access request.
Step S200, monitoring the communication state between the first VPN server and the second VPN server in real time through the heartbeat message sent between the first VPN server and the second VPN server.
In order to monitor whether the first VPN server, i.e., the primary server, fails in real time, in this embodiment, a heartbeat-plus-measurement mechanism is used to monitor a communication state between the first VPN server and the second VPN server in real time, and after communication between the first VPN server and the second VPN server is established, the first VPN server and the second VPN server mutually send heartbeat messages through the first network port and the second network port. The communication state between the first VPN server and the second VPN server can be monitored in real time through heartbeat messages sent between the first VPN server and the second VPN server. For example, when the first VPN server does not receive a heartbeat message sent by the second VPN server within a preset time, it is described that the second VPN server has a problem; when the second VPN server does not receive the heartbeat message sent by the first VPN server within the preset time, the first VPN server is proved to have a problem.
Step 300, when it is not monitored that the first VPN server sends a heartbeat message to the second VPN server within a preset time, switching the second VPN server to be the primary server.
Specifically, in this embodiment, when it is not monitored that the first VPN server sends a heartbeat packet to the second VPN server within a preset time, it is considered that the first VPN server fails, and at this time, the first VPN server, as a master server, cannot receive an access request sent by each internet of things terminal and send data corresponding to the access request, so that the second VPN server is switched to a master server, and the second VPN server receives the access request and sends the data corresponding to the access request continuously, so that normal operation of an application program is ensured, and user experience is improved. In a specific embodiment, the first VPN server and the second VPN server are configured to send heartbeat messages to each other every 1 second, and when it is not monitored for 3 consecutive times that the first VPN server sends heartbeat messages to the second VPN server, that is, when it is not monitored that the first VPN server sends heartbeat messages to the second VPN server within 3 consecutive seconds, it is considered that the first VPN server fails.
In a specific embodiment, as shown in fig. 4, the step of switching the second VPN server to the active server in step S300 includes:
step S310, removing the binding relation between the third internet access and the external public network address;
step S320, allocating the external public network address to a fourth network port corresponding to the second VPN server, so as to switch the second VPN server to the active server.
Specifically, the fourth network port is an external network port corresponding to the second VPN server, and when it is not monitored that the first VPN server sends a heartbeat packet to the second VPN server within a preset time, the binding relationship between the third network port and the external public network address is released, and the external public network address is allocated to the fourth network port, that is, the primary server is switched from the first VPN server to the second VPN server. For example, the external public network address is 10.10.88.99, and when it is not detected that the first VPN server sends the heartbeat message to the second VPN server within the preset time, the binding relationship between the third network port and the 10.10.88.99 is released, and 10.10.88.99 is allocated to the fourth network port.
In a specific embodiment, after step S310, the method further includes:
step S330, controlling the second VPN server to receive an access request and send data corresponding to the access request through the external public network address.
After the external public network address is distributed to the fourth internet access corresponding to the second VPN server, the connection between each Internet of things terminal and the first VPN server is interrupted due to time-out, and the connection between each Internet of things terminal and the second VPN server can be established by carrying out VPN dialing again. After the internet of things terminals are connected with the second VPN server, each internet of things terminal can send an access request to the second VPN server and receive data corresponding to the access request returned by the second VPN server, and the second VPN server can also receive the access request sent by the internet of things terminal and send the data corresponding to the access request to the internet of things terminal. For example, after the first VPN server fails, the connection between the camera and the first VPN server and the connection between the mobile phone APP and the first VPN server may be interrupted due to time out, after the connection between the camera and the second VPN server is established through VPN dialing, the camera may continue to store the acquired video data to the cloud through the second VPN server, and the mobile phone APP may continue to access the video data acquired by the camera through the second VPN server.
In a specific embodiment, after the step of switching the second VPN server to the active server in step S300, the method includes:
step M310, establishing communication between the second VPN server and a third VPN server;
step M320, monitoring a communication state between the second VPN server and the third VPN server in real time through the heartbeat packet sent between the second VPN server and the third VPN server.
In order to avoid interruption of the application program caused by a failure of the second VPN server, in this embodiment, after the second VPN server is configured as the active server, communication between the second VPN server and the third VPN server is further established, which includes the steps of removing the binding relationship between the first internet access and the first internal private IP address, and allocating the first internal private IP address to a fifth internet access corresponding to the third VPN server. After communication between the second VPN server and the third VPN server is established, the communication state between the second VPN server and the third VPN server is monitored in real time through a heartbeat message sent between the second VPN server and the third VPN server, and when the heartbeat message sent from the second VPN server to the third VPN server is not monitored within a preset time, the third VPN server is switched to be the active server, where a method for switching the third VPN server to be the active server is similar to the aforementioned method for switching the second VPN server to be the active server, that is, the external public network address is allocated to a sixth network port corresponding to the third VPN server.
It can be seen that embodiments of the present invention first establish communication between a first VPN server and a second VPN server. And then, configuring the first VPN server as an active server. And then, monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server. And finally, when the heartbeat message sent by the first VPN server to the second VPN server is not monitored within the preset time, the second VPN server is switched to the primary server, so that the second VPN server is switched to the primary server by setting the first VPN server and the second VPN server and setting the first VPN server as the primary server when the first VPN server fails, the situation that the application cannot be used when the primary server fails is avoided, and user experience is improved.
Exemplary device
Based on the above embodiment, the present invention further provides a cloud-based VPN server switching device, and a schematic block diagram thereof may be as shown in fig. 5. The device comprises a processor, a memory, a network interface, a display screen and a temperature sensor which are connected through a system bus. Wherein the processor of the device is configured to provide computational and control capabilities. The memory of the device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a cloud-based VPN server switching method. The display screen of the device can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the device is arranged in the device in advance and used for detecting the operating temperature of internal equipment.
It will be appreciated by those skilled in the art that the block diagram shown in fig. 5 is a block diagram of only a portion of the structure associated with the inventive arrangements and is not intended to limit the devices to which the inventive arrangements may be applied, and that a particular device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a cloud-based VPN server switching apparatus is provided, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and wherein the one or more programs configured to be executed by one or more processors include instructions for:
establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as a primary server;
monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server;
and when the condition that the first VPN server sends heartbeat messages to the second VPN server is not monitored within the preset time, switching the second VPN server to be the main server.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
In summary, the present invention discloses a method, an apparatus and a storage medium for switching a VPN server based on a cloud, including: establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as a primary server; monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server; and when the condition that the first VPN server sends heartbeat messages to the second VPN server is not monitored within the preset time, switching the second VPN server to be the main server. According to the invention, the first VPN server and the second VPN server are arranged, the first VPN server is arranged as the main server, and the second VPN server is switched to the main server when the first VPN server fails, so that the situation that the application cannot be used when the main server fails is avoided, and the user experience is improved.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (7)

1. A VPN server switching method based on cloud is characterized by comprising the following steps:
establishing communication between a first VPN server and a second VPN server, and configuring the first VPN server as a primary server;
monitoring the communication state between the first VPN server and the second VPN server in real time through a heartbeat message sent between the first VPN server and the second VPN server;
when the first VPN server is not monitored to send heartbeat messages to the second VPN server within preset time, the second VPN server is switched to be a main server;
the step of establishing communication between the first VPN server and the second VPN server comprises:
acquiring a first internal private IP address and a second internal private IP address;
the first internal private IP address is distributed to a first internet access corresponding to the first VPN server, and the second internal private IP address is distributed to a second internet access corresponding to the second VPN server;
the step of configuring the first VPN server as an active server includes:
acquiring an external public network address;
distributing the external public network address to a third network port corresponding to the first VPN server so as to configure the first VPN server as a main server;
presetting that a first VPN server and a second VPN server mutually send heartbeat messages every other 1 second, and when the condition that the first VPN server sends the heartbeat messages to the second VPN server is not monitored for 3 times continuously, determining that the first VPN server fails;
the step of switching the second VPN server to the active server includes:
establishing communication between the second VPN server and a third VPN server;
and monitoring the communication state between the second VPN server and the third VPN server in real time through the heartbeat message sent between the second VPN server and the third VPN server.
2. The cloud-based VPN server switching method according to claim 1, wherein said step of configuring said first VPN server as an active server comprises, after said step of configuring said first VPN server as an active server:
and controlling the first VPN server to receive an access request and send data corresponding to the access request through the external public network address.
3. The cloud-based VPN server switching method according to claim 2, wherein said step of controlling said first VPN server to receive an access request and to send data corresponding to said access request via said external public network address comprises, after said step of controlling said first VPN server to receive an access request and to send data corresponding to said access request:
and controlling the first VPN server to send the access request and the data corresponding to the access request to the second VPN server through the first internal private IP address.
4. The cloud-based VPN server switching method according to claim 3, wherein said step of switching said second VPN server to said active server comprises:
releasing the binding relationship between the third internet access and the external public network address;
and distributing the external public network address to a fourth network port corresponding to the second VPN server so as to switch the second VPN server to the main server.
5. The cloud-based VPN server switching method according to claim 1, wherein said step of switching said second VPN server to said active server comprises, after said step of switching said second VPN server to said active server:
and controlling the second VPN server to receive an access request and send data corresponding to the access request through the external public network address.
6. A cloud-based VPN server switching apparatus, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory, and wherein the one or more programs configured to be executed by the one or more processors comprise steps for performing the cloud-based VPN server switching method according to any one of claims 1-5.
7. A computer-readable storage medium having instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the steps of the cloud-based VPN server switching method according to any of claims 1-5.
CN202110244431.2A 2021-03-05 2021-03-05 VPN server switching method and device based on cloud and storage medium Active CN113098706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110244431.2A CN113098706B (en) 2021-03-05 2021-03-05 VPN server switching method and device based on cloud and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110244431.2A CN113098706B (en) 2021-03-05 2021-03-05 VPN server switching method and device based on cloud and storage medium

Publications (2)

Publication Number Publication Date
CN113098706A CN113098706A (en) 2021-07-09
CN113098706B true CN113098706B (en) 2023-03-24

Family

ID=76666660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110244431.2A Active CN113098706B (en) 2021-03-05 2021-03-05 VPN server switching method and device based on cloud and storage medium

Country Status (1)

Country Link
CN (1) CN113098706B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691394B (en) * 2021-07-29 2023-07-21 广州鲁邦通物联网科技股份有限公司 VPN communication establishing and switching method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400087A (en) * 2020-02-26 2020-07-10 深圳震有科技股份有限公司 Control method of operating system, terminal and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202655B (en) * 2006-12-12 2011-05-11 华为技术有限公司 Method and device for heartbeat detecting used for backup soft switching equipment with each other
US8020203B2 (en) * 2007-12-03 2011-09-13 Novell, Inc. Techniques for high availability of virtual private networks (VPN's)
CN108880866A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of network service system
CN112436994B (en) * 2020-11-17 2022-04-19 联想(北京)有限公司 Data transmission method and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400087A (en) * 2020-02-26 2020-07-10 深圳震有科技股份有限公司 Control method of operating system, terminal and storage medium

Also Published As

Publication number Publication date
CN113098706A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
WO2020093500A1 (en) Intelligent scheduling method, terminal device, edge node cluster and intelligent scheduling system
US10983880B2 (en) Role designation in a high availability node
CN107645529B (en) Heartbeat packet sending method and device
CN111367662B (en) Load balancing method, device and system
CN113300985A (en) Data processing method, device, equipment and storage medium
CN113132434B (en) Distributed service processing method, device, equipment and storage medium
CN113098706B (en) VPN server switching method and device based on cloud and storage medium
CN112511598A (en) Screen projection display method, intelligent terminal and storage medium
CN115103008B (en) Service request forwarding system
CN110968356A (en) Method and device for acquiring configuration information
CN112398689A (en) Network recovery method and device, storage medium and electronic equipment
US9344363B2 (en) Information processing system, relay device, information processing device, and information processing method
CN111629016A (en) Control method, device and system
CN112333028A (en) Dynamic processing method, device, terminal and medium for multi-network coexistence
CN113612814B (en) Session information screening method, device, terminal and storage medium
CN112202927B (en) Long connection establishing method and device, computer equipment and storage medium
CN111211925B (en) Alarm information synchronization method and device, computer equipment and storage medium
CN111162952A (en) Equipment fault tolerance method and device
KR101432326B1 (en) Host posing network device and method thereof
CN113992685B (en) Service controller determining method, system and device
CN112822729B (en) Edge service switching method and edge management system
CN117170983B (en) Disaster recovery switching method, system, computer equipment and storage medium
CN114556891A (en) Method, device, equipment and storage medium for determining equipment state
CN111209145A (en) Virtual machine disaster tolerance-based service self-healing method, equipment and storage medium
CN116828022B (en) Method, device, equipment and medium for managing connection relation with server

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
GR01 Patent grant
GR01 Patent grant