CN111200512A - Network connection disaster tolerance method, terminal device, storage medium and electronic device - Google Patents

Network connection disaster tolerance method, terminal device, storage medium and electronic device Download PDF

Info

Publication number
CN111200512A
CN111200512A CN201811383554.9A CN201811383554A CN111200512A CN 111200512 A CN111200512 A CN 111200512A CN 201811383554 A CN201811383554 A CN 201811383554A CN 111200512 A CN111200512 A CN 111200512A
Authority
CN
China
Prior art keywords
address
virtual
alternative
network
remote server
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.)
Granted
Application number
CN201811383554.9A
Other languages
Chinese (zh)
Other versions
CN111200512B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811383554.9A priority Critical patent/CN111200512B/en
Publication of CN111200512A publication Critical patent/CN111200512A/en
Application granted granted Critical
Publication of CN111200512B publication Critical patent/CN111200512B/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/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Landscapes

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

Abstract

The invention provides a network connection disaster recovery method, terminal equipment, a storage medium and electronic equipment. The network connection disaster recovery method provided by the embodiment of the invention comprises the following steps: firstly, whether a terminal device receives a virtual IP address list sent by a first remote server is judged, if so, a first network request is sent according to a main virtual IP address in the virtual IP address list, and when the first network request fails, each alternative virtual IP address in an alternative virtual IP address set is sequentially dialed and tested to determine a first alternative virtual IP address which can access a second remote server in the alternative virtual IP address set, and then a second network request is sent according to the first alternative virtual IP address. The invention provides a network connection disaster recovery method which can carry out self-repair on the network connection of a client when the client has network abnormality, thereby recovering the normal data interaction of the client.

Description

