CN110177007B - Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity - Google Patents

Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity Download PDF

Info

Publication number
CN110177007B
CN110177007B CN201910305843.5A CN201910305843A CN110177007B CN 110177007 B CN110177007 B CN 110177007B CN 201910305843 A CN201910305843 A CN 201910305843A CN 110177007 B CN110177007 B CN 110177007B
Authority
CN
China
Prior art keywords
data center
gateway
address
data centers
remote data
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
CN201910305843.5A
Other languages
Chinese (zh)
Other versions
CN110177007A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910305843.5A priority Critical patent/CN110177007B/en
Publication of CN110177007A publication Critical patent/CN110177007A/en
Priority to PCT/CN2019/118171 priority patent/WO2020211364A1/en
Application granted granted Critical
Publication of CN110177007B publication Critical patent/CN110177007B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1034Reaction to server failures by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos

Landscapes

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

Abstract

The application discloses a method, a device, computer equipment and a storage medium for realizing gateway multi-live in different places, wherein the method for realizing gateway multi-live in different places comprises the following steps: receiving a request address sent by a client, wherein the request address comprises a first IP address, and the first IP address corresponds to a local data center; accessing a first gateway of a local data center according to the first IP address, and judging whether the first gateway is in an available state; if the first gateway is in an unavailable state, determining a remote data center with the highest priority from the rest available remote data centers according to a preset priority strategy; and accessing a second gateway of the allopatric data center with the highest priority, and calling a backup link between the allopatric data center with the highest priority and the local data center. The method for realizing the gateway multi-place multi-activity solves the technical problem that a calling party cannot access the service resources of a machine room in which a service party is located when the application of the machine room in which the service party is located is in a problem.