Network connection disaster tolerance method, terminal device, storage medium and electronic device
Technical Field
The present invention relates to the field of mobile terminal network communication technologies, and in particular, to a network connection disaster recovery method, a terminal device, a storage medium, and an electronic device.
Background
With the wide popularization of mobile terminals in the mobile internet era, the dependence of users on application clients in the mobile terminals is also increasing day by day. Therefore, each mobile terminal can not leave the instant communication with the server, especially the novel online sales mode of e-commerce, and the smoothness of the mobile terminal network plays a crucial role in the whole transaction process.
In order to ensure that users located in different Network environments can normally access services in corresponding application clients through mobile terminals, a service provider of an application client generally needs to deploy a distributed Content Delivery Network (CDN) and multiple machine rooms to ensure Network reliability. However, in an actual application process, due to factors such as the area where the user is located and the difference between the selected network operators, it cannot be guaranteed that all network connections corresponding to the application client are available.
When a machine room to which an application client is currently connected fails, network connection failure of the application client is directly caused, and in the prior art, the application client only prompts a user that the current network cannot be accessed or initiates request retry, but cannot automatically repair network connection.
Disclosure of Invention
The invention provides a network connection disaster recovery method, terminal equipment, a storage medium and electronic equipment, which are used for self-repairing network connection of an application client when the network connection of the client is abnormal, so that normal data interaction of the application is recovered.
In a first aspect, an embodiment of the present invention provides a network connection disaster recovery method, including:
judging whether a terminal device receives a virtual IP address list sent by a first remote server or not, wherein the virtual IP address list comprises: the network connection method comprises the steps that a standby virtual IP address set and a main virtual IP address are adopted, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection;
if the judgment result is yes, sending a first network request according to the main virtual IP address;
when the first network request fails, dial testing is carried out on each alternative virtual IP address in the alternative virtual IP address set in sequence to determine a first alternative virtual IP address which can access the second remote server side in the alternative virtual IP address set;
and sending a second network request according to the first alternative virtual IP address.
In one possible design, the sequentially testing each alternative virtual IP address in the alternative virtual IP address set to determine a first alternative virtual IP address that can access a second remote server in the alternative virtual IP address set includes:
sequentially testing each alternative virtual IP address in the alternative virtual IP address set to acquire connection performance data corresponding to each alternative virtual IP address;
and determining the virtual IP address with the optimal connection performance data in the alternative virtual IP address set as the first alternative virtual IP address.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the first candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
In one possible design, after the sending the second network request according to the first alternative virtual IP address, the method further includes:
judging whether the second network request is successful;
if the judgment result is negative, network retry is initiated through the domain name system analysis technology.
In a possible design, after the determining whether the terminal device receives the virtual IP address list sent by the first remote server, the method further includes:
if the terminal equipment does not receive the virtual IP address list sent by the first remote server, dial testing is carried out on each built-in virtual IP address in a built-in virtual IP address set in sequence to determine a second alternative virtual IP address which can access the second remote server in the alternative virtual IP address set, wherein the built-in virtual IP address set is preset in the terminal equipment;
and sending a third network request according to the second alternative virtual IP address.
In one possible design, the sequentially testing each internal virtual IP address in the set of internal virtual IP addresses to determine a second alternative virtual IP address in the set of alternative virtual IP addresses that can access the second remote server includes:
sequentially testing each built-in virtual IP address in the built-in virtual IP address set to acquire connection performance data corresponding to each built-in virtual IP address;
and determining the virtual IP address with the optimal connection performance data in the built-in virtual IP address set as the second alternative virtual IP address.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the second candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
In one possible design, after the sending the third network request according to the second alternative virtual IP address, the method further includes:
judging whether the third network request is successful;
if the judgment result is negative, network retry is initiated through the domain name system analysis technology.
In a second aspect, the present invention further provides a terminal device, including:
the list receiving and judging module is used for judging whether the terminal equipment receives a virtual IP address list sent by a first remote server, wherein the virtual IP address list comprises: the network connection method comprises the steps that a standby virtual IP address set and a main virtual IP address are adopted, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection;
a network request sending module, configured to send a first network request according to the primary virtual IP address;
an IP address dial testing module, configured to, when the first network request fails, sequentially perform dial testing on each alternative virtual IP address in the alternative virtual IP address set to determine a first alternative virtual IP address in the alternative virtual IP address set, where the first alternative virtual IP address can access the second remote server;
the network request sending module is further configured to send a second network request according to the first alternative virtual IP address.
In one possible design, the IP address dial testing module includes:
the connection performance acquisition submodule is used for carrying out dial test on each alternative virtual IP address in the alternative virtual IP address set in sequence so as to acquire connection performance data corresponding to each alternative virtual IP address;
and the IP address determining submodule is used for determining the virtual IP address with the optimal connection performance data in the alternative virtual IP address set as the first alternative virtual IP address.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the first candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
In one possible design, the terminal device further includes:
the network connection judging module is used for judging whether the second network request is successful or not;
and the network retry request module is used for initiating network retry through a domain name system resolution technology when the second network request fails.
In a possible design, the IP address dial testing module is further configured to, when the terminal device does not receive the virtual IP address list sent by the first remote server, sequentially dial-test each built-in virtual IP address in a built-in virtual IP address set to determine a second alternative virtual IP address that can access the second remote server in the alternative virtual IP address set, where the built-in virtual IP address set is preset in the terminal device;
and the network request sending module is used for sending a third network request according to the second alternative virtual IP address.
In one possible design, the IP address dial testing module includes:
the connection performance acquisition submodule is used for carrying out dial testing on each built-in virtual IP address in the built-in virtual IP address set in sequence so as to acquire connection performance data corresponding to each built-in virtual IP address;
and the IP address determining submodule determines the virtual IP address with the optimal connection performance data in the built-in virtual IP address set as the second alternative virtual IP address.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the second candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
In one possible design, the terminal device further includes:
the network connection judging module is used for judging whether the third network request is successful or not;
and the network retry request module is used for initiating network retry through a domain name system resolution technology when the third network request fails.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
a processor; and the number of the first and second groups,
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform any one of the possible network connection disaster recovery methods of the first aspect via execution of the executable instructions.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement any one of the possible network connection disaster recovery methods in the first aspect.
In the network connection disaster recovery method, the terminal device, the storage medium, and the electronic device provided in the embodiments of the present invention, when a user starts an application client in the terminal device, a corresponding virtual IP address list is obtained from a remote server in a network request manner, where the virtual IP address list includes: the method comprises the steps that an alternative virtual IP address set and a main virtual IP address are included, the alternative virtual IP address set comprises at least one alternative virtual IP address, the main virtual IP address is a preferred IP address for establishing network connection, then a first network request is sent according to the main virtual IP address in a virtual IP address list, if the first network request fails, dial testing is carried out on each alternative virtual IP address in the alternative virtual IP address set in sequence to determine a first alternative virtual IP address capable of accessing a remote server in the alternative virtual IP address set, then a second network request is sent according to the first alternative virtual IP address, when a first remote server corresponding to the current main virtual IP address fails, the alternative virtual IP address can be used for scheduling, so that flow is led to other normal second remote servers, and network connection of a client side is self-repaired, thereby restoring normal data interaction for the application and reducing the probability of the online user complaint network being unavailable.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a diagram illustrating an application scenario of a network connection disaster recovery method according to an exemplary embodiment of the present invention;
fig. 2 is a flow chart illustrating a network connection disaster recovery method according to an example embodiment of the present invention;
fig. 3 is a flow chart illustrating a network connection disaster recovery method according to another example embodiment of the present invention;
FIG. 4 is a block diagram of a terminal device according to an example embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to another exemplary embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to yet another exemplary embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device shown in accordance with an example embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a diagram illustrating an application scenario of a network connection disaster recovery method according to an example embodiment of the present invention. As shown in fig. 1, the network connection disaster recovery method provided by the embodiment of the present invention is executed by a terminal device 1, where the terminal device 1 may be an electronic device with data processing and display functions, such as a smart phone, a tablet computer, and a personal computer. Wherein, the terminal device 1 is provided with an application client, for example: a Jingdong client, a Taobao client, a WeChat client and the like. The application client usually corresponds to a plurality of remote servers, and it should be understood that the remote servers may be a plurality of rooms provided by the application service provider, such as a first remote server 21 for internet access through mobile data, a second remote server 22 for internet access through internet data, and a third remote server 23 for internet access through telecommunication data.
In the prior art, when a mobile user accesses the internet through an application client, the first remote server 21 corresponding to mobile data is usually connected, and when a machine room of the first remote server 21 connected to the application client at present fails and cannot access the internet, network connection failure of the application client is directly caused. The actual representation of this type of network connection failure in the terminal device 1 is illustrated below by way of example, for example:
in the first situation, when the mobile terminal 1 of the user is in a WIFI environment, the Jingdong client can normally access the Internet, but when the user transfers the current connection network to a mobile 4G environment, the Jingdong client cannot access the Internet;
in the second case, when the mobile terminal 1 of the user is in the area a, the kyoto client can normally access the internet, but after the user moves to the area B, the kyoto client cannot normally access the internet;
and in the third case, other application clients on the user mobile terminal 1 can access the internet, and only the Jingdong client method normally accesses the internet.
In the prior art, once the network connection fails, the application client only prompts the user that the current network cannot be accessed, or initiates a request retry, but cannot automatically repair the network connection.
In the network connection disaster recovery method provided in this embodiment, when the primary virtual IP address corresponding to the terminal device 1 fails in the network connection, another alternative virtual IP address is selected from the alternative virtual IP address set, and then a network request is reinitiated according to the alternative virtual IP address. For example, when a first remote server 21 corresponding to the kyoto client and performing internet access through mobile data fails, the network request of the kyoto client may be directed to a normal server, for example, the first remote server 22, so that it is ensured that the user can normally use the application client to perform internet access, and disaster tolerance of the application client is greatly enhanced.
Fig. 2 is a flowchart illustrating a network connection disaster recovery method according to an example embodiment of the present invention. As shown in fig. 2, the network connection disaster recovery method provided in this embodiment includes:
step 101, judging whether the terminal device receives a virtual IP address list sent by a first remote server. If yes, executing step 102; if the judgment result is no, the process is ended.
Specifically, when the terminal device starts a corresponding application client, a network request is initiated to the first remote server to obtain a virtual IP address list sent by the first remote server through the network interface, and the network request may be successful or failed, so that after the terminal device initiates the network request, it is further determined whether the terminal device receives the virtual IP address list sent by the first remote server, where the virtual IP address list includes: the network connection system comprises a standby virtual IP address set and a main virtual IP address, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection.
Illustratively, a virtual IP address is an IP address that is not connected to a particular computer or to a network interface card in a computer. Packets are sent to this virtual IP address, but all data is still passed through the real network interface.
Step 102, sending a first network request according to the primary virtual IP address.
After receiving the virtual IP address list sent by the first remote server, the terminal device first sends a first network request according to the master virtual IP address in the virtual IP address list, and obtains a specific state of whether the first network request is successfully connected.
And 103, sequentially testing each alternative virtual IP address in the alternative virtual IP address set to determine a first alternative virtual IP address.
Specifically, when an application layer network request fails in a first network request, a dial test may be performed on each alternative virtual IP in an alternative virtual IP address set in sequence, where the dial test is, understandably, a connectivity test of a Transmission Control Protocol (TCP) layer for each alternative virtual IP, so as to obtain a connection performance of accessing a remote server in the network environment.
After each alternative virtual IP in the alternative virtual IP address set is subjected to dial test, a first alternative virtual IP address which can access the second remote server side in the alternative virtual IP address set is determined.
In addition, in a specific selection manner for the first candidate virtual IP address, each candidate virtual IP address in the candidate virtual IP address set may be sequentially subjected to dial testing to obtain connection performance data corresponding to each candidate virtual IP address, and then, a virtual IP address with the optimal connection performance data in the candidate virtual IP address set is determined as the first candidate virtual IP address.
In another possible design, the connection performance data may be an access rate of accessing the remote server, and the first candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
And 104, sending a second network request according to the first alternative virtual IP address.
After determining the first alternative virtual IP address from the set of alternative virtual IP addresses, the second network request may be sent according to the first alternative virtual IP address. Therefore, when a first remote server corresponding to the current main virtual IP address breaks down, the standby virtual IP address can be used for scheduling, so that the flow is led to other normal second remote servers, and the probability that the online user complaint network is unavailable is reduced.
In this embodiment, when a user starts an application client in a terminal device, a virtual IP address list is obtained from a remote server in a network request manner, where the virtual IP address list includes: the method comprises the steps that an alternative virtual IP address set and a main virtual IP address are included, the alternative virtual IP address set comprises at least one alternative virtual IP address, the main virtual IP address is a preferred IP address for establishing network connection, then a first network request is sent according to the main virtual IP address in a virtual IP address list, if the first network request fails, dial testing is carried out on each alternative virtual IP address in the alternative virtual IP address set in sequence to determine a first alternative virtual IP address capable of accessing a remote server in the alternative virtual IP address set, then a second network request is sent according to the first alternative virtual IP address, when a first remote server corresponding to the current main virtual IP address fails, the alternative virtual IP address can be used for scheduling, so that flow is led to other normal second remote servers, and network connection of a client side is self-repaired, thereby restoring normal data interaction for the application and reducing the probability of the online user complaint network being unavailable.
Fig. 3 is a flowchart illustrating a network connection disaster recovery method according to another exemplary embodiment of the present invention. As shown in fig. 3, the network connection disaster recovery method provided in this embodiment includes:
step 201, judging whether the terminal device receives a virtual IP address list sent by the first remote server. If yes, go to step 202; if the determination result is negative, step 207 is executed.
Step 202, sending a first network request according to the primary virtual IP address.
Step 203, performing dial testing on each alternative virtual IP address in the alternative virtual IP address set in sequence to determine a first alternative virtual IP address.
And step 204, sending a second network request according to the first alternative virtual IP address.
The specific implementation manner of steps 201-204 refers to the description of steps 101-104 in the first embodiment, and is not described herein again.
Step 205, determine whether the network connection is successful. If the determination result is negative, go to step 206; if the judgment result is yes, the flow is ended.
And after the second network request is sent according to the first alternative virtual IP address, acquiring the specific state whether the connection of the second network request is successful.
Step 206, initiating a network retry by domain name system resolution.
If the second network request still fails to be connected, the network retry may be performed by using the dns resolution technique, and a specific resolution algorithm for performing the network retry by using the dns resolution technique is the prior art, which is not described in detail in this embodiment.
And step 207, performing dial testing on each built-in virtual IP address in the built-in virtual IP address set in sequence to determine a second alternative virtual IP address.
After the step 201, if the terminal device does not receive the virtual IP address list sent by the remote server, it sequentially performs dial testing on each internal virtual IP address in the internal virtual IP address set to determine a second alternative virtual IP address capable of accessing the remote server in the alternative virtual IP address set, where the internal virtual IP address set is preset in the terminal device, and for each different application client, different internal virtual IP address sets are usually set in the application client, respectively.
In addition, in a specific selection manner for the second candidate virtual IP address, each built-in virtual IP address in the built-in virtual IP address set may be sequentially subjected to dial testing to obtain connection performance data corresponding to each built-in virtual IP address, and then, a virtual IP address with the optimal connection performance data in the built-in virtual IP address set is determined as the second candidate virtual IP address.
In another possible design, the connection performance data may be an access rate for accessing the remote server, and the second candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
Step 208, sending a third network request according to the second alternative virtual IP address.
And when the terminal equipment does not receive the virtual IP address list sent by the first remote server, which indicates that the terminal equipment cannot communicate with the first remote server, sending a third network request according to a second alternative virtual IP address in the built-in virtual IP address set. Therefore, when the main virtual IP address can not be directly in communication connection with the corresponding first remote server, the second alternative virtual IP address can be selected from the built-in virtual IP address set arranged in the terminal equipment, so that the flow is led to other normal second remote servers, and the probability that the on-line user complaint network is unavailable is reduced.
Fig. 4 is a schematic structural diagram of a terminal device according to an exemplary embodiment of the present invention. As shown in fig. 4, the terminal device provided in this embodiment includes:
a list receiving and determining module 301, configured to determine whether a terminal device receives a virtual IP address list sent by a first remote server, where the virtual IP address list includes: the network connection method comprises the steps that a standby virtual IP address set and a main virtual IP address are adopted, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection;
a network request sending module 302, configured to send a first network request according to the primary virtual IP address;
an IP address dial testing module 303, configured to, when the first network request fails, sequentially perform dial testing on each alternative virtual IP address in the alternative virtual IP address set to determine a first alternative virtual IP address that can access the second remote server in the alternative virtual IP address set;
the network request sending module 302 is further configured to send a second network request according to the first alternative virtual IP address.
On the basis of the embodiment shown in fig. 4, fig. 5 is a schematic structural diagram of a terminal device according to another exemplary embodiment of the present invention. As shown in fig. 5, the IP address dial testing module 303 in the terminal device provided in this embodiment includes:
a connection performance obtaining submodule 3031, configured to perform dial testing on each alternative virtual IP address in the alternative virtual IP address set in sequence, so as to obtain connection performance data corresponding to each alternative virtual IP address;
an IP address determining submodule 3032, configured to determine, as the first candidate virtual IP address, a virtual IP address in the candidate virtual IP address set, where the connection performance data is optimal.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the first candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
On the basis of the embodiment shown in fig. 5, fig. 6 is a schematic structural diagram of a terminal device according to yet another exemplary embodiment of the present invention. As shown in fig. 6, in a possible design, the terminal device further includes:
a network connection determining module 304, configured to determine whether the second network request is successful;
a network retry request module 305, configured to initiate a network retry through domain name system resolution technology when the second network request fails.
In a possible design, the IP address dial testing module 303 is further configured to, when the terminal device does not receive the virtual IP address list sent by the first remote server, sequentially dial each built-in virtual IP address in a built-in virtual IP address set to determine a second alternative virtual IP address that can access the second remote server in the alternative virtual IP address set, where the built-in virtual IP address set is preset in the terminal device;
the network request sending module 302 is configured to send a third network request according to the second alternative virtual IP address.
In one possible design, the IP address dial testing module 303 includes:
a connection performance obtaining submodule 3031, configured to perform dial testing on each built-in virtual IP address in the built-in virtual IP address set in sequence, so as to obtain connection performance data corresponding to each built-in virtual IP address;
the IP address determining submodule 3032 determines the virtual IP address with the optimal connection performance data in the built-in virtual IP address set as the second candidate virtual IP address.
In one possible design, the connection performance data is an access rate of accessing the second remote server, and the second candidate virtual IP address is a virtual IP address with the highest access rate in the set of virtual IP addresses.
In one possible design, the terminal device further includes:
a network connection determining module 304, configured to determine whether the third network request is successful;
a network retry request module 305, configured to initiate a network retry through domain name system resolution technology when the third network request fails.
It should be noted that the terminal device provided in the embodiments shown in fig. 4 to fig. 6 may be used to execute the network connection disaster recovery method provided in the embodiments shown in fig. 2 to fig. 3, and the specific implementation manner and the technical effect are similar, and are not described again here.
Fig. 7 is a schematic structural diagram of an electronic device shown in accordance with an example embodiment of the present invention. As shown in fig. 7, the present embodiment provides an electronic device 40 including: a processor 41 and a memory 42; wherein:
a memory 42 for storing a computer program, which may also be a flash (flash memory).
And a processor 41 for executing the execution instructions stored in the memory to implement the steps of the above method. Reference may be made in particular to the description relating to the preceding method embodiment.
Alternatively, the memory 42 may be separate or integrated with the processor 41.
When the memory 42 is a device independent from the processor 41, the electronic device 40 may further include:
a bus 43 for connecting the memory 42 and the processor 41.
The present embodiment also provides a readable storage medium, in which a computer program is stored, and when at least one processor of the electronic device executes the computer program, the electronic device executes the methods provided by the above various embodiments.
The present embodiment also provides a program product comprising a computer program stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the electronic device, and the execution of the computer program by the at least one processor causes the electronic device to implement the methods provided by the various embodiments described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (18)

1. A network connection disaster recovery method, comprising:
judging whether a terminal device receives a virtual IP address list sent by a first remote server or not, wherein the virtual IP address list comprises: the network connection method comprises the steps that a standby virtual IP address set and a main virtual IP address are adopted, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection;
if the judgment result is yes, sending a first network request according to the main virtual IP address;
when the first network request fails, dial testing is carried out on each alternative virtual IP address in the alternative virtual IP address set in sequence to determine a first alternative virtual IP address which can access a second remote server in the alternative virtual IP address set;
and sending a second network request according to the first alternative virtual IP address.
2. The method according to claim 1, wherein the sequentially testing each of the candidate virtual IP addresses in the candidate virtual IP address set to determine a first candidate virtual IP address in the candidate virtual IP address set that can access a first remote server includes:
sequentially testing each alternative virtual IP address in the alternative virtual IP address set to acquire connection performance data corresponding to each alternative virtual IP address;
and determining the virtual IP address with the optimal connection performance data in the alternative virtual IP address set as the first alternative virtual IP address.
3. The method according to claim 2, wherein the connection performance data is an access rate for accessing the second remote server, and the first candidate virtual IP address is a virtual IP address with a highest access rate in the set of virtual IP addresses.
4. The method according to any one of claims 1 to 3, wherein after the sending the second network request according to the first alternative virtual IP address, the method further comprises:
judging whether the second network request is successful;
if the judgment result is negative, network retry is initiated through the domain name system analysis technology.
5. The method according to claim 1, wherein after the determining whether the terminal device receives the virtual IP address list sent by the first remote server, the method further comprises:
if the terminal equipment does not receive the virtual IP address list sent by the first remote server, dial-testing each built-in virtual IP address in a built-in virtual IP address set in sequence to determine a second alternative virtual IP address which can access the second remote server in the built-in virtual IP address set, wherein the built-in virtual IP address set is preset in the terminal equipment;
and sending a third network request according to the second alternative virtual IP address.
6. The method according to claim 5, wherein the sequentially testing each internal virtual IP address in the set of internal virtual IP addresses to determine a second alternative virtual IP address in the set of alternative virtual IP addresses that can access the second remote server includes:
sequentially testing each built-in virtual IP address in the built-in virtual IP address set to acquire connection performance data corresponding to each built-in virtual IP address;
and determining the virtual IP address with the optimal connection performance data in the built-in virtual IP address set as the second alternative virtual IP address.
7. The method according to claim 6, wherein the connection performance data is an access rate for accessing the second remote server, and the second candidate virtual IP address is a virtual IP address with a highest access rate in the set of virtual IP addresses.
8. The method according to claim 6 or 7, wherein after the sending the third network request according to the second alternative virtual IP address, the method further comprises:
judging whether the third network request is successful;
if the judgment result is negative, network retry is initiated through the domain name system analysis technology.
9. A terminal device, comprising:
the list receiving and judging module is used for judging whether the terminal equipment receives a virtual IP address list sent by a first remote server, wherein the virtual IP address list comprises: the network connection method comprises the steps that a standby virtual IP address set and a main virtual IP address are adopted, wherein the standby virtual IP address set comprises at least one standby virtual IP address, and the main virtual IP address is a preferred IP address for establishing network connection;
a network request sending module, configured to send a first network request according to the primary virtual IP address;
an IP address dial testing module, configured to, when the first network request fails, sequentially perform dial testing on each alternative virtual IP address in the alternative virtual IP address set to determine a first alternative virtual IP address in the alternative virtual IP address set, where the first alternative virtual IP address can access the second remote server;
the network request sending module is further configured to send a second network request according to the first alternative virtual IP address.
10. The terminal device of claim 9, wherein the IP address dial testing module comprises:
the connection performance acquisition submodule is used for carrying out dial test on each alternative virtual IP address in the alternative virtual IP address set in sequence so as to acquire connection performance data corresponding to each alternative virtual IP address;
and the IP address determining submodule is used for determining the virtual IP address with the optimal connection performance data in the alternative virtual IP address set as the first alternative virtual IP address.
11. The terminal device according to claim 10, wherein the connection performance data is an access rate for accessing the second remote server, and the first candidate virtual IP address is a virtual IP address with the fastest access rate in the set of virtual IP addresses.
12. The terminal device according to any of claims 9-11, further comprising:
the network connection judging module is used for judging whether the second network request is successful or not;
and the network retry request module is used for initiating network retry through a domain name system resolution technology when the second network request fails.
13. The terminal device according to claim 9, wherein the IP address dial testing module is further configured to, when the terminal device does not receive the virtual IP address list sent by the first remote server, sequentially dial-test each built-in virtual IP address in a built-in virtual IP address set to determine a second alternative virtual IP address that can access the second remote server in the built-in virtual IP address set, where the built-in virtual IP address set is preset in the terminal device;
and the network request sending module is used for sending a third network request according to the second alternative virtual IP address.
14. The terminal device of claim 13, wherein the IP address dial testing module comprises:
the connection performance acquisition submodule is used for carrying out dial testing on each built-in virtual IP address in the built-in virtual IP address set in sequence so as to acquire connection performance data corresponding to each built-in virtual IP address;
and the IP address determining submodule determines the virtual IP address with the optimal connection performance data in the built-in virtual IP address set as the second alternative virtual IP address.
15. The terminal device according to claim 14, wherein the connection performance data is an access rate for accessing the second remote server, and the second candidate virtual IP address is a virtual IP address with the fastest access rate in the set of virtual IP addresses.
16. The terminal device according to claim 14 or 15, further comprising:
the network connection judging module is used for judging whether the third network request is successful or not;
and the network retry request module is used for initiating network retry through a domain name system resolution technology when the third network request fails.
17. An electronic device, comprising:
a processor; and the number of the first and second groups,
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the network connection disaster recovery method of any one of claims 1 to 8 via execution of the executable instructions.
18. A storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the network connection disaster recovery method according to any one of claims 1 to 8.
CN201811383554.9A 2018-11-20 2018-11-20 Network connection disaster recovery method, terminal equipment, storage medium and electronic equipment Active CN111200512B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811383554.9A CN111200512B (en) 2018-11-20 2018-11-20 Network connection disaster recovery method, terminal equipment, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811383554.9A CN111200512B (en) 2018-11-20 2018-11-20 Network connection disaster recovery method, terminal equipment, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111200512A true CN111200512A (en) 2020-05-26
CN111200512B CN111200512B (en) 2023-05-30