Description

Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a computer device, and a storage medium for implementing gateway multi-live in different places.
Background
For a large-scale enterprise, in order to meet business requirements, machine rooms (equivalent to a data center) are often required to be built in different places, and a network of each machine room is mainly divided into a DMZ network area, an SF network area and a PTR network area, wherein the DMZ network area is called for the internet, the PTR network area is called for a private line, and the SF network area is called for an intranet, in the prior art, for effective routing, which link is called needs to be determined according to an area where a calling party is located and the machine room where a service party is located, so that once a gateway is unavailable due to a problem of an application (such as a host, a network or an infrastructure fault) of the machine room where the service party is located, the calling party cannot access business resources of the machine room where the service party is located, for example, a beijing machine room, a shanghai machine room and a guangzhou machine room are built (i.e., machine rooms are built in beijing, shanghai and guangzhou, respectively), the area where the calling party is located is the internet, the machine room where the service party is located is the SF network area of the Beijing machine room, and therefore for effective routing, the link needing to be called can only be from the DMZ network area of the Beijing machine room to the SF network area of the Beijing machine room, and once the application of the Beijing machine room is in a problem, the calling party cannot access the service resources of the Beijing machine room.
Therefore, when the application of the server in the computer room has a problem, how to enable the caller to still access the service resource of the server in the computer room is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The application mainly aims to provide a method, a device, computer equipment and a storage medium for realizing gateway multi-place multi-activity, and aims to solve the technical problem that a calling party cannot access service resources of a machine room where a service party is located when the application of the machine room where the service party is located is in a problem.
The application provides a method for realizing gateway remote multi-activity, which is applied to a data center system, wherein the data center system at least comprises two data centers, each data center is respectively arranged in different regions, and the data centers are mutually communicated through a preset backup link, and the method comprises the following steps:
receiving a request address sent by a client, wherein the request address comprises a first IP address, and the first IP address corresponds to a local data center;
accessing a first gateway of a local data center according to the first IP address, and judging whether the first gateway is in an available state;
if the first gateway is in an unavailable state, determining a remote data center with the highest priority from the rest available remote data centers according to a preset priority strategy;
and accessing a second gateway of the allopatric data center with the highest priority, and calling a backup link between the allopatric data center with the highest priority and the local data center so that the client accesses the service resources of the local data center through the backup link.
Further, before the step of receiving the request address sent by the client, the method further includes:
receiving identity information and an access token request sent by a client, and judging whether the identity information is legal or not;
and if the identity information is legal, responding to the access token request, generating access token information and sending the access token information to the client.
Further, before the step of accessing the second gateway of the data center with the highest priority and invoking the backup link between the data center with the highest priority and the local data center, the step of requesting the address further includes:
checking whether the access token information is legal;
and if the access token information is legal, executing a second gateway of the remote data center with the highest access priority, and calling a backup link between the remote data center with the highest priority and the local data center so as to enable the client to access the service resources of the local data center through the backup link.
Further, the step of determining whether the first gateway is in an available state includes:
sending heartbeat packets to the first gateway at intervals of a preset period, and judging whether feedback information returned by the first gateway in response to the heartbeat packets is received within preset time;
and if the feedback information returned by the first gateway is not received within the preset time, judging that the first gateway is in an unavailable state.
Further, the step of determining the highest priority data center from the rest available data centers according to a predetermined priority policy, wherein the request address further comprises a second IP address corresponding to the client, and the step comprises the following steps:
acquiring gateway states corresponding to other remote data centers, and determining all available remote data centers according to the gateway states;
acquiring third IP addresses corresponding to all currently available remote data centers, calculating the distances between the local data center and all currently available remote data centers according to the first IP address and the third IP addresses to acquire a plurality of corresponding first distances, and calculating the distances between the client and all currently available remote data centers according to the second IP address and the third IP addresses to acquire a plurality of corresponding second distances;
calculating the distance of a link through which the client accesses the service resource according to the first distance and the second distance to obtain a plurality of corresponding link distances;
and selecting the link distance with the shortest distance from the plurality of link distances, and determining the allopatric data center corresponding to the link distance with the shortest distance as the allopatric data center with the highest priority.
Further, the step of determining the highest priority offsite data center from the rest available offsite data centers according to a predetermined priority policy comprises:
acquiring network flow corresponding to other remote data centers, and determining all available remote data centers according to the network flow;
according to the network flow, selecting a remote data center with the minimum network flow from all available remote data centers;
and determining the allopatric data center with the least network traffic as the allopatric data center with the highest priority.
Further, the step of determining the highest priority data center from the rest available data centers according to a predetermined priority policy, wherein the request address further comprises a second IP address corresponding to the client, and the step comprises the following steps:
acquiring gateway states corresponding to other remote data centers, and determining all available remote data centers according to the gateway states;
acquiring network traffic and a third IP address corresponding to all available remote data centers;
calculating the distances between the local data center and all available remote data centers according to the first IP address and the third IP address to obtain a plurality of corresponding first distances, calculating the distances between the client and all available remote data centers according to the second IP address and the third IP address to obtain a plurality of corresponding second distances, calculating the distances of links through which the client accesses the service resources according to the first distances and the second distances to obtain a plurality of corresponding link distances;
and determining the allopatric data center with the highest priority from all available allopatric data centers according to the link distance and the network flow in combination with a preset weight value.
The application also provides a device for realizing the gateway remote multi-live, which is applied to a data center system, the data center system at least comprises two data centers, each data center is respectively arranged in different regions, and the data centers are mutually communicated through a preset backup link, the device comprises:
the receiving module is used for receiving a request address sent by a client, wherein the request address comprises a first IP address, and the first IP address corresponds to a local data center;
the access module is used for accessing a first gateway of the local data center according to the first IP address and judging whether the first gateway is in an available state;
the determining module is used for determining the allopatric data center with the highest priority from the other available allopatric data centers according to a preset priority strategy when the first gateway is in the unavailable state;
and the calling module is used for accessing the second gateway of the allopatric data center with the highest priority and calling a backup link between the allopatric data center with the highest priority and the local data center so that the client accesses the service resources of the local data center through the backup link.
The application also provides a computer device, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for realizing gateway multi-place multi-activity when executing the computer program.
The present application also proposes a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the aforementioned steps of the method for implementing gateway remoteness and multi-live.
The beneficial effect of this application is: according to the method for realizing gateway multi-live in different places provided by the embodiment of the application, the data centers can be communicated with each other by configuring one backup link among the data centers, when one data center fails and a client cannot normally access the service resources of the data center, the data center can be accessed by switching to other available data centers and calling the corresponding backup link, so that the data centers can be mutually standby, multi-live in different places is realized, and the technical problem that a calling party cannot access the service resources of a machine room where a service party is located when the application of the machine room where the service party is located is in a problem is solved.
Drawings
Fig. 1 is a schematic flow chart of a method for implementing gateway multi-place multi-activity in one embodiment of the present application;
FIG. 2 is a schematic diagram of an apparatus for implementing gateway multi-place mobility in one embodiment of the present application;
FIG. 3 is a schematic diagram of an apparatus for implementing gateway multi-place mobility in another embodiment of the present application;
FIG. 4 is a block diagram of an access module in one implementation of the present application;
FIG. 5 is a block diagram of a determination module in one implementation of the present application;
FIG. 6 is a block diagram of a determination module in another embodiment of the present application;
FIG. 7 is a schematic diagram of a determination module in yet another embodiment of the present application;
FIG. 8 is a block diagram of a computer device in an implementation of the present application.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, an embodiment of the present application provides a method for implementing gateway multi-site multi-activity, which is applied to a data center system, where the data center system at least includes two data centers, each of the data centers is respectively disposed in different regions, and the data centers are mutually communicated through a preset backup link, the method can be executed by a device for implementing gateway multi-site multi-activity, the device for implementing gateway multi-site multi-activity can be composed of hardware and/or software, and can be generally integrated into all intelligent terminal devices including a design function of a multi-site multi-activity architecture, and the method includes:
s11, receiving a request address sent by a client, wherein the request address comprises a first IP address, and the first IP address corresponds to a local data center;
s12, accessing the first gateway of the local data center according to the first IP address, and judging whether the first gateway is in an available state;
if the first gateway is in the unavailable state, executing S13, and determining the allopatric data center with the highest priority from the other available allopatric data centers according to a preset priority strategy;
and S14, accessing the second gateway of the allopatric data center with the highest priority, and calling a backup link between the allopatric data center with the highest priority and the local data center, so that the client accesses the service resources of the local data center through the backup link.
In the step S11, the local area and the different area are relative, which depends on the actual access requirement of the user, for example, the user needs to access the service resource of a certain data center, at this time, the data center may be regarded as a local data center, and the other data centers may be regarded as different data centers, which may be deployed in different areas according to the service requirement, such as beijing, shanghai, guangzhou, etc., wherein different data centers store different service resources, and each of the different data centers has its corresponding IP address, the user may select the data center to be accessed according to the service requirement, specifically, for example, the user needs to access the service resource of a certain data center (at this time, the data center may be regarded as a local data center), and the user may send a request address to the above-mentioned device (i.e., the device that implements the gateway to be remotely and live) (e.g., by using the address bar of the Web browser) through the client (e.g., the Web browser) Input a request address) containing an IP address corresponding to the data center (i.e., the first IP address) for accessing the local data center.
In the step S12, specifically, after receiving the request address sent by the client, the device may learn, according to the first IP address in the request address, that the client needs to access the local data center, and the service resource that needs to access the local data center needs to be implemented by accessing the first gateway of the local data center, so that whether the first gateway is available needs to be checked first, specifically, the device finds the first gateway of the local data center according to the first IP address, and then accesses the first gateway (for example, sends an access request to the first gateway), if the first gateway does not respond to the first gateway (that is, the access request of the first gateway) in the access process, it indicates that the first gateway is in an unavailable state, and further, the service resource of the local data center cannot be accessed, and then the step S13 may be performed; and if the first gateway responds to the request in the access process, the first gateway is in an available state, and at the moment, the client can directly access the service resources of the local data center through the first gateway to acquire the required service resources.
In the step S13, since the data centers are connected to each other through the backup link set in advance, when the first gateway is in an unavailable state and cannot normally obtain the required service resource from the local data center, the first gateway may switch to another available remote data center and call the corresponding backup link to access the local data center.
In step S14, since the service resources stored in the remote data center are not the same as the service resources stored in the local data center, it is necessary to ensure that the data in the local data center is consistent with the data in the remote data center in order to ensure that the client can correctly obtain the service resources in the local data center rather than the service resources in the remote data center, and since the client accesses the memory database (e.g., Redis) of the data center through the gateway when obtaining the service resources in the data center, and further obtains the required service resources by reading the static data in the memory database, it is possible to write the specific static data into the memory database and the preset external memory database (e.g., oracle) corresponding to each data center, respectively, and then make a static data pair to ensure that the static data in each memory database is consistent with the static data in the external memory database, therefore, the static data of the local data center can be ensured to be consistent with the static data of the remote data center; in this step, specifically, when the remote data center with the highest priority is determined, the device may switch the first IP address to the IP address corresponding to the remote data center with the highest priority through a domain name resolution (DNS) scheduling system, and then find and access the second gateway of the remote data center with the highest priority according to the IP address, and after the second gateway is successfully accessed, then call the backup link between the remote data center with the highest priority and the local data center, so that the client may normally access the service resource of the local data center through the backup link, thereby implementing remote multi-activity, and solving the technical problem that the calling party cannot access the service resource of the machine room where the service party is located when the application of the machine room where the service party is located (i.e., the local data center) has a problem.
In the embodiment, the method for realizing gateway multi-place and multi-activity enables the data centers to be communicated with each other by configuring a backup link between the data centers, meanwhile, according to the configuration of the backup link, the static data of one data center is placed in the memory database corresponding to the backup link, so that the consistency of the data can be ensured between two mutually communicated data centers, when one data center fails so that the client cannot normally access the service resources of the data center, access to the data center may be made by switching to other available data centers and invoking the corresponding backup links, therefore, a plurality of data centers can be mutually standby, remote multi-activity is realized, and the technical problem that a calling party cannot access service resources of a machine room where a service party is located when the application of the machine room where the service party is located is in a problem is solved.
In a preferred embodiment, before the step of receiving the request address sent by the client, the method further includes:
s09, receiving the identity information and the access token request sent by the client, and judging whether the identity information is legal;
if the identity information is legal, S10 is executed, the access token request is responded, the access token information is generated, and the access token information is sent to the client.
In this embodiment, a user needs to access service resources of each data center through an authorized party of the apparatus, specifically, before obtaining service resources of a local data center through a client, the user needs to register a corresponding account (for example, register a corresponding account in an authentication server), after the account registration is completed, log in (for example, log in the authentication server) by using the account and a corresponding account password, at this time, the apparatus may verify whether an account password corresponding to the account is correct through the authentication server, if so, it may be determined that identity information sent by the current client is legal, at this time, the apparatus may respond to an access token request sent by the client, generate a token information through the authentication server and return the token information to the client, the client receives the access token information and caches the token information in a local folder, so that a subsequent client may access service resources specified by the local data center through the token information, therefore, only the client with the token information can access the service resources appointed by the local data center by setting the authority, so that the data security is improved, and the service resources of the local data center are prevented from being stolen.
In a preferred embodiment, before the step of accessing the second gateway of the data center with the highest priority and invoking the backup link between the data center with the highest priority and the local data center, the step of requesting the address further includes:
s14a, checking whether the access token information is legal;
if the access token information is legal, the step S14 is executed to access the second gateway of the data center with the highest priority, and invoke the backup link between the data center with the highest priority and the local data center, so that the client accesses the service resource of the local data center through the backup link.
In this embodiment, whether the current client has the authority to access the service resource of the local data center can be determined by checking whether the token information is legal, so that by setting the authority, the security of data is improved, and the service resource of the local data center is prevented from being stolen, wherein the access token information is attached with a timestamp (i.e., a timestamp can be added to the token information when the token information is generated), and specifically, whether the access token information is legal can be checked in the following manner: the time stamp has the validity period, so that whether the access token information is legal or not can be judged by checking whether the time stamp is expired or not, and if the time stamp is expired, the access token information can be judged to be illegal; if the timestamp is not expired, the access token information is further compared with a plurality of pieces of access token information prestored in an external storage database, whether a matching item exists or not is judged, if the matching item exists, the access token information can be judged to be legal according to the matching item, and if the matching item does not exist, the access token information can be judged to be illegal according to the matching item; if the access token information is legal, it indicates that the current client has the authority to access the service resource of the local data center, and at this time, the step S14 may be executed; if the access token information is not legal, the process proceeds to S14b to perform relevant operations.
In a preferred embodiment, after the step of checking whether the access token information is legal, the method further includes:
if the access token information is illegal, executing S14b, sending a prompt message of authentication failure to the client to prompt the user to re-input the identity information;
s14c, receiving the identity information returned by the client end in response to the prompt message, and judging whether the identity information is legal;
if the identity information is legal, S14d is executed, new token information is regenerated and sent to the client, the second gateway of the remote data center with the highest priority is accessed, and a backup link between the remote data center with the highest priority and the local data center is called, so that the client accesses the service resource of the local data center through the backup link.
In this embodiment, if the access token information provided by the current client is not legal, it indicates that the current client does not have the right to access the service resources of the local data center, and therefore the current user needs to be authenticated again, specifically, a prompt message indicating that the authentication fails is sent to the client, the user is prompted to re-input the account and the corresponding account password, and then the authentication server verifies whether the account password corresponding to the account is correct, if so, it can be determined that the identity information returned by the current client is legal, and meanwhile, it also indicates that the reason for the token information being illegal is likely to be due to the expiration of the timestamp, at this time, the apparatus can re-generate a new token information through the authentication server and send the token information to the client, at the same time, access the second gateway of the remote data center with the highest priority, and call the backup link between the remote data center with the highest priority and the local data center, so that the client accesses the service resources of the local data center through the backup link.
In a preferred embodiment, the step of determining whether the first gateway is in the available state includes:
s121, sending heartbeat packets to the first gateway at intervals of a preset period, and judging whether feedback information returned by the first gateway responding to the heartbeat packets is received within preset time;
if the feedback information returned by the first gateway is not received within the preset time, S122 is executed, and it is determined that the first gateway is in an unavailable state.
In this embodiment, specifically, the apparatus may send a heartbeat packet to the first gateway of the local data center through the DNS scheduling system at a preset interval (e.g., every 5 seconds, 10 seconds, 15 seconds, etc., where the preset interval may be determined according to actual conditions, and is not specifically limited thereto), and according to the heartbeat mechanism principle, if the first gateway is in an available state, the first gateway may reply a feedback message to the DNS scheduling system in response to the heartbeat packet when the first gateway receives the heartbeat packet, and if the first gateway is in an unavailable state, the first gateway may not receive the heartbeat packet and may not respond to the heartbeat packet, so that if the DNS scheduling system does not receive the feedback message returned by the first gateway within a preset time (e.g., 10 seconds, 20 seconds, 30 seconds, etc., the preset time may be determined according to actual conditions, and is not specifically limited thereto), the device can judge that the first gateway is in the unavailable state according to the judgment result, so that whether the first gateway of the local data center is in the available state or not can be accurately judged by utilizing the heartbeat mechanism principle and a mode of regularly sending heartbeat packets to the first gateway through the DNS scheduling system.
In a preferred embodiment, the step of determining the highest priority data center from the remaining available data centers according to a predetermined priority policy further includes the step of determining the highest priority data center from the second IP address of the corresponding client, including:
s13a1, acquiring gateway states corresponding to other remote data centers, and determining all available remote data centers according to the gateway states;
s13a2, acquiring third IP addresses corresponding to all available remote data centers at present, calculating distances between the local data center and all available remote data centers at present according to the first IP addresses and the third IP addresses to acquire a plurality of corresponding first distances, and calculating distances between the client and all available remote data centers at present according to the second IP addresses and the third IP addresses to acquire a plurality of corresponding second distances;
s13a3, calculating the distance of the link through which the client accesses the service resource according to the first distance and the second distance to obtain a plurality of corresponding link distances;
and S13a4, selecting the shortest link distance from the plurality of link distances, and determining the allopatric data center corresponding to the shortest link distance as the allopatric data center with the highest priority.
In the step S13a1, the gateway status includes a gateway available status and a gateway unavailable status, and specifically, the IP addresses corresponding to other data centers in different places can be searched out from the external database, and the gateways of the other data centers in different places can be accessed according to the searched IP addresses, further, the gateway states corresponding to the other allopatric data centers are obtained by a mode that the DNS scheduling system sends heartbeat packets to the gateways corresponding to the other allopatric data centers at regular time, namely, by utilizing the principle of a heartbeat mechanism, the DNS scheduling system can know which gateways of the data centers at different places are in an available state and which gateways of the data centers at different places are in an unavailable state, and records the state, the gateway status corresponding to the remaining offsite data centers can be obtained by reading the record in the DNS scheduling system, and then all available remote data centers can be determined according to the obtained gateway state.
In the step S13a2, since each data center or client has its corresponding IP address, the location of the local data center or the remote data center or client can be known through the IP address, for example, if the first IP address is 123.125.71.38, it indicates that the location of the local data center is beijing, the second IP address of the client is 113.65.161.23, it indicates that the location of the client is guangzhou, the third IP address of a certain remote data center is 116.234.222.36, it indicates that the location of the remote data center is shanghai, and therefore, specifically, when all currently available remote data centers are determined according to the gateway status, the third IP addresses corresponding to all currently available remote data centers can be found from the external database, and further, the distances between the local data center and all currently available remote data centers can be calculated according to the first IP address and the third IP address, and similarly, the distances between the client and all the available remote data centers can be calculated according to the second IP address and the third IP address, and a plurality of corresponding second distances are obtained.
In the step S13a3, since the first gateway is in the unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway switches to another available remote data center and invokes a corresponding backup link to access the local data center, and therefore, the link through which the client accesses the service resource of the local data center is: the client-available remote data center-local data center, and since there may be multiple available remote data centers, there may be multiple optional links for the client to access the service resource of the local data center, and therefore, an appropriate link needs to be selected from the multiple available remote data centers, and specifically, the sum of the first distance and the second distance is calculated to obtain the link distance corresponding to the link where each available remote data center is located, so as to enter step S13a4 to perform the relevant operation.
In the step S13a4, since the delay occurring during the data transmission process is affected by the transmission distance, generally, the larger the transmission distance is, the longer the delay is, and therefore, the shorter the link distance is, the shorter the delay is, so that after obtaining the link distance corresponding to the link where each available allopatric data center is located by calculation, the shortest link distance can be selected from the multiple link distances, and the allopatric data center corresponding to the shortest link distance is determined as the allopatric data center with the highest priority, so that the delay of the data can be shortened to the maximum extent, and the user experience can be improved.
In another preferred embodiment, the step of determining the highest priority offsite data center from the remaining available offsite data centers according to a predetermined priority policy comprises:
s13b1, acquiring network traffic corresponding to other remote data centers, and determining all available remote data centers according to the network traffic;
s13b2, according to the network flow, selecting the remote data center with the least network flow from all available remote data centers;
and S13b3, determining the allopatric data center with the least network traffic as the allopatric data center with the highest priority.
In the step S13b1, since the service resource needs to be acquired through the gateway, it can be indirectly known which gateways of the data centers in different locations are in the available state and which gateways of the data centers in different locations are in the unavailable state by monitoring the network traffic, and accordingly all available data centers in different locations are determined, specifically, the network traffic corresponding to the other data centers in different locations can be acquired through a network traffic monitoring technology (such as NetStream, Mirror, sFlow, and the like), and if the network traffic corresponding to a certain data center in different locations is zero, it can be determined that the data center in different locations is unavailable accordingly, and if the network traffic corresponding to a certain data center in different locations is not zero (i.e., there is network traffic), it can be determined that the data center in different locations is available accordingly.
In the step S13b2, when all currently available remote data centers are determined, the remote data center with the minimum network traffic may be further selected from all currently available remote data centers according to the acquired network traffic, so as to proceed to step S13b3 to perform related operations.
In the step S13b3, when the first gateway is in an unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway is switched to another available remote data center and invokes a corresponding backup link to access the local data center, so that delay occurring in the transmission process of data is affected by the "busy" degree of the remote data center, generally, the more network traffic, the greater the access amount, the more "busy" the service of the data center, and the greater the data delay, the less the network traffic, the shorter the delay, and therefore, the remote data center with the least network traffic currently available can be determined as the remote data center with the highest priority, so that the delay of data can be shortened to the maximum extent, and the user experience can be improved.
In another preferred embodiment, the step of determining the highest priority data center from the remaining available data centers according to a predetermined priority policy further includes the step of determining the highest priority data center from the second IP address of the corresponding client, including:
s13c1, acquiring gateway states corresponding to other remote data centers, and determining all available remote data centers according to the gateway states;
s13c2, acquiring network traffic and a third IP address corresponding to all available remote data centers;
s13c3, calculating the distance between the local data center and all available remote data centers according to the first IP address and the third IP address to obtain a plurality of corresponding first distances, calculating the distance between the client and all available remote data centers according to the second IP address and the third IP address to obtain a plurality of corresponding second distances, and calculating the distance between the client and the link through which the client accesses the service resource according to the first distance and the second distance to obtain a plurality of corresponding link distances;
and S13c4, determining the allopatric data center with the highest priority from all the currently available allopatric data centers according to the link distance and the network traffic in combination with a preset weight value.
In the step S13c1, the gateway status includes a gateway available status and a gateway unavailable status, and specifically, the IP addresses corresponding to other data centers in different places can be searched out from the external database, and the gateways of the other data centers in different places can be accessed according to the searched IP addresses, further, the gateway states corresponding to the other allopatric data centers are obtained by a mode that the DNS scheduling system sends heartbeat packets to the gateways corresponding to the other allopatric data centers at regular time, namely, by utilizing the principle of a heartbeat mechanism, the DNS scheduling system can know which gateways of the data centers at different places are in an available state and which gateways of the data centers at different places are in an unavailable state, and records the state, the gateway status corresponding to the remaining offsite data centers can be obtained by reading the record in the DNS scheduling system, and then all available remote data centers can be determined according to the obtained gateway state.
In the step S13c2, specifically, when all available remote data centers are determined according to the gateway status, network traffic corresponding to all available remote data centers can be obtained through a network traffic monitoring technology (such as NetStream, Mirror, sFlow, and the like), and meanwhile, third IP addresses corresponding to all available remote data centers can be searched from an external database, so as to perform related operations in the subsequent process.
In the step S13c3, since each data center or client has its corresponding IP address, the location of the local data center or the remote data center or client can be known through the IP address, for example, if the first IP address is 123.125.71.38, it indicates that the location of the local data center is beijing, the second IP address of the client is 113.65.161.23, it indicates that the location of the client is guangzhou, the third IP address of a certain remote data center is 116.234.222.36, it indicates that the location of the remote data center is shanghai, and therefore, specifically, the distances between the local data center and all currently available remote data centers can be calculated according to the first IP address and the third IP address, so as to obtain a plurality of corresponding first distances, and similarly, the distances between the client and all currently available remote data centers can be calculated according to the second IP address and the third IP address, and obtaining a plurality of corresponding second distances, and further obtaining the link distance corresponding to the link where each available remote data center is located by calculating the sum of the first distance and the second distance so as to perform related operations in the following.
In the step S13c4, when the first gateway is in the unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway switches to another available remote data center and calls the corresponding backup link to access the local data center, so that the delay of the data in the transmission process is mainly affected by two factors, namely, the transmission distance of the data and the "busy" degree of the remote data center, and generally, the smaller the transmission distance is, the shorter the delay is; the less the network flow is, the shorter the delay is, so that the allopatric data center with the highest priority can be determined from all the currently available allopatric data centers according to the combination of the link distance and the network flow and the preset weight value, specifically, the preset weight value can be X (link distance + network flow), wherein X is a constant, so that after the network flow corresponding to all the currently available allopatric data centers and the link distance corresponding to the link where each available allopatric data center is located are obtained, the weight value corresponding to all the currently available allopatric data centers can be calculated, and the larger the weight value is, the shorter the delay of the data is, so that the allopatric data center with the highest weight value can be determined as the allopatric data center with the highest priority more accurately from the other available allopatric data centers, but also can shorten the time delay of the data to the utmost extent and improve the user experience.
Referring to fig. 2, an embodiment of the present application further provides an apparatus for implementing gateway multi-location and multi-activity, which is applied to a data center system, where the data center system at least includes two data centers, each data center is respectively disposed in different regions, and the data centers are mutually communicated through a preset backup link, and the apparatus includes:
the receiving module 11 is configured to receive a request address sent by a client, where the request address includes a first IP address, and the first IP address corresponds to a local data center;
the access module 12 is configured to access a first gateway of the local data center according to the first IP address, and determine whether the first gateway is in an available state;
a determining module 13, configured to determine, according to a predetermined priority policy, a remote data center with a highest priority from the remaining available remote data centers when the first gateway is in an unavailable state;
and the calling module 14 is configured to access the second gateway of the remote data center with the highest priority, and call a backup link between the remote data center with the highest priority and the local data center, so that the client accesses the service resource of the local data center through the backup link.
In the receiving module 11, the local and the different places are relative, and it is determined according to the actual access requirement of the user, for example, the user needs to access the service resource of a certain data center, at this time, the data center may be regarded as a local data center, and the other data centers may be regarded as different place data centers, and these data centers may be deployed in different places according to the service requirement, such as beijing, shanghai, guangzhou, and the like, wherein different data centers store different service resources, and different data centers all have their corresponding IP addresses, and the user may select the data center that needs to be accessed according to his own service requirement, specifically, for example, the user needs to access the service resource of a certain data center (at this time, the data center may be regarded as a local data center), and then the user may send a request address (a request address) to the above-mentioned device (i.e., the device that realizes the gateway is different places and multiple places) through a client (e.g., a Web browser) Such as by entering a request address in an address bar of the Web browser), where the request address includes an IP address (i.e., a first IP address) corresponding to the data center, in order to access the local data center.
In the above access module 12, specifically, after the receiving module 11 receives the request address sent by the client, the access module 12 can know that the client needs to access the local data center according to the first IP address in the request address, and the service resource of the local data center is accessed through the first gateway of the local data center, it is therefore necessary to first check whether the first gateway is available, in particular, the access module 12 finds the first gateway of the local data center on the basis of the first IP address, and then access the first gateway (e.g., send an access request to the first gateway), if the first gateway does not respond to the access request (i.e., the access request of the first gateway) during the access, it indicates that the first gateway is in an unavailable state, further, the service resources of the local data center cannot be accessed, and at this time, the determining module 13 may be handed over to execute the relevant operation; and if the first gateway responds to the request in the access process, the first gateway is in an available state, and at the moment, the client can directly access the service resources of the local data center through the first gateway to acquire the required service resources.
In the determining module 13, since the data centers are interconnected through the backup link set in advance, when the first gateway is in an unavailable state and cannot normally acquire the required service resource from the local data center, the determining module 13 may select the remote data center with the highest priority from the available remote data centers by switching to another available remote data center and calling the corresponding backup link to access the local data center, and since there may be a plurality of available remote data centers, the determining module 13 needs to select the remote data center with the highest priority first, and in addition, since the local data center and the remote data center are in different regions, transmission of data is delayed, the remote data center with the shortest delay may be selected as the remote data center with the highest priority by the determining module 13.
In the invoking module 14, since the service resources stored in the remote data center are different from the service resources stored in the local data center, it is necessary to ensure that the data in the local data center is consistent with the data in the remote data center in order to ensure that the client can correctly obtain the service resources in the local data center but not the service resources in the remote data center, and since the client accesses the memory database (e.g., Redis) of the data center through the gateway when obtaining the service resources in the data center, and further obtains the required service resources by reading the static data in the memory database, it is possible to write the specific static data into the memory database corresponding to each data center and the preset external memory database (e.g., oracle) in advance, and then make a static data pair to ensure that the static data in each memory database is consistent with the static data in the external memory database, therefore, the static data of the local data center can be ensured to be consistent with the static data of the remote data center; in this step, specifically, when the determining module 13 determines the remote data center with the highest priority, the calling module 14 may switch the first IP address to the IP address corresponding to the remote data center with the highest priority through a domain name resolution (DNS) scheduling system, and then find and access the second gateway of the remote data center with the highest priority according to the IP address, and after the second gateway is successfully accessed, further call the backup link between the remote data center with the highest priority and the local data center, so that the client may normally access the service resource of the local data center through the backup link, thereby implementing remote multi-location, and solving the technical problem that the calling party cannot access the service resource of the machine room where the service party is located when the application of the machine room where the service party is located (i.e., the local data center) has a problem.
In the embodiment, the device for realizing gateway multi-place and multi-activity can make the data centers communicate with each other by configuring a backup link between the data centers, meanwhile, according to the configuration of the backup link, the static data of one data center is placed in the memory database corresponding to the backup link, so that the consistency of the data can be ensured between two mutually communicated data centers, when one data center fails so that the client cannot normally access the service resources of the data center, access to the data center may be made by switching to other available data centers and invoking the corresponding backup links, therefore, a plurality of data centers can be mutually standby, remote multi-activity is realized, and the technical problem that a calling party cannot access service resources of a machine room where a service party is located when the application of the machine room where the service party is located is in a problem is solved.
Referring to fig. 3, in a preferred embodiment, the apparatus for implementing gateway remoteness and multi-live further includes:
the first judgment module 09 is configured to receive the identity information and the access token request sent by the client, and judge whether the identity information is legal;
and the generating module 10 is configured to respond to the access token request when the identity information is legal, generate access token information, and send the access token information to the client.
In this embodiment, a user needs to pass through the authorization party of the apparatus to access the service resources of each data center, specifically, before obtaining the service resources of the local data center through a client, the user needs to register a corresponding account in an authentication server (for example, register a corresponding account in the authentication server), after the account registration is completed, log in the authentication server (for example, log in the authentication server) by using the account and a corresponding account password, at this time, the first determining module 09 can verify whether the account password corresponding to the account is correct through the authentication server, if so, the first determining module 09 can accordingly determine that the identity information sent by the client is valid, at this time, the generating module 10 can respond to an access token request sent by the client, generate a token information through the authentication server and return the token information to the client, the client receives the access token information and caches the token information in a local folder, therefore, the subsequent client can access the service resources specified by the local data center by means of the token information, and only the client with the token information can access the service resources specified by the local data center by setting the authority, so that the data security is improved, and the service resources of the local data center are prevented from being stolen.
Referring to fig. 3, in a preferred embodiment, the request address further includes access token information, and the apparatus for implementing gateway long-distance multi-live further includes:
a checking module 14a for checking whether the access token information is legitimate.
In this embodiment, whether the token information is legal is checked by the checking module 14a, so that whether the current client has the authority to access the service resource of the local data center can be determined, and thus by setting the authority, the data security is improved, and the service resource of the local data center is prevented from being stolen, where the access token information is accompanied by a time stamp (i.e., a time stamp can be added to the token information when the token information is generated), and specifically, the checking module 14a can check whether the access token information is legal by: because the timestamp has the validity period, whether the access token information is legal or not can be judged by checking whether the timestamp is expired or not, and if the timestamp is expired, the checking module 14a can judge that the access token information is illegal according to the time; if the timestamp is not expired, the access token information is further compared with a plurality of pieces of access token information prestored in an external database, whether a matching item exists or not is judged, if the matching item exists, the inspection module 14a can judge that the access token information is legal according to the matching item, and if the matching item does not exist, the inspection module 14a can judge that the access token information is illegal according to the matching item; if the access token information is legal, it indicates that the current client has the authority to access the service resources of the local data center, and at this time, the client can be handed to the calling module 14 to execute the relevant operation; if the access token information is not legal, the sending module 14b is handed over to perform the relevant operation.
Referring to fig. 3, in a preferred embodiment, the apparatus for implementing gateway remoteness and multi-live further includes:
the sending module 14b is configured to send a prompt message indicating that the authentication fails to the client when the access token information is illegal, so as to prompt the user to re-input the identity information;
the second judging module 14c is configured to receive the identity information returned by the client in response to the prompt message, and judge whether the identity information is legal;
and the execution module 14d is configured to, when the identity information is legal, regenerate and send new token information to the client, access the second gateway of the remote data center with the highest priority, and invoke a backup link between the remote data center with the highest priority and the local data center, so that the client accesses the service resource of the local data center through the backup link.
In this embodiment, if the access token information provided by the current client is not legal, it indicates that the current client does not have the right to access the service resource of the local data center, and therefore the identity of the current user needs to be verified again, specifically, the sending module 14b sends a prompt message indicating that the identity verification fails to the client, and prompts the user to re-input the account and the corresponding account password, and then the second determining module 14c verifies whether the account password corresponding to the account is correct through the authentication server, if so, the second determining module 14c may determine that the identity information returned by the current client is legal accordingly, and meanwhile, it also indicates that the reason for the illegal token information is probably because the timestamp is expired, and at this time, the executing module 14d may re-generate a new token information through the authentication server and send the new token information to the client, and accessing a second gateway of the allopatric data center with the highest priority, and calling a backup link between the allopatric data center with the highest priority and the local data center so that the client accesses the service resources of the local data center through the backup link.
Referring to fig. 4, in a preferred embodiment, the access module 12 includes:
a sending unit 121, configured to send a heartbeat packet to the first gateway at intervals of a preset period, and determine whether feedback information returned by the first gateway in response to the heartbeat packet is received within a preset time;
the determining unit 122 is configured to determine that the first gateway is in an unavailable state when the feedback information returned by the first gateway is not received within the preset time.
In this embodiment, specifically, the sending unit 121 may send a heartbeat packet to the first gateway of the local data center through the DNS scheduling system at a preset interval (e.g. every 5 seconds, 10 seconds, 15 seconds, etc., where the preset interval may be determined according to actual conditions, and is not specifically limited), according to the heartbeat mechanism principle, if the first gateway is in an available state, the first gateway may reply a feedback message to the DNS scheduling system in response to the heartbeat packet when the first gateway receives the heartbeat packet, and if the first gateway is in an unavailable state, the first gateway may not receive the heartbeat packet and may not respond to the heartbeat packet, so that if the DNS scheduling system does not receive the feedback message returned by the first gateway within a preset time (e.g. 10 seconds, 20 seconds, 30 seconds, etc., the preset time may be determined according to actual conditions, and is not specifically limited), the determining unit 122 may determine that the first gateway is in the unavailable state accordingly, and therefore, by using the heartbeat mechanism principle, whether the first gateway of the local data center is in the available state may be accurately determined in a manner that the DNS scheduling system sends a heartbeat packet to the first gateway at regular time.
Referring to fig. 5, in a preferred embodiment, the request address further includes a second IP address of the corresponding client, and the determining module 13 includes:
the first obtaining unit 13a1 is configured to obtain gateway states corresponding to the other remote data centers, and determine all available remote data centers according to the gateway states;
a second obtaining unit 13a2, configured to obtain a third IP address corresponding to all currently available remote data centers, calculate distances between the local data center and all currently available remote data centers according to the first IP address and the third IP address, obtain a plurality of corresponding first distances, calculate distances between the client and all currently available remote data centers according to the second IP address and the third IP address, and obtain a plurality of corresponding second distances;
a first calculating unit 13a3, configured to calculate, according to the first distance and the second distance, a distance of a link through which the client accesses the service resource, and obtain a plurality of corresponding link distances;
the first determining unit 13a4 selects the link distance having the shortest distance from the plurality of link distances, and determines the remote data center corresponding to the link distance having the shortest distance as the remote data center having the highest priority.
In the first obtaining unit 13a1, the gateway states include that the gateway is in an available state and the gateway is in an unavailable state, specifically, the first obtaining unit 13a1 may find out the IP addresses corresponding to the other remote data centers from the external database, and access the gateways of the other remote data centers according to the found IP addresses, and further obtain the gateway states corresponding to the other remote data centers by sending heartbeat packets to the gateways corresponding to the other remote data centers at regular time through the DNS scheduling system, that is, using the heartbeat mechanism principle, the DNS scheduling system may obtain which gateways of the remote data centers are in an available state and which gateways of the remote data centers are in an unavailable state, and record the heartbeat packet, so that the gateway states corresponding to the other remote data centers may be obtained by reading the record in the DNS scheduling system through the first obtaining unit 13a1, further, the first obtaining unit 13a1 may determine all currently available remote data centers according to the obtained gateway status.
In the second obtaining unit 13a2, since each data center or client has its corresponding IP address, the location of the local data center or the remote data center or client can be obtained through the IP address, for example, if the first IP address is 123.125.71.38, it indicates that the location of the local data center is beijing, the second IP address of the client is 113.65.161.23, it indicates that the location of the client is guangzhou, the third IP address of a certain remote data center is 116.234.222.36, it indicates that the location of the remote data center is shanghai, therefore, specifically, when all currently available remote data centers are determined according to the gateway status, the second obtaining unit 13a2 can find the third IP address corresponding to all currently available remote data centers from the external database, and further, the distance between the local data center and all currently available remote data centers can be calculated according to the first IP address and the third IP address, and similarly, the distances between the client and all the available remote data centers can be calculated according to the second IP address and the third IP address, and a plurality of corresponding second distances are obtained.
In the first computing unit 13a3, when the first gateway is in the unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway switches to another available remote data center and invokes a corresponding backup link to access the local data center, so that the links through which the client accesses the service resource of the local data center are: the client-available remote data center-local data center, and since there may be a plurality of available remote data centers, there may be a plurality of selectable links for the client to access the service resource of the local data center, and therefore an appropriate link needs to be selected from them, specifically, the sum of the first distance and the second distance is calculated by the first calculating unit 13a3, so that the link distance corresponding to the link where each available remote data center is located can be obtained, so as to be handed to the first determining unit 13a4 to perform the relevant operation.
In the first determining unit 13a4, since the delay occurring during the data transmission process is affected by the transmission distance, generally, the larger the transmission distance is, the larger the delay is, and therefore, the shorter the link distance is, the smaller the delay is, therefore, after the link distance corresponding to the link where each available allopatric data center is located is obtained through calculation by the first calculating unit 13a3, the link distance with the shortest distance may be selected from the multiple link distances through the first determining unit 13a4, and the allopatric data center corresponding to the link distance with the shortest distance is determined as the allopatric data center with the highest priority, so that the delay of data may be shortened to the maximum extent, and the user experience may be improved.
Referring to fig. 6, in another preferred embodiment, the determining module 13 includes:
a third obtaining unit 13b1, configured to obtain network traffic corresponding to other remote data centers, and determine all currently available remote data centers according to the network traffic;
the selecting unit 13b2 is configured to select, according to the network traffic, a remote data center with the smallest network traffic from all currently available remote data centers;
a second determining unit 13b3, configured to determine the offsite data center with the least network traffic as the offsite data center with the highest priority.
In the third obtaining unit 13b1, since the service resource needs to be obtained through the gateway, it can be indirectly known which gateways of the data centers in different places are in the available state and which gateways of the data centers in different places are in the unavailable state through monitoring the network traffic, and thus all the currently available data centers in different places are determined according to the obtained network traffic, specifically, the third obtaining unit 13b1 can obtain the network traffic corresponding to the other data centers in different places through a network traffic monitoring technology (such as NetStream, Mirror, sFlow, and the like), and if the network traffic corresponding to a certain data center in different places is zero, the third obtaining unit 13b1 can determine that the data center in different places is unavailable according to the obtained network traffic, and if the network traffic corresponding to a certain data center in different places is not zero (i.e., there is network traffic), the third obtaining unit 13b1 can determine that the data center in different places is available according to the obtained network traffic.
In the selecting unit 13b2, when all currently available remote data centers are determined by the third obtaining unit 13b1, the selecting unit 13b2 may further select, according to the obtained network traffic, a remote data center with the minimum network traffic from all currently available remote data centers, so as to be handed over to the second determining unit 13b3 to perform a relevant operation.
In the second determining unit 13b3, when the first gateway is in an unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway is switched to another available remote data center and calls a corresponding backup link to access the local data center, so that delay occurring in the transmission process of data is affected by the degree of "busy" of the remote data center itself, generally, the more network traffic, the greater the access amount, the more "busy" the service of the data center, and the greater the data delay, and therefore the less the network traffic, the smaller the delay, and therefore the remote data center with the least network traffic currently available can be determined as the remote data center with the highest priority by the second determining unit 13b3, so as to shorten the delay of data to the greatest extent, the user experience is improved.
Referring to fig. 7, in another preferred embodiment, the request address further includes a second IP address of the corresponding client, and the determining module 13 includes:
a fourth obtaining unit 13c1, configured to obtain gateway states corresponding to the other remote data centers, and determine all currently available remote data centers according to the gateway states;
a fifth obtaining unit 13c2, configured to obtain network traffic and a third IP address corresponding to all currently available remote data centers;
a second calculating unit 13c3, configured to calculate distances between the local data center and all currently available remote data centers according to the first IP address and the third IP address, to obtain a plurality of corresponding first distances, and calculate distances between the client and all currently available remote data centers according to the second IP address and the third IP address, to obtain a plurality of corresponding second distances, and calculate a distance between a link through which the client accesses the service resource according to the first distance and the second distance, to obtain a plurality of corresponding link distances;
the third determining unit 13c4 is configured to determine, according to the link distance and the network traffic in combination with a preset weight value, a remote data center with the highest priority from all currently available remote data centers.
In the fourth obtaining unit 13c1, the gateway states include that the gateway is in an available state and the gateway is in an unavailable state, specifically, the fourth obtaining unit 13c1 may find out the IP addresses corresponding to the other remote data centers from the external database, and access the gateways of the other remote data centers according to the found IP addresses, and further obtain the gateway states corresponding to the other remote data centers by sending heartbeat packets to the gateways corresponding to the other remote data centers at regular time through the DNS scheduling system, that is, using the heartbeat mechanism principle, the DNS scheduling system may obtain which gateways of the remote data centers are in an available state and which gateways of the remote data centers are in an unavailable state, and record the heartbeat packet, so that the gateway states corresponding to the other remote data centers may be obtained by reading the record in the DNS scheduling system through the fourth obtaining unit 13c1, further, the fourth obtaining unit 13c1 may determine all currently available remote data centers according to the obtained gateway status.
In the fifth obtaining unit 13c2, specifically, when the fourth obtaining unit 13c1 determines all available remote data centers according to the gateway state, the fifth obtaining unit 13c2 may obtain the network traffic corresponding to all available remote data centers through a network traffic monitoring technology (such as netflow, Mirror, sFlow, and the like), and at the same time, may find out the third IP addresses corresponding to all available remote data centers from the external database through the fifth obtaining unit 13c2, so as to perform the related operations subsequently.
In the second calculating unit 13c3, since each data center or client has its corresponding IP address, the location of the local data center or the remote data center or client can be known through the IP address, for example, if the first IP address is 123.125.71.38, it indicates that the location of the local data center is beijing, the second IP address of the client is 113.65.161.23, it indicates that the location of the client is guangzhou, the third IP address of a certain remote data center is 116.234.222.36, it indicates that the location of the remote data center is shanghai, and therefore, specifically, the second calculating unit 13c3 can calculate the distances between the local data center and all currently available remote data centers according to the first IP address and the third IP address, and obtain a plurality of corresponding first distances, and similarly, the second calculating unit 13c3 can calculate the distances between the client and all currently available remote data centers according to the second IP address and the third IP address, a plurality of corresponding second distances are obtained, and then the second calculating unit 13c3 calculates the sum of the first distance and the second distance to obtain the link distance corresponding to the link where each available remote data center is located, so as to perform the related operation subsequently.
In the third determining unit 13c4, when the first gateway is in an unavailable state and cannot normally acquire the required service resource from the local data center, the first gateway is switched to another available remote data center and calls a corresponding backup link to access the local data center, so that delay occurring in the transmission process of data is mainly affected by two factors, namely, the transmission distance of the data and the "busy" degree of the remote data center itself, and generally, the smaller the transmission distance is, the smaller the delay is; the smaller the network traffic is, the smaller the delay is, so the third determining unit 13c4 can determine the remote data center with the highest priority from all the currently available remote data centers according to the combination of the link distance and the network traffic and the preset weight value, specifically, the preset weight value can be X (total distance + network traffic), where X is a constant, so after obtaining the network traffic corresponding to all the currently available remote data centers and the link distance corresponding to the link where each available remote data center is located, the weight value corresponding to all the currently available remote data centers can be calculated, and the larger the weight value is, the smaller the delay of data is, so the remote data center with the highest weight value can be determined as the remote data center with the highest priority by the third determining unit 13c4, so that the remote data center with the highest priority can be determined more accurately from the rest available remote data centers, but also can shorten the time delay of the data to the utmost extent and improve the user experience.
Referring to fig. 8, a computer device, which may be a server and whose internal structure may be as shown in fig. 8, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing a method program for realizing the gateway multi-place multi-activity and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is used for realizing the method for realizing gateway remote multi-live in any embodiment when being executed by a processor.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for implementing gateway multi-location and multi-activity in any of the above embodiments is implemented.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware associated with instructions of a computer program, which may be stored on a non-volatile computer-readable storage medium, and when executed, may include processes of the above embodiments of the methods. Any reference to memory, storage, database, or other medium provided herein and used in the examples 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-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A method for realizing gateway allopatric multi-activity is characterized in that the method is applied to a data center system, the data center system at least comprises two data centers, each data center is respectively arranged in different regions, and the data centers are mutually communicated through a preset backup link, the method comprises the following steps:
receiving a request address sent by a client, wherein the request address comprises a first IP address, and the first IP address corresponds to a local data center;
accessing a first gateway of the local data center according to the first IP address, and judging whether the first gateway is in an available state;
if the first gateway is in an unavailable state, determining the allopatric data center with the highest priority from other available allopatric data centers according to a preset priority strategy;
accessing a second gateway of the allopatric data center with the highest priority, and calling the backup link between the allopatric data center with the highest priority and the local data center, so that the client accesses service resources of the local data center through the backup link;
the request address further includes a second IP address corresponding to the client, and the step of determining the remote data center with the highest priority from the remaining available remote data centers according to a predetermined priority policy includes:
acquiring gateway states corresponding to the other remote data centers, and determining all available remote data centers according to the gateway states;
acquiring network traffic and a third IP address corresponding to all available remote data centers;
calculating the distances between the local data center and all currently available remote data centers according to the first IP address and the third IP address to obtain a plurality of corresponding first distances, calculating the distances between the client and all currently available remote data centers according to the second IP address and the third IP address to obtain a plurality of corresponding second distances, calculating the distance of a link through which the client accesses the service resources according to the first distance and the second distance to obtain a plurality of corresponding link distances;
and determining the allopatric data center with the highest priority from all the available allopatric data centers according to the link distance and the network flow by combining a preset weight value.
2. The method of claim 1, wherein the step of receiving the request address sent by the client further comprises:
receiving identity information and an access token request sent by the client, and judging whether the identity information is legal or not;
and if the identity information is legal, responding to the access token request, generating access token information and sending the access token information to the client.
3. The method of claim 2, wherein the request address further includes the access token information, the accessing the second gateway of the displaced data center with the highest priority, and the step of invoking the backup link between the displaced data center with the highest priority and the local data center further comprises, before the step of invoking the backup link between the displaced data center with the highest priority:
verifying whether the access token information is legitimate;
and if the access token information is legal, executing a second gateway of the remote data center with the highest access priority, and calling the backup link between the remote data center with the highest priority and the local data center so as to enable the client to access the service resources of the local data center through the backup link.
4. The method of claim 1, wherein the step of determining whether the first gateway is in an available state comprises:
sending heartbeat packets to the first gateway at intervals of a preset period, and judging whether feedback information returned by the first gateway in response to the heartbeat packets is received within preset time;
and if the feedback information returned by the first gateway is not received within the preset time, judging that the first gateway is in an unavailable state.
5. The method of any of claims 1 to 4, wherein the request address further comprises a second IP address corresponding to the client, and the step of determining the highest priority of the remote data centers from the remaining available remote data centers according to a predetermined priority policy comprises:
acquiring gateway states corresponding to the other remote data centers, and determining all available remote data centers according to the gateway states;
acquiring third IP addresses corresponding to all currently available remote data centers, calculating the distances between the local data center and all currently available remote data centers according to the first IP address and the third IP addresses to acquire a plurality of corresponding first distances, and calculating the distances between the client and all currently available remote data centers according to the second IP address and the third IP addresses to acquire a plurality of corresponding second distances;
calculating the distance of a link through which the client accesses the service resource according to the first distance and the second distance to obtain a plurality of corresponding link distances; and selecting the link distance with the shortest distance from the plurality of link distances, and determining the allopatric data center corresponding to the link distance with the shortest distance as the allopatric data center with the highest priority.
6. The method of any of claims 1 to 4, wherein said step of determining the highest priority of the other available displaced data centers according to a predetermined priority policy comprises:
acquiring network flow corresponding to the other remote data centers, and determining all available remote data centers according to the network flow;
according to the network flow, selecting the remote data center with the least network flow from all currently available remote data centers;
and determining the allopatric data center with the least network traffic as the allopatric data center with the highest priority.
7. The utility model provides a realize many livers in gateway strange land device which characterized in that is applied to data center system, data center system includes two data centers at least, each data center sets up respectively in different areas, and each communicate each other through the backup link that predetermines between the data center, the device includes:
the system comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a request address sent by a client, the request address comprises a first IP address, and the first IP address corresponds to a local data center;
the access module is used for accessing a first gateway of the local data center according to the first IP address and judging whether the first gateway is in an available state;
a determining module, configured to determine, when the first gateway is in an unavailable state, the remote data center with a highest priority from the remaining available remote data centers according to a predetermined priority policy;
the calling module is used for accessing a second gateway of the allopatric data center with the highest priority and calling the backup link between the allopatric data center with the highest priority and the local data center so that the client accesses the service resources of the local data center through the backup link;
the request address further includes a second IP address of the corresponding client, and the determining module includes:
the fourth acquisition unit is used for acquiring gateway states corresponding to other remote data centers and determining all available remote data centers according to the gateway states;
a fifth obtaining unit, configured to obtain network traffic and a third IP address corresponding to all currently available remote data centers;
the second calculation unit is used for calculating the distances between the local data center and all the current available remote data centers according to the first IP address and the third IP address to obtain a plurality of corresponding first distances, calculating the distances between the client and all the current available remote data centers according to the second IP address and the third IP address to obtain a plurality of corresponding second distances, and calculating the distance of a link through which the client accesses the service resources according to the first distance and the second distance to obtain a plurality of corresponding link distances;
and the third determining unit is used for determining the allopatric data center with the highest priority from all the currently available allopatric data centers according to the link distance and the network flow in combination with a preset weight value.
8. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of a method of implementing gateway peering as claimed in any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of carrying out a gateway resisitivity measure according to any one of claims 1 to 6.
CN201910305843.5A 2019-04-16 2019-04-16 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity Active CN110177007B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910305843.5A CN110177007B (en) 2019-04-16 2019-04-16 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity
PCT/CN2019/118171 WO2020211364A1 (en) 2019-04-16 2019-11-13 Method and apparatus for achieving multi-site high availability of gateway, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910305843.5A CN110177007B (en) 2019-04-16 2019-04-16 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity

Publications (2)

Publication Number Publication Date
CN110177007A CN110177007A (en) 2019-08-27
CN110177007B true CN110177007B (en) 2022-03-18

Family

ID=67690011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910305843.5A Active CN110177007B (en) 2019-04-16 2019-04-16 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity

Country Status (2)

Country Link
CN (1) CN110177007B (en)
WO (1) WO2020211364A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110177007B (en) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity
CN110809064B (en) * 2019-09-05 2022-12-16 连连银通电子支付有限公司 IP address switching method, device and system
CN112565327B (en) * 2019-09-26 2022-09-30 广州虎牙科技有限公司 Access flow forwarding method, cluster management method and related device
CN110635950A (en) * 2019-09-30 2019-12-31 深圳供电局有限公司 Double-data-center disaster recovery system
CN110855808B (en) * 2019-10-11 2022-09-16 新浪网技术(中国)有限公司 Domain name automatic switching method, device and system based on distributed monitoring strategy
CN110868450B (en) * 2019-10-15 2022-09-23 平安科技(深圳)有限公司 Dual-computer room multi-entrance session keeping method, system, device and storage medium
CN111245943A (en) * 2020-01-14 2020-06-05 山东汇贸电子口岸有限公司 Method for obtaining accessible IP address by Redis cluster
CN111526038B (en) * 2020-03-26 2023-01-20 口碑(上海)信息技术有限公司 Service request distribution method and device, computer equipment and readable storage medium
CN112039710B (en) * 2020-09-02 2023-08-01 曙光信息产业(北京)有限公司 Service fault processing method, terminal equipment and readable storage medium
CN112187738A (en) * 2020-09-11 2021-01-05 中国银联股份有限公司 Service data access control method, device and computer readable storage medium
CN112507381B (en) * 2020-12-21 2023-03-14 中电福富信息科技有限公司 Asset information and security management device supporting multiple operating systems
CN113037861B (en) * 2021-03-25 2023-08-22 北京奇艺世纪科技有限公司 Service node connection method and device
CN114567646A (en) * 2022-03-08 2022-05-31 京东科技信息技术有限公司 Data processing method, data processing system, electronic device, and storage medium
CN114785465B (en) * 2022-04-26 2024-04-12 上海识装信息科技有限公司 Implementation method, server and storage medium for multiple activities in different places
CN117041089B (en) * 2023-08-21 2024-01-23 江苏臻云技术有限公司 Equipment monitoring system and method for remote data center

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888164A (en) * 2015-12-15 2017-06-23 阿里巴巴集团控股有限公司 Business datum method for routing and device under being lived a kind of strange land more
CN107959626A (en) * 2017-12-13 2018-04-24 迈普通信技术股份有限公司 Communication means, the apparatus and system of data center
CN108011995A (en) * 2017-12-19 2018-05-08 北京星河星云信息技术有限公司 Strange land implementation method more living, strange land service platform more living and storage medium
CN109617907A (en) * 2019-01-04 2019-04-12 平安科技(深圳)有限公司 Authentication method, electronic device and computer readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9049051B2 (en) * 2007-10-10 2015-06-02 Microsoft Technology Licensing, Llc Techniques to access messaging services for branch offices
CN108199912B (en) * 2017-12-15 2020-09-22 北京奇艺世纪科技有限公司 Method and device for managing and consuming distributed messages of multiple activities in different places
CN108924191A (en) * 2018-06-15 2018-11-30 青岛宇硕云联信息科技有限公司 Call method and system
CN109309617A (en) * 2018-08-08 2019-02-05 华为技术有限公司 Disaster tolerance switching method, relevant device and computer storage medium
CN110177007B (en) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888164A (en) * 2015-12-15 2017-06-23 阿里巴巴集团控股有限公司 Business datum method for routing and device under being lived a kind of strange land more
CN107959626A (en) * 2017-12-13 2018-04-24 迈普通信技术股份有限公司 Communication means, the apparatus and system of data center
CN108011995A (en) * 2017-12-19 2018-05-08 北京星河星云信息技术有限公司 Strange land implementation method more living, strange land service platform more living and storage medium
CN109617907A (en) * 2019-01-04 2019-04-12 平安科技(深圳)有限公司 Authentication method, electronic device and computer readable storage medium