Family

ID=70746523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811383554.9A Active CN111200512B (en) 2018-11-20 2018-11-20 Network connection disaster recovery method, terminal equipment, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111200512B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708459A (en) * 2023-07-20 2023-09-05 广州东瑞科技有限公司 Service access automatic switching method, system, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5774660A (en) * 1996-08-05 1998-06-30 Resonate, Inc. World-wide-web server with delayed resource-binding for resource-based load balancing on a distributed resource multi-node network
US20080069104A1 (en) * 2006-09-15 2008-03-20 Citrix Systems, Inc. Systems and methods for selecting efficient connection paths between computing devices
CN104967538A (en) * 2015-06-30 2015-10-07 北京奇虎科技有限公司 Method, device and system for network fault switching
US20160316423A1 (en) * 2014-02-14 2016-10-27 Tencent Technology (Shenzhen) Company Limited Network access method and apparatus applied to mobile application
CN107493351A (en) * 2017-10-09 2017-12-19 郑州云海信息技术有限公司 A kind of client accesses the method and device of the load balancing of storage system
CN107800814A (en) * 2016-09-05 2018-03-13 国网江苏省电力公司信息通信分公司 Virtual machine deployment method and device
CN108632397A (en) * 2017-03-22 2018-10-09 北京雪球信息科技有限公司 To the control method and system of network connection

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5774660A (en) * 1996-08-05 1998-06-30 Resonate, Inc. World-wide-web server with delayed resource-binding for resource-based load balancing on a distributed resource multi-node network
US20080069104A1 (en) * 2006-09-15 2008-03-20 Citrix Systems, Inc. Systems and methods for selecting efficient connection paths between computing devices
US20160316423A1 (en) * 2014-02-14 2016-10-27 Tencent Technology (Shenzhen) Company Limited Network access method and apparatus applied to mobile application
CN104967538A (en) * 2015-06-30 2015-10-07 北京奇虎科技有限公司 Method, device and system for network fault switching
CN107800814A (en) * 2016-09-05 2018-03-13 国网江苏省电力公司信息通信分公司 Virtual machine deployment method and device
CN108632397A (en) * 2017-03-22 2018-10-09 北京雪球信息科技有限公司 To the control method and system of network connection
CN107493351A (en) * 2017-10-09 2017-12-19 郑州云海信息技术有限公司 A kind of client accesses the method and device of the load balancing of storage system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708459A (en) * 2023-07-20 2023-09-05 广州东瑞科技有限公司 Service access automatic switching method, system, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111200512B (en) 2023-05-30