Also Published As

Publication number Publication date
CN110177007A (en) 2019-08-27
WO2020211364A1 (en) 2020-10-22

Similar Documents

Publication Publication Date Title
CN110177007B (en) Method, device, computer equipment and storage medium for realizing gateway multi-place multi-activity
US11882109B2 (en) Authenticated name resolution
CN112597472B (en) Single sign-on method, device and storage medium
CN110417776B (en) Identity authentication method and device
CN110830458B (en) Domain name access method, system, device and computer readable storage medium
CN109547458B (en) Login verification method and device, computer equipment and storage medium
CN105577691B (en) A kind of safety access method and server
CN112153155B (en) Service request method, device, computer equipment and medium in server cluster
CN108989355B (en) Vulnerability detection method and device
WO2009058686A2 (en) Variable dns responses based on client identity
CN111698345B (en) Domain name query method, recursive server and storage medium
CN110149421B (en) Method, system and device for monitoring abnormity of domain name system and computer equipment
CN111669300A (en) Gateway testing method and device based on direct connection testing network and computer equipment
CN113381979A (en) Access request proxy method and proxy server
CN110597541A (en) Interface updating processing method, device, equipment and storage medium based on block chain
CN109120616A (en) A kind of identity identifying method, device, agency service end and storage medium
CN109274579A (en) It is a kind of that user's uniform authentication method is applied based on wechat platform more
CN114338597B (en) Network access method and device
CN113438336B (en) Network request method, device, equipment and storage medium
CN111241188B (en) Consensus method, node and storage medium in block chain network
CN113194099B (en) Data proxy method and proxy server
CN112929388B (en) Network identity cross-device application rapid authentication method and system, and user agent device
CN110138715A (en) Real name identification method, device, computer equipment and storage medium
CN111049945A (en) Network request optimization method, device, equipment and medium based on HTTP (hyper text transport protocol)
CN112383536B (en) Firewall verification method and device, computer equipment and storage medium

Legal Events

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