Similar Documents

Publication Publication Date Title
CN108470298B (en) Method, device and system for transferring resource numerical value
CN107483260B (en) Fault processing method and device and electronic equipment
CN108055157B (en) Service node acquisition method and device
CN109586969A (en) Content distributing network disaster recovery method, device, computer equipment and storage medium
CN110266761B (en) Load balancing application creation method and device, computer equipment and storage medium
CN109041267B (en) Network connection fault processing method and device and electronic equipment
CN112003963B (en) Method, system, device and medium for mounting volume on bare metal server
CN105554136B (en) Backup Data restoring method, apparatus and system
CN105610958A (en) Method and device for selecting time synchronization server and intelligent terminal
CN112380072A (en) Multi-data center access method and system
CN114035811A (en) Method, system, terminal and storage medium for rapidly deploying OVA mirror image
CN111200512B (en) Network connection disaster recovery method, terminal equipment, storage medium and electronic equipment
CN111857758B (en) Application deployment method, device and medium
CN117118814A (en) Cloud resource switching method, device, equipment and medium based on multi-cloud management platform
CN108243229B (en) Request processing method and device
CN109479214B (en) Load balancing method and related device
CN110673970B (en) Cross-process calling system and method based on web application
CN111193778A (en) Method, device, equipment and medium for WEB service load balancing
CN111935029B (en) Gateway load balancing method and device, storage medium and electronic equipment
CN107203915B (en) Data storage method and device
CN113949631A (en) Client disaster tolerance processing method and system and electronic equipment
CN111641664B (en) Crawler equipment service request method, device and system and storage medium
CN111491033A (en) Connection establishing method and device
CN112532509A (en) Cross-application communication method and related device
CN109213487A (en) A kind of data capture method and its relevant device

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