CN110177007A - Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living - Google Patents

Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living Download PDF

Info

Publication number
CN110177007A
CN110177007A CN201910305843.5A CN201910305843A CN110177007A CN 110177007 A CN110177007 A CN 110177007A CN 201910305843 A CN201910305843 A CN 201910305843A CN 110177007 A CN110177007 A CN 110177007A
Authority
CN
China
Prior art keywords
data center
strange land
gateway
address
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910305843.5A
Other languages
Chinese (zh)
Other versions
CN110177007B (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

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

Abstract

This application discloses a kind of method, apparatus, computer equipment and storage mediums for realizing that gateway strange land is mostly living, wherein, realize gateway strange land method mostly living, it include: the request address for receiving client and sending, wherein, request address includes the first IP address, and the first IP address is corresponding with local data center;The first gateway of local data center is accessed according to the first IP address, and judges whether the first gateway is in available mode;If the first gateway is in down state, the strange land data center of highest priority is determined from remaining available strange land data center according to scheduled priority policy;Second gateway of the highest strange land data center of access privileges, and call the backup link between the strange land data center of highest priority and local data center.Realization gateway strange land method mostly living solves the application of the computer room where service side when something goes wrong, where called side can not access service side the technical issues of the service resources of computer room.

Description

Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living
Technical field
This application involves field of computer technology is arrived, especially relates to a kind of method for realizing that gateway strange land is mostly living, fills It sets, computer equipment and storage medium.
Background technique
For larger enterprise, in order to meet business demand, generally require to build computer room respectively in different places (being equivalent to data center), the network of each computer room are broadly divided into the network area DMZ, the network area SF and the network area PTR, In, the network area DMZ is called to internet, and the network area PTR is called to special line, and the network area SF is to give Intranet tune , in the prior art, for effective routing, need to be called according to computer room where called side region and service side to determine Which link, once therefore service side where computer room application (such as host, network or infrastructure fault) go wrong and Cause gateway unavailable, then called side will be unable to the service resources of access service side place computer room, for example, having built Beijing machine Room, Shanghai computer room and Guangzhou computer room (having built computer room in Beijing, Shanghai and three, Guangzhou place respectively), called side location Domain is internet, and computer room is the network area SF of Beijing computer room where service side, then for effective routing, the chain that needs to call Road can only be the network area DMZ of Beijing computer room to the network area SF of Beijing computer room, once therefore Beijing computer room application go out Problem is showed, then called side will be unable to the service resources that Beijing computer room is accessed.
Therefore, how the application of computer room when something goes wrong, makes called side remain to access service side place where service side The service resources of computer room are those skilled in the art's technical problems urgently to be resolved.
Summary of the invention
The main purpose of the application is to provide a kind of method, apparatus for realizing that gateway strange land is mostly living, computer equipment and deposit Storage media, it is intended to solve when service side place computer room is using when something goes wrong, called side can not access computer room where service side Service resources the technical issues of.
The application proposes a kind of method for realizing that gateway strange land is mostly living, is applied to data center systems, data center systems Including at least Liang Ge data center, each data center is separately positioned on different areas, and passes through between each data center Preset backup link is interconnected, and method includes:
Receive the request address that client is sent, wherein request address includes the first IP address, the first IP address and local Data center is corresponding;
The first gateway of local data center is accessed according to the first IP address, and judges whether the first gateway is in available shape State;
If the first gateway is in down state, according to scheduled priority policy from remaining available strange land data The strange land data center of highest priority is determined in the heart;
Second gateway of the highest strange land data center of access privileges, and call the strange land data center of highest priority Backup link between local data center, so that client is provided by the business that backup link accesses local data center Source.
Further, before the step of receiving the request address that client is sent, further includes:
The identity information and access token request that client is sent are received, and judges whether identity information is legal;
If identity information is legal, access token request is responded, access token information is generated and sends out access token information It send to client.
Further, request address further includes access token information, and the of the highest strange land data center of access privileges Two gateways, and before the step of calling the backup link between the strange land data center of highest priority and local data center, Further include:
Examine access token information whether legal;
If access token information is legal, the second gateway of the highest strange land data center of access privileges is executed, and is adjusted With the backup link between the strange land data center of highest priority and local data center, so that client passes through backup link The step of accessing the service resources of local data center.
Further, the step of whether the first gateway is in available mode judged, comprising:
It is spaced predetermined period and sends heartbeat packet to the first gateway, and judge that whether receiving the first gateway in preset time rings The feedback information answering heartbeat packet and returning;
If not receiving the feedback information of the first gateway return in preset time, determine that the first gateway is in unavailable shape State.
Further, request address further includes the second IP address of corresponding client, according to scheduled priority policy from The step of determining the strange land data center of highest priority in remaining available strange land data center, comprising:
It obtains remaining corresponding gateway status of strange land data center, and is determined according to gateway status current all available Strange land data center;
The corresponding third IP address of currently all available strange land data centers is obtained, and according to the first IP address and third IP address calculates the distance between local data center and current all available strange land data centers, obtains multiple corresponding the One distance, and, client and current all available strange land data centers are calculated according to the second IP address and third IP address The distance between, obtain multiple corresponding second distances;
Distance of the client access service resources institute through link is calculated according to first distance and second distance, acquisition is multiple right The link range answered;
It is picked out from multiple link ranges apart from shortest link range, and will be corresponding apart from shortest link range Strange land data center is determined as the strange land data center of highest priority.
Further, determine priority most from remaining available strange land data center according to scheduled priority policy The step of high strange land data center, comprising:
It obtains remaining corresponding network flow of strange land data center, and is determined according to network flow current all available Strange land data center;
According to network flow, the least strange land number of network flow is picked out from current all available strange land data centers According to center;
The least strange land data center of network flow is determined as to the strange land data center of highest priority.
Further, request address further includes the second IP address of corresponding client, according to scheduled priority policy from The step of determining the strange land data center of highest priority in remaining available strange land data center, comprising:
It obtains remaining corresponding gateway status of strange land data center, and is determined according to gateway status current all available Strange land data center;
Obtain the corresponding network flow of currently all available strange land data centers and third IP address;
It is calculated in local data center and current all available strange land data according to the first IP address and third IP address The distance between heart obtains multiple corresponding first distances, and, client is calculated according to the second IP address and third IP address The distance between current all available strange land data centers, obtain multiple corresponding second distances, and according to first distance Distance of the client access service resources institute through link, the multiple corresponding link ranges of acquisition are calculated with second distance;
Preset weighted value is combined according to link range and network flow, from current all available strange land data centers Determine the strange land data center of highest priority.
The application also proposes a kind of device for realizing that gateway strange land is mostly living, is applied to data center systems, system, data center System includes at least Liang Ge data center, and each data center is separately positioned on different areas, and leads between each data center It crosses preset backup link to be interconnected, which includes:
Receiving module, for receiving the request address of client transmission, wherein request address includes the first IP address, the One IP address is corresponding with local data center;
Access modules for accessing the first gateway of local data center according to the first IP address, and judge the first gateway Whether available mode is in;
Determining module is used for when the first gateway is in down state, can from remaining according to scheduled priority policy The strange land data center of highest priority is determined in the data center of strange land;
Calling module for the second gateway of the highest strange land data center of access privileges, and calls highest priority Strange land data center and local data center between backup link so that client accesses local data by backup link The service resources at center.
The application also proposes that a kind of computer equipment, including memory and processor, memory are stored with computer program, Processor realizes the step of realization gateway strange land above-mentioned method mostly living when executing computer program.
The application also proposes a kind of computer readable storage medium, is stored thereon with computer program, computer program quilt Processor realizes the step of realization gateway strange land above-mentioned method mostly living when executing.
The beneficial effect of the application is: the method provided by the embodiments of the present application for realizing that gateway strange land is mostly living passes through each A backup link is respectively configured between data center, so that can be interconnected between each data center, when a data center It, can be by switch to other available when breaking down and making client that can not normally access the service resources of the data center Corresponding backup link simultaneously calls to access to the data center in data center, so that energy between multiple data centers It is enough mutually spare, it realizes strange land and lives more, solve when service side place computer room is using when something goes wrong, called side can not visit Where asking service side the technical issues of the service resources of computer room.
Detailed description of the invention
Fig. 1 is the flow diagram for the method for realizing that gateway strange land is mostly living during the application one is implemented;
Fig. 2 is the structural schematic diagram for the device for realizing that gateway strange land is mostly living during the application one is implemented;
Fig. 3 is the structural schematic diagram for the device for realizing that gateway strange land is mostly living in another implementation of the application;
Fig. 4 is the structural schematic diagram of access modules during the application one is implemented;
Fig. 5 is the structural schematic diagram of determining module during the application one is implemented;
Fig. 6 is the structural schematic diagram of determining module in another implementation of the application;
Fig. 7 is the structural schematic diagram of determining module in the another implementation of the application;
Fig. 8 is the structural schematic diagram of computer equipment during the application one is implemented.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig.1, the embodiment of the present application proposes a kind of method for realizing that gateway strange land is mostly living, and being applied to data center is System, data center systems include at least Liang Ge data center, and each data center is separately positioned on different areas, and each number It is interconnected according to preset backup link is passed through between center, this method can be held by realization gateway strange land device mostly living Row, realization gateway strange land device mostly living can be made of hardware and/or software, and can be generally integrated in all more comprising strange land In the intelligent terminal of architecture design function living, this method comprises:
S11, receive client send request address, wherein request address include the first IP address, the first IP address with Local data center is corresponding;
S12, the first gateway of local data center is accessed according to the first IP address, and judging whether the first gateway is in can Use state;
If the first gateway is in down state, S13 is executed, it is available different from remaining according to scheduled priority policy The strange land data center of highest priority is determined in ground data center;
S14, the second gateway of the highest strange land data center of access privileges, and call the strange land data of highest priority Backup link between center and local data center, so that client accesses the business of local data center by backup link Resource.
In above-mentioned steps S11, local and remote side be in contrast, depending on the actual access demand of user, Such as user needs to access the service resources of some data center, then the data center is considered as local data center at this time, And remainder data center is considered as strange land data center, these data centers can be deployed in different ground according to business demand Area, such as Beijing, Shanghai, Guangzhou etc., wherein different data centers is stored with different service resources, in different data The heart has its corresponding IP address, and user can select the data center for needing to access, specifically, example according to the business demand of itself If user needs to access the service resources of some data center's (at this point, the data center is considered as local data center), then User can send a request to above-mentioned apparatus (i.e. realization gateway strange land device mostly living) by client (such as Web browser) Address (such as by inputting request address in the address field of Web browser), wherein in the request address containing in the data The corresponding IP address of the heart (i.e. the first IP address), to access to local data center.
In above-mentioned steps S12, specifically, after the request address for receiving client transmission, above-mentioned apparatus is according to request The first IP address in address would know that client needs to access local data center, and access the business of local data center Resource then needs the first gateway by accessing local data center to realize, it is therefore desirable to first check that the first gateway whether may be used With specifically, above-mentioned apparatus finds the first gateway of local data center according to the first IP address, and then carries out to the first gateway Access (such as issues an access request to the first gateway), if the first gateway is not to this (i.e. the first gateway during access Access request) respond, then show that the first gateway is in down state, and then the industry of local data center can not be accessed Business resource can enter step S13 at this time and execute relevant operation;If the first gateway is made that sound to this and during access It answers, then shows that the first gateway is in available mode, client can directly access local data center by the first gateway at this time Service resources therefrom get required service resources.
In above-mentioned steps S13, it is interconnected due to passing through backup link set in advance between each data center, because This, can when the first gateway is in down state and can not normally get required service resources from local data center By switch to other available strange land data centers and calls corresponding backup link and accesses to local data center, And since there may be multiple for available strange land data center, it is therefore desirable to therefrom first pick out the strange land data of highest priority Center, in addition, the transmission of data can prolong since local data center and strange land data center are in different areas Late, therefore strange land data center of the shortest strange land data center of delay as highest priority may be selected.
In above-mentioned steps S14, due to the service resources of strange land data center storage and the industry of local data center storage Resource of being engaged in is not identical, therefore in order to guarantee that client can correctly get the service resources of local data center rather than strange land The service resources of data center, it is therefore desirable to the data of the data and strange land data center that guarantee local data center are consistent, And since client is when obtaining the service resources of data center, the internal storage data of data center is accessed particular by gateway Library (such as Redis), and then required service resources are got by reading the static data in memory database, therefore can Specific static data is respectively written into the corresponding memory database of each data center and preset external memory database in advance In (such as oracle), then guarantee the static data and outer deposit data in each memory database by doing static data reconciliation The static data in library is consistent, to can guarantee that the static data of local data center and the static data of strange land data center are one It causes;In this step, specifically, when determining the strange land data center of highest priority, above-mentioned apparatus can pass through domain name It parses (DNS) scheduling system and the first IP address is switched to IP address corresponding with the strange land data center of highest priority, And then the second gateway of the strange land data center of highest priority is found according to the IP address and is accessed, access the second gateway The backup link between strange land data center and local data center after success, and then by calling the highest priority, makes The service resources of local data center can normally be accessed by the backup link by obtaining client, to realize that strange land is mostly living, be solved When something goes wrong, called side can not access machine where service side for the application of computer room (i.e. local data center) where service side The technical issues of service resources in room.
In the present embodiment, realization gateway strange land method mostly living between each data center by respectively configuring one Backup link, so that can be interconnected between each data center, while according to the configuration of backup link, by a data center Static data be placed in the corresponding memory database of backup link so that can guarantee between interconnected Liang Ge data center The consistency of data, the business money for making client that can not normally access the data center when a data center breaks down When source, by switch to other available data centers and it can call corresponding backup link the data center is visited It asks, so that can be mutually spare between multiple data centers, it realizes strange land and lives more, solve the computer room where service side Application when something goes wrong, the technical issues of called side can not access the service resources of computer room where service side.
In a preferred embodiment, before the step of receiving the request address that client is sent, further includes:
S09 receives identity information and access token request that client is sent, and judges whether identity information is legal;
If identity information is legal, S10 is executed, response access token request generates access token information and enables access Board information is sent to client.
In the present embodiment, user needs to may have access to the business money of each data center by the authorized party of above-mentioned apparatus Source, specifically, before the service resources for obtaining local data center by client, user needs to register corresponding account (corresponding account is such as registered in certificate server), after the completion of account registration, using the account and corresponding account number cipher into Row logs in (such as login authentication server), and above-mentioned apparatus can verify the corresponding account number cipher of the account by certificate server at this time It is whether correct, if correctly, can determine that identity information that active client is sent be it is legal, above-mentioned apparatus can respond visitor at this time The access token request that family end is sent, generates a token information by certificate server and returns to client, client's termination It receives the access token information and caches into local folders, such subsequent client can access local number by the token information According to the service resources that center is specified, in this way, by setting permission, so that only the client with token information could access this The specified service resources of ground data center prevent the business of local data center from providing to be conducive to improve the safety of data Source is stolen.
In a preferred embodiment, request address further includes access token information, the highest strange land of access privileges Second gateway of data center, and call the backup link between the strange land data center of highest priority and local data center The step of before, further includes:
Whether S14a examines access token information legal;
If access token information is legal, above-mentioned steps S14 is executed, the of the highest strange land data center of access privileges Two gateways, and the backup link between the strange land data center of highest priority and local data center is called, so that client The service resources of local data center are accessed by backup link.
In the present embodiment, by examining whether token information is legal to can determine whether active client has access local The permission of the service resources of data center, to be conducive to the safety for improving data by setting permission, prevent local data The service resources at center are stolen, wherein access token information is accompanied with timestamp and (is generating token information Shi Kewei token Information adds a timestamp), specifically, access token information can be examined whether legal in the following manner: due to timestamp With validity period, therefore can first pass through whether Check-Out Time stamp is expired to judge whether access token information is legal, if timestamp It is out of date, then it can determine that access token information is illegal accordingly;If timestamp is not out of date, further by the access token information It is compared with the multiple access token information being pre-stored in external memory database, judges whether there is occurrence, match if it exists , then it can determine that the access token information is legal accordingly, occurrence, then can determine the access token information not accordingly if it does not exist It is legal;If the access token information is legal, illustrate that active client has the power of service resources of access local data center Above-mentioned steps S14 can be performed in limit at this time;If the access token information is illegal, enters S14b and execute relevant operation.
In a preferred embodiment, after the whether legal step of above-mentioned inspection access token information, further includes:
If access token information is illegal, S14b is executed, the prompt information of authentication failure is sent to client, with Prompt user re-enters identity information;
S14c receives client end response prompt information and the identity information that returns, and judges whether identity information is legal;
If identity information is legal, S14d is executed, regenerate new token information and is sent to client, and is accessed excellent Second gateway of the first highest strange land data center of grade, and call strange land data center and the local data center of highest priority Between backup link so that client by backup link access local data center service resources.
In the present embodiment, if the access token information of active client offer is illegal, illustrate active client not The permission for having the service resources of access local data center, it is therefore desirable to authentication be carried out to active user again, specifically Ground sends the prompt information of authentication failure to client, prompts user to re-enter account and corresponding account number cipher, so It is whether correct that the corresponding account number cipher of the account is verified by certificate server afterwards, if correctly, can determine that active client returns The identity information returned is legal, meanwhile, it also illustrates and the illegal reason of token information is caused to be likely due to timestamp Expired, above-mentioned apparatus can be regenerated a new token information by certificate server and be sent to client at this time, together When, the second gateway of the highest strange land data center of access privileges, and call the strange land data center of highest priority and this Backup link between ground data center, so that client accesses the service resources of local data center by backup link.
In a preferred embodiment, the step of whether the first gateway is in available mode judged, comprising:
S121, interval predetermined period sends heartbeat packet to the first gateway, and judges whether receive first in preset time The feedback information that gateway is returned in response to heartbeat packet;
If not receiving the feedback information of the first gateway return in preset time, S122 is executed, determines the first gateway In down state.
In the present embodiment, specifically, above-mentioned apparatus can dispatch system interval predetermined period (such as every 5 seconds by DNS Clock, 10 seconds, 15 seconds etc., predetermined period can according to the actual situation depending on, this is not limited specifically) into local data First gateway of the heart sends a heartbeat packet, according to heartbeat mechanism principle, if the first gateway is in available mode, when the first net When pass receives the heartbeat packet, then the first gateway can respond the heartbeat packet and reply a feedback information and dispatch system to DNS, and If the first gateway is in down state, the first gateway will not receive the heartbeat packet, and then will not do to the heartbeat packet Respond out, therefore, if preset time (such as 10 seconds, 20 seconds, 30 seconds, preset time can according to the actual situation depending on, not to this Make specific limitation) interior DNS scheduling system do not receive the feedback information of the first gateway return, then and above-mentioned apparatus can determine accordingly First gateway is in down state, therefore, using heartbeat mechanism principle, dispatches timing by DNS and sends out to the first gateway Send the mode of heartbeat packet, can the first gateway of accurate judgement local data center whether be in available mode.
In a preferred embodiment, request address further includes the second IP address of corresponding client, according to scheduled The step of priority policy determines the strange land data center of highest priority from remaining available strange land data center, packet It includes:
S13a1 obtains remaining corresponding gateway status of strange land data center, and determines currently own according to gateway status Available strange land data center;
S13a2 obtains the corresponding third IP address of currently all available strange land data centers, and according to the first IP address The distance between local data center and current all available strange land data centers are calculated with third IP address, it is multiple right to obtain The first distance answered, and, client and current all available strange land numbers are calculated according to the second IP address and third IP address According to the distance between center, multiple corresponding second distances are obtained;
S13a3 calculates distance of the client access service resources institute through link, acquisition according to first distance and second distance Multiple corresponding link ranges;
S13a4 is picked out from multiple link ranges apart from shortest link range, and will be apart from shortest link range Corresponding strange land data center is determined as the strange land data center of highest priority.
In above-mentioned steps S13a1, above-mentioned gateway status includes that gateway is in available mode and gateway is in unavailable shape State specifically can find out remaining corresponding IP address of strange land data center, and according to the IP found from external memory database Address accesses to the gateway of remaining strange land data center, and then dispatches timing into remaining strange land data by DNS The corresponding gateway of the heart sends the mode of heartbeat packet to obtain remaining corresponding gateway status of strange land data center, that is, utilizes heartbeat machine Principle processed, DNS scheduling system would know that the gateway of which strange land data center is in available mode, which strange land data center Gateway is in down state, and is recorded to this, therefore can get it by reading the record in DNS scheduling system The corresponding gateway status of remaining strange land data center, and then can be determined according to the gateway status got current all available different Ground data center.
In above-mentioned steps S13a2, since there are its corresponding IP address in each data center or client, pass through IP address would know that the position of local data center or strange land data center or client, for example, it is assumed that the first IP address For 123.125.71.38, then show that the position of local data center is Beijing, the second IP address of client is 113.65.161.23, then the position for showing client is Guangzhou, and the third IP address of some strange land data center is 116.234.222.36, then the position for showing the strange land data center is Shanghai, therefore, specifically, when according to gateway shape When state determines current all available strange land data centers, current all available strange lands can be found out from external memory database The corresponding third IP address of data center, so according to the first IP address and third IP address can calculate local data center with The distance between current all available strange land data centers, obtain multiple corresponding first distances, similarly, according to the 2nd IP Location and third IP address can calculate the distance between client and current all available strange land data centers, and it is multiple right to obtain The second distance answered.
It, can not be normally from local data due to being in down state when the first gateway in above-mentioned steps S13a3 It is by switch to other available strange land data centers and to call corresponding backup when getting required service resources in the heart Link accesses to local data center, therefore link that the service resources of client access local data center are passed through Are as follows: the available strange land data center-local data center of client-, and since there may be more for available strange land data center It is a, it is thus possible to which that there are a plurality of optional links for the service resources of client access local data center, it is therefore desirable to therefrom Suitable link is picked out, specifically, can get each available strange land number by calculating the sum of first distance and second distance According to the corresponding link range of link where center, relevant operation is executed to enter step S13a4.
In above-mentioned steps S13a4, since the delay that data occur during transmission will receive the shadow of transmission range It rings, generally, transmission range is bigger, is delayed longer, therefore link range is shorter, is delayed also shorter, therefore, is obtained by calculating After the corresponding link range of link where obtaining each available strange land data center, distance can be picked out from multiple link ranges Shortest link range, and the strange land that highest priority will be determined as apart from the corresponding strange land data center of shortest link range Data center can shorten the delay of data to the maximum extent in this way, improve user experience.
In another preferred embodiment, according to scheduled priority policy from remaining available strange land data center The step of determining the strange land data center of highest priority, comprising:
S13b1 obtains remaining corresponding network flow of strange land data center, and determines currently own according to network flow Available strange land data center;
S13b2, according to network flow, it is least from current all available strange land data centers to pick out network flow Strange land data center;
The least strange land data center of network flow is determined as the strange land data center of highest priority by S13b3.
In above-mentioned steps S13b1, since the acquisition of service resources needs to pass through the prison of network flow by gateway Control can know that the gateway of which strange land data center is in available mode indirectly, and the gateway of which strange land data center is in can not With state, and then determine therefrom that out that current all available strange land data centers specifically can pass through network flow monitoring technology (such as NetStream, Mirror, sFlow) obtains remaining corresponding network flow of strange land data center, if some strange land data The corresponding network flow in center is zero, then can determine that the strange land data center is unavailable accordingly, and if some strange land data center Corresponding network flow is not zero and (there is network flow), then can determine that the strange land data center is available accordingly.
It, then can further basis when determining current all available strange land data centers in above-mentioned steps S13b2 The network flow got is picked out in the least strange land data of network flow from current all available strange land data centers The heart executes relevant operation to enter step S13b3.
It, can not be normally from local data due to being in down state when the first gateway in above-mentioned steps S13b3 It is by switch to other available strange land data centers and to call corresponding backup when getting required service resources in the heart Link accesses to local data center, therefore the delay that data occur during transmission will receive strange land data The influence of " busy " degree at center itself, generally, network flow is more, shows that amount of access is bigger, the service of data center Also more " busy ", and then caused data delay is bigger, therefore network flow is fewer, is delayed also shorter, therefore can incite somebody to action The least strange land data center of currently available network flow is determined as the strange land data center of highest priority, in this way can be maximum Shorten to limit the delay of data, improves user experience.
In yet another preferred embodiment, request address further includes the second IP address of corresponding client, according to predetermined Priority policy the step of determining the strange land data center of highest priority from remaining available strange land data center, packet It includes:
S13c1 obtains remaining corresponding gateway status of strange land data center, and determines currently own according to gateway status Available strange land data center;
S13c2 obtains the corresponding network flow of currently all available strange land data centers and third IP address;
S13c3 calculates local data center and current all available strange lands according to the first IP address and third IP address The distance between data center obtains multiple corresponding first distances, and, it is calculated according to the second IP address and third IP address The distance between client and current all available strange land data centers, obtain multiple corresponding second distances, and according to the One distance and second distance calculate distance of the client access service resources institute through link, the multiple corresponding link ranges of acquisition;
S13c4 combines preset weighted value according to link range and network flow, from current all available strange land data The strange land data center of highest priority is determined in center.
In above-mentioned steps S13c1, above-mentioned gateway status includes that gateway is in available mode and gateway is in unavailable shape State specifically can find out remaining corresponding IP address of strange land data center, and according to the IP found from external memory database Address accesses to the gateway of remaining strange land data center, and then dispatches timing into remaining strange land data by DNS The corresponding gateway of the heart sends the mode of heartbeat packet to obtain remaining corresponding gateway status of strange land data center, that is, utilizes heartbeat machine Principle processed, DNS scheduling system would know that the gateway of which strange land data center is in available mode, which strange land data center Gateway is in down state, and is recorded to this, therefore can get it by reading the record in DNS scheduling system The corresponding gateway status of remaining strange land data center, and then can be determined according to the gateway status got current all available different Ground data center.
In above-mentioned steps S13c2, specifically, when being determined according to gateway status in current all available strange land data When the heart, current all available strange lands can be obtained by network flow monitoring technology (such as NetStream, Mirror, sFlow) The corresponding network flow of data center, meanwhile, current all available strange land data centers can be found out from external memory database Corresponding third IP address, so as to subsequent carry out relevant operation.
In above-mentioned steps S13c3, since there are its corresponding IP address in each data center or client, pass through IP address would know that the position of local data center or strange land data center or client, for example, it is assumed that the first IP address For 123.125.71.38, then show that the position of local data center is Beijing, the second IP address of client is 113.65.161.23, then the position for showing client is Guangzhou, and the third IP address of some strange land data center is 116.234.222.36, then the position for showing the strange land data center is Shanghai, therefore, specifically, according to the first IP Location and third IP address can calculate the distance between local data center and current all available strange land data centers, obtain Multiple corresponding first distances, similarly, according to the second IP address and third IP address can calculate client and it is current it is all can The distance between strange land data center obtains multiple corresponding second distances, and then by calculating first distance and second The corresponding link range of link where sum of the distance can get each available strange land data center, so as to the related behaviour of subsequent progress Make.
It, can not be normally from local data due to being in down state when the first gateway in above-mentioned steps S13c4 It is by switch to other available strange land data centers and to call corresponding backup when getting required service resources in the heart Link accesses to local data center, therefore the delay that data occur during transmission is mainly by data The influence of the two factors of transmission range and " busy " degree of strange land data center itself, generally, transmission range is smaller, prolongs When it is shorter;Network flow is fewer, is delayed shorter, therefore can combine preset weighted value according to link range and network flow, from The strange land data center of highest priority, specifically, preset weight are determined in current all available strange land data centers Value can be X:(link range+network flow), wherein X is constant, therefore, obtains current all available strange land data centers After the corresponding link range of link where corresponding network flow and each available strange land data center, it can calculate current The corresponding weighted value of all available strange land data centers, weighted value is bigger, then the delay of data is shorter, therefore can be by weight It is worth the strange land data center that maximum strange land data center is determined as highest priority, it so both can be more accurately available from remaining Strange land data center in determine the strange land data center of highest priority, and the delay of data can be shortened to the maximum extent, Improve user experience.
Referring to Fig. 2, the embodiment of the present application also proposes a kind of device for realizing that gateway strange land is mostly living, and being applied to data center is System, data center systems include at least Liang Ge data center, and each data center is separately positioned on different areas, and each number It is interconnected according to preset backup link is passed through between center, which includes:
Receiving module 11, for receiving the request address of client transmission, wherein request address includes the first IP address, First IP address is corresponding with local data center;
Access modules 12 for accessing the first gateway of local data center according to the first IP address, and judge the first net It closes and whether is in available mode;
Determining module 13, for when the first gateway is in down state, according to scheduled priority policy from remaining The strange land data center of highest priority is determined in available strange land data center;
Calling module 14 for the second gateway of the highest strange land data center of access privileges, and calls priority most Backup link between high strange land data center and local data center, so that client accesses local number by backup link According to the service resources at center.
In above-mentioned receiving module 11, local and remote side is in contrast, according to the actual access demand of user Determine, such as user needs to access the service resources of some data center, then the data center is considered as in local data at this time The heart, and remainder data center is considered as strange land data center, these data centers can be deployed in different according to business demand Area, such as Beijing, Shanghai, Guangzhou etc., wherein different data centers is stored with different service resources, different data There is its corresponding IP address at center, and user can select the data center for needing to access according to the business demand of itself, specifically, Such as user needs to access the service resources of some data center's (at this point, the data center is considered as local data center), Then user can be by client (such as Web browser) to above-mentioned apparatus (i.e. realization gateway strange land device mostly living) domain name mapping (DNS) scheduling system sends a request address (such as by inputting request address in the address field of Web browser), wherein In the request address contain IP address corresponding with the data center (i.e. the first IP address), so as to local data center into Row access.
In above-mentioned access modules 12, specifically, after receiving module 11 receives the request address of client transmission, access Module 12 would know that client needs to access local data center according to the first IP address in request address, and access local The service resources of data center then need the first gateway by accessing local data center to realize, it is therefore desirable to first check the Whether one gateway can be used, and specifically, access modules 12 find the first gateway of local data center according to the first IP address, in turn It accesses to the first gateway and (such as issues an access request to the first gateway), if the first gateway is not during access This (i.e. access request of the first gateway) is responded, then shows that the first gateway is in down state, and then can not access The service resources of local data center can transfer to determining module 13 to execute relevant operation at this time;And if during access, One gateway is made that response to this, then shows that the first gateway is in available mode, client can be direct by the first gateway at this time The service resources for accessing local data center, therefrom get required service resources.
In above-mentioned determining module 13, mutually interconnected due to passing through backup link set in advance between each data center It is logical, therefore when the first gateway is in down state and can not normally get required service resources from local data center When, by switch to other available strange land data centers and corresponding backup link can be called to carry out local data center Access, and since available strange land data center is there may be multiple, it is thus determined that the needs of module 13 therefrom first pick out it is preferential The highest strange land data center of grade, in addition, since local data center and strange land data center are in different areas, number According to transmission can postpone, therefore can be selected by determining module 13 the shortest strange land data center of delay as priority most High strange land data center.
In above-mentioned calling module 14, stored due to the service resources and local data center of the storage of strange land data center Service resources are not identical, therefore in order to guarantee that client can correctly get the service resources of local data center rather than different The service resources of ground data center, it is therefore desirable to which the data of the data and strange land data center that guarantee local data center want one It causes, and since client is when obtaining the service resources of data center, the memory of data center is accessed particular by gateway Database (such as Redis), and then required service resources are got by reading the static data in memory database, because Specific static data can be respectively written into the corresponding memory database of each data center and preset external memory number in advance by this According in library (such as oracle), then guarantee the static data and external memory in each memory database by doing static data reconciliation The static data of database is consistent, to can guarantee the static data of local data center and the static data of strange land data center It is consistent;In this step, specifically, when determining the strange land data center of highest priority by determining module 13, First IP address can be switched to the strange land data with highest priority by calling module 14 by domain name mapping (DNS) scheduling system The corresponding IP address in center, and then gone forward side by side according to the second gateway that the IP address finds the strange land data center of highest priority Row access after access the second gateway success, and then passes through in the strange land data center for calling the highest priority and local data Backup link between the heart, so that client can normally access the service resources of local data center by the backup link, from And realize that strange land is mostly living, solve the application of the computer room (i.e. local data center) where service side when something goes wrong, called side Where service side can not be accessed the technical issues of the service resources of computer room.
In the present embodiment, realization gateway strange land device mostly living between each data center by respectively configuring one Backup link, so that can be interconnected between each data center, while according to the configuration of backup link, by a data center Static data be placed in the corresponding memory database of backup link so that can guarantee between interconnected Liang Ge data center The consistency of data, the business money for making client that can not normally access the data center when a data center breaks down When source, by switch to other available data centers and it can call corresponding backup link the data center is visited It asks, so that can be mutually spare between multiple data centers, it realizes strange land and lives more, solve the computer room where service side Application when something goes wrong, the technical issues of called side can not access the service resources of computer room where service side.
Referring to Fig. 3, in a preferred embodiment, above-mentioned realization gateway strange land device mostly living, further includes:
First judgment module 09 for receiving identity information and the access token request of client transmission, and judges identity Whether information is legal;
Generation module 10, for when identity information is legal, response access token request, generation access token information simultaneously will Access token information is sent to client.
In the present embodiment, user needs to may have access to the business money of each data center by the authorized party of above-mentioned apparatus Source, specifically, before the service resources for obtaining local data center by client, user needs to infuse in certificate server Volume corresponding account (corresponding account is such as registered in certificate server) utilizes the account and correspondence after the completion of account registration Account number cipher logged in (such as login authentication server) certificate server, at this time first judgment module 09 can pass through certification clothes Whether business device verifies the corresponding account number cipher of the account correct, if correctly, first judgment module 09 can determine current visitor accordingly Family end send identity information be it is legal, at this time generation module 10 can customer in response end send access token request, pass through Certificate server generates a token information and returns to client, and client receives the access token information and caches to local In file, the service resources that such subsequent client can be specified by token information access local data center, in this way, logical Setting permission is crossed, so that only the client with token information could access the specified service resources of local data center, from And be conducive to improve the safety of data, prevent the service resources of local data center stolen.
Referring to Fig. 3, in a preferred embodiment, request address further includes access token information, above-mentioned realization gateway Strange land device mostly living, further includes:
Inspection module 14a, for examining access token information whether legal.
In the present embodiment, examine whether token information is legal can determine whether active client by inspection module 14a The permission of service resources with access local data center, so that the safety for improving data is conducive to by setting permission, Prevent the service resources of local data center stolen, wherein access token information is accompanied with timestamp and (is generating token letter Cease Shi Kewei token information and add a timestamp), specifically, inspection module 14a can examine access token in the following manner Whether information legal: due to timestamp have validity period, can first pass through Check-Out Time stamp whether it is expired come judge access enable Whether board information is legal, if timestamp is out of date, inspection module 14a can determine that access token information is illegal accordingly;If when Between stab not out of date, then further the access token information and multiple access token information for being pre-stored in external memory database are carried out Compare, judge whether there is occurrence, if it exists occurrence, then inspection module 14a can determine that the access token information is closed accordingly Method, occurrence if it does not exist, then inspection module 14a can determine that the access token information is illegal accordingly;If the access token is believed It is legal to cease, then illustrates that active client has the permission of service resources of access local data center, can transfer to call mould at this time Block 14 executes relevant operation;If the access token information is illegal, sending module 14b is transferred to execute relevant operation.
Referring to Fig. 3, in a preferred embodiment, above-mentioned realization gateway strange land device mostly living, further includes:
Sending module 14b, for sending the prompt of authentication failure to client when access token information is illegal Information, to prompt user to re-enter identity information;
Second judgment module 14c, the identity information returned for receiving client end response prompt information, and judge identity Whether information is legal;
Execution module 14d, for regenerating new token information and being sent to client when identity information is legal, And the second gateway of the highest strange land data center of access privileges, and call strange land data center and the local of highest priority Backup link between data center, so that client accesses the service resources of local data center by backup link.
In the present embodiment, if the access token information of active client offer is illegal, illustrate active client not The permission for having the service resources of access local data center, it is therefore desirable to authentication be carried out to active user again, specifically Ground, sending module 14b send the prompt information of authentication failure to client, and user is prompted to re-enter account and corresponding Account number cipher, then whether correct the second judgment module 14c by certificate server verifies the corresponding account number cipher of the account, if Correctly, then the identity information that the second judgment module 14c can determine that active client returns accordingly is legal, meanwhile, also illustrate Causing the illegal reason of token information to be likely due to, timestamp is expired, and execution module 14d can pass through certification at this time Server regenerates a new token information and is sent to client, meanwhile, in the highest strange land data of access privileges Second gateway of the heart, and the backup link between the strange land data center of highest priority and local data center is called, so that Client accesses the service resources of local data center by backup link.
Referring to Fig. 4, in a preferred embodiment, above-mentioned access modules 12, comprising:
Transmission unit 121 sends heartbeat packet to the first gateway for being spaced predetermined period, and judge in preset time whether Receive the feedback information that the first gateway is returned in response to heartbeat packet;
Judging unit 122, for determining first when not receiving the feedback information of the first gateway return in preset time Gateway is in down state.
In the present embodiment, specifically, transmission unit 121 can dispatch system interval predetermined period (such as every 5 by DNS Second, 10 seconds, 15 seconds etc., predetermined period can according to the actual situation depending on, this is not limited specifically) to local data First gateway at center sends a heartbeat packet, according to heartbeat mechanism principle, if the first gateway is in available mode, when first When gateway receives the heartbeat packet, then the first gateway can respond the heartbeat packet and reply a feedback information and dispatch system to DNS, And if the first gateway is in down state, the first gateway will not receive the heartbeat packet, and then will not be to the heartbeat packet Respond, therefore, if preset time (such as 10 seconds, 20 seconds, 30 seconds, preset time can according to the actual situation depending on, to this Not limiting specifically) interior DNS scheduling system do not receive the feedback information of the first gateway return, then and judging unit 122 can evidence This determines that the first gateway is in down state, therefore, using heartbeat mechanism principle, dispatches timing to first by DNS Gateway sends the mode of heartbeat packet, can the first gateway of accurate judgement local data center whether be in available mode.
Referring to Fig. 5, in a preferred embodiment, request address further includes the second IP address of corresponding client, on State determining module 13, comprising:
First acquisition unit 13a1, for obtaining remaining corresponding gateway status of strange land data center, and according to gateway shape State determines current all available strange land data centers;
Second acquisition unit 13a2, for obtaining the corresponding third IP address of currently all available strange land data centers, And it is calculated between local data center and current all available strange land data centers according to the first IP address and third IP address Distance, obtain multiple corresponding first distances, and, client and current is calculated according to the second IP address and third IP address The distance between all available strange land data centers obtain multiple corresponding second distances;
First computing unit 13a3 is passed through for calculating client access service resources according to first distance and second distance The distance of link obtains multiple corresponding link ranges;
First determination unit 13a4, is picked out from multiple link ranges apart from shortest link range, and will be apart from most The corresponding strange land data center of short link range is determined as the strange land data center of highest priority.
In above-mentioned first acquisition unit 13a1, above-mentioned gateway status includes that gateway is in available mode and gateway in not Available mode, specifically, it is corresponding that first acquisition unit 13a1 can find out remaining strange land data center from external memory database IP address, and accessed according to gateway of the IP address found to remaining strange land data center, and then dispatched by DNS and be System timing sends the mode of heartbeat packet to the corresponding gateway of remaining strange land data center and corresponds to obtain remaining strange land data center Gateway status, that is, utilize heartbeat mechanism principle, DNS scheduling system would know that the gateway of which strange land data center is in available The gateway of state, which strange land data center is in down state, and is recorded to this, therefore can obtain by first single First 13a1 reads the record in DNS scheduling system to get remaining corresponding gateway status of strange land data center, and then first Acquiring unit 13a1 can determine current all available strange land data centers according to the gateway status got.
In above-mentioned second acquisition unit 13a2, since there are its corresponding IP address in each data center or client, Therefore it would know that the position of local data center or strange land data center or client by IP address, for example, it is assumed that the One IP address is 123.125.71.38, then shows that the position of local data center is Beijing, the second IP address of client For 113.65.161.23, then show that the position of client is Guangzhou, the third IP address of some strange land data center is 116.234.222.36, then the position for showing the strange land data center is Shanghai, therefore, specifically, when according to gateway shape When state determines current all available strange land data centers, second acquisition unit 13a2 can be found out from external memory database to be worked as The corresponding third IP address of preceding all available strange land data centers, and then can be calculated according to the first IP address and third IP address The distance between local data center and current all available strange land data centers out, obtain multiple corresponding first distances, Similarly, it can be calculated between client and current all available strange land data centers according to the second IP address and third IP address Distance, obtain multiple corresponding second distances.
It, can not be normally from local due to being in down state when the first gateway in above-mentioned first computing unit 13a3 It is by switch to other available strange land data centers and to call corresponding when getting required service resources in data center Backup link access to local data center, therefore the service resources of client access local data center are passed through Link are as follows: the available strange land data center-local data center of client-, and since available strange land data center may There are multiple, it is thus possible to which there are a plurality of optional links for the service resources of client access local data center, therefore needs Suitable link is selected, specifically, the sum of first distance and second distance are calculated by the first computing unit 13a3 The corresponding link range of link where can get each available strange land data center, to transfer to the first determination unit 13a4 Execute relevant operation.
In above-mentioned first determination unit 13a4, since the delay that data occur during transmission will receive transmission distance From influence, generally, transmission range is bigger, is delayed bigger, therefore link range is shorter, and delay is also just smaller, therefore, passes through After the corresponding link range of link where first computing unit 13a3 calculates each available strange land data center of acquisition, it can pass through First determination unit 13a4 is picked out from multiple link ranges apart from shortest link range, and will apart from shortest link away from From the strange land data center that corresponding strange land data center is determined as highest priority, data can be shortened to the maximum extent in this way Delay improves user experience.
Referring to Fig. 6, in another preferred embodiment, above-mentioned determining module 13, comprising:
Third acquiring unit 13b1, for obtaining remaining corresponding network flow of strange land data center, and according to network flow Amount determines current all available strange land data centers;
Module of selection 13b2, for picking out net from current all available strange land data centers according to network flow The least strange land data center of network flow;
Second determination unit 13b3, for the least strange land data center of network flow to be determined as the different of highest priority Ground data center.
In above-mentioned third acquiring unit 13b1, since the acquisition of service resources needs to pass through network by gateway The monitoring of flow can know that the gateway of which strange land data center is in available mode, the gateway of which strange land data center indirectly In down state, and then determine therefrom that out current all available strange land data centers, specifically, third acquiring unit 13b1 can obtain remaining strange land data center pair by network flow monitoring technology (such as NetStream, Mirror, sFlow) The network flow answered, if some corresponding network flow of strange land data center is zero, third acquiring unit 13b1 can sentence accordingly The fixed strange land data center is unavailable, and if some corresponding network flow of strange land data center is not zero and (there is network flow Amount), then third acquiring unit 13b1 can determine that the strange land data center is available accordingly.
In above-mentioned module of selection 13b2, when determining current all available strange land numbers by third acquiring unit 13b1 It, then can be by module of selection 13b2 further according to the network flow got, from current all available strange lands when according to center The least strange land data center of network flow is picked out in data center, to transfer to the second determination unit 13b3 to execute related behaviour Make.
It, can not be normally from local due to being in down state when the first gateway in above-mentioned second determination unit 13b3 It is by switch to other available strange land data centers and to call corresponding when getting required service resources in data center Backup link access to local data center, therefore the delay that occurs during transmission of data will receive it is different The influence of " busy " degree of ground data center itself, generally, network flow is more, shows that amount of access is bigger, data center Service also more " busy ", and then caused data delay is bigger, therefore network flow is fewer, and delay is also just smaller, because The currently available least strange land data center of network flow can be determined as priority most by the second determination unit 13b3 by this High strange land data center can shorten the delay of data to the maximum extent in this way, improve user experience.
Referring to Fig. 7, in yet another preferred embodiment, request address further includes the second IP address of corresponding client, Above-mentioned determining module 13, comprising:
4th acquiring unit 13c1, for obtaining remaining corresponding gateway status of strange land data center, and according to gateway shape State determines current all available strange land data centers;
5th acquiring unit 13c2, for obtaining the corresponding network flow of current all available strange land data centers and the Three IP address;
Second computing unit 13c3, for according to the first IP address and third IP address calculating local data center and currently The distance between all available strange land data centers obtain multiple corresponding first distances, and, according to the second IP address and Third IP address calculates the distance between client and current all available strange land data centers, obtains multiple corresponding second Distance, and distance of the client access service resources institute through link is calculated according to first distance and second distance, acquisition is multiple right The link range answered;
Third determination unit 13c4, for combining preset weighted value according to link range and network flow, from current institute There is the strange land data center that highest priority is determined in available strange land data center.
In above-mentioned 4th acquiring unit 13c1, above-mentioned gateway status includes that gateway is in available mode and gateway in not Available mode, specifically, it is corresponding that the 4th acquiring unit 13c1 can find out remaining strange land data center from external memory database IP address, and accessed according to gateway of the IP address found to remaining strange land data center, and then dispatched by DNS and be System timing sends the mode of heartbeat packet to the corresponding gateway of remaining strange land data center and corresponds to obtain remaining strange land data center Gateway status, that is, utilize heartbeat mechanism principle, DNS scheduling system would know that the gateway of which strange land data center is in available The gateway of state, which strange land data center is in down state, and is recorded to this, therefore can obtain by the 4th single First 13c1 reads the record in DNS scheduling system to get remaining corresponding gateway status of strange land data center, and then the 4th Acquiring unit 13c1 can determine current all available strange land data centers according to the gateway status got.
In above-mentioned 5th acquiring unit 13c2, specifically, when the 4th acquiring unit 13c1 is determined according to gateway status When current all available strange land data centers, the 5th acquiring unit 13c2 can be by network flow monitoring technology (such as NetStream, Mirror, sFlow etc.) the corresponding network flow of currently all available strange land data centers is obtained, meanwhile, it can The corresponding third of currently all available strange land data centers is found out from external memory database by the 5th acquiring unit 13c2 IP address, so as to subsequent carry out relevant operation.
In above-mentioned second computing unit 13c3, since there are its corresponding IP address in each data center or client, Therefore it would know that the position of local data center or strange land data center or client by IP address, for example, it is assumed that the One IP address is 123.125.71.38, then shows that the position of local data center is Beijing, the second IP address of client For 113.65.161.23, then show that the position of client is Guangzhou, the third IP address of some strange land data center is 116.234.222.36, then the position for showing the strange land data center is Shanghai, therefore, specifically, the second computing unit 13c3 can be calculated in local data center and current all available strange land data according to the first IP address and third IP address The distance between heart obtains multiple corresponding first distances, and similarly, the second computing unit 13c3 is according to the second IP address and third IP address can calculate the distance between client and current all available strange land data centers, obtain multiple corresponding second Distance, and then the sum of first distance and second distance are calculated by the second computing unit 13c3 and can get each available strange land number According to the corresponding link range of link where center, so as to subsequent carry out relevant operation.
It, can not be normally from local due to being in down state when the first gateway in above-mentioned third determination unit 13c4 It is by switch to other available strange land data centers and to call corresponding when getting required service resources in data center Backup link access to local data center, therefore the delay that occurs during transmission of data mainly by The influence of the two factors of the transmission range of data and " busy " degree of strange land data center itself, generally, transmission range It is smaller, it is delayed smaller;Network flow is fewer, is delayed smaller, therefore third determination unit 13c4 can be according to link range and network Flow combines preset weighted value, and the strange land data of highest priority are determined from current all available strange land data centers Center, specifically, preset weighted value can be X:(total distance+network flow), wherein X is constant, therefore, obtains current institute The corresponding chain of link where having the corresponding network flow of available strange land data center and each available strange land data center After the distance of road, the corresponding weighted value of current all available strange land data centers can be calculated, weighted value is bigger, then data are prolonged When with regard to smaller, therefore the maximum strange land data center of weighted value can be determined as highest priority by third determination unit 13c4 Strange land data center, both more accurately can determine the different of highest priority from remaining available strange land data center in this way Ground data center, and the delay of data can be shortened to the maximum extent, improve user experience.
Referring to Fig. 8, a kind of computer equipment is also provided in the embodiment of the present application, which can be server, Its internal structure can be as shown in Figure 8.The computer equipment includes processor, the memory, network connected by system bus Interface and database.Wherein, the processor of the Computer Design is for providing calculating and control ability.The computer equipment is deposited Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program And database.The internal memory provides environment for the operation of operating system and computer program in non-volatile memory medium.It should The database of computer equipment is used to store the method program etc. for realizing that gateway strange land is mostly living.The network interface of the computer equipment For being communicated with external terminal by network connection.The computer program realizes any of the above-described embodiment when being executed by processor In the method for realizing that gateway strange land is mostly living.
The embodiment of the present application also proposes a kind of computer readable storage medium, is stored thereon with computer program, computer The method for realizing that gateway strange land is mostly living in any of the above-described embodiment is realized when program is executed by processor.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can store and a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, Any reference used in provided herein and embodiment to memory, storage, database or other media, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM can by diversified forms , such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double speed are according to rate SDRAM (SSRSDRAM), increasing Strong type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, device, article or the method that include a series of elements not only include those elements, and And further include the other elements being not explicitly listed, or further include for this process, device, article or method institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, device of element, article or method.
The above description is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all utilizations Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content is applied directly or indirectly in other correlations Technical field, be included within the scope of the present invention.

Claims (10)

1. a kind of method for realizing that gateway strange land is mostly living, which is characterized in that be applied to data center systems, the system, data center System includes at least Liang Ge data center, and each data center is separately positioned on different areas, and in each data It is interconnected between the heart by preset backup link, which comprises
Receive client send request address, wherein the request address include the first IP address, first IP address with Local data center is corresponding;
The first gateway of the local data center is accessed according to first IP address, and judges whether first gateway is located In available mode;
If first gateway is in down state, according to scheduled priority policy from remaining available strange land data The strange land data center of highest priority is determined in the heart;
Second gateway of the highest strange land data center of access privileges, and call the strange land data of highest priority The backup link between center and the local data center, so that the client accesses institute by the backup link State the service resources of local data center.
2. the method according to claim 1 for realizing that gateway strange land is mostly living, which is characterized in that the reception client is sent Request address the step of before, further includes:
The identity information and access token request that the client is sent are received, and judges whether the identity information is legal;
If the identity information is legal, the access token request is responded, access token information is generated and enables the access Board information is sent to the client.
3. the method according to claim 2 for realizing that gateway strange land is mostly living, which is characterized in that the request address further includes The access token information, the second gateway of the highest strange land data center of access privileges, and call priority Before the step of backup link between the highest strange land data center and the local data center, further includes:
Examine the access token information whether legal;
If the access token information is legal, the second net of the highest strange land data center of the access privileges is executed It closes, and calls the backup link between the strange land data center of highest priority and the local data center, with The step of making the client access the service resources of the local data center by the backup link.
4. the method according to claim 1 for realizing that gateway strange land is mostly living, which is characterized in that judgement first net Close the step of whether being in available mode, comprising:
It is spaced predetermined period and sends heartbeat packet to first gateway, and judge whether receive first net in preset time Close the feedback information for responding the heartbeat packet and returning;
If not receiving the feedback information that first gateway returns in preset time, determine that first gateway is in Down state.
5. the method according to any one of claim 1 to 4 for realizing that gateway strange land is mostly living, which is characterized in that described to ask Asking address further includes the second IP address of the corresponding client, described available different from remaining according to scheduled priority policy The step of strange land data center of highest priority is determined in ground data center, comprising:
Obtain the corresponding gateway status of remaining described strange land data center, and according to the gateway status determine it is current it is all can The strange land data center;
Obtain the corresponding third IP address of current all available strange land data centers, and according to first IP address and The third IP address calculates the distance between the local data center and current all available strange land data centers, Multiple corresponding first distances are obtained, and, the client is calculated according to second IP address and the third IP address The distance between current all available described strange land data centers, obtain multiple corresponding second distances;
According to the first distance and the second distance calculate the client access the service resources through link away from From the multiple corresponding link ranges of acquisition;It is picked out from multiple link ranges apart from the shortest link range, and It will be determined as the strange land data of highest priority apart from the corresponding strange land data center of the shortest link range Center.
6. the method according to any one of claim 1 to 4 for realizing that gateway strange land is mostly living, which is characterized in that described to press According to scheduled priority policy from the strange land data for determining highest priority in remaining available strange land data center The step of heart, comprising:
Obtain the corresponding network flow of remaining described strange land data center, and according to the network flow determine it is current it is all can The strange land data center;
According to the network flow, it is minimum from current all available strange land data centers to pick out the network flow The strange land data center;
The least strange land data center of the network flow is determined as to the strange land data center of highest priority.
7. the method according to any one of claim 1 to 4 for realizing that gateway strange land is mostly living, which is characterized in that described to ask Asking address further includes the second IP address of the corresponding client, described available different from remaining according to scheduled priority policy The step of strange land data center of highest priority is determined in ground data center, comprising:
Obtain the corresponding gateway status of remaining described strange land data center, and according to the gateway status determine it is current it is all can The strange land data center;
Obtain the corresponding network flow of current all available strange land data centers and third IP address;
The local data center and current all available institutes are calculated according to first IP address and the third IP address It states the distance between strange land data center, obtains multiple corresponding first distances, and, according to second IP address and described Third IP address calculates the distance between the client and current all available strange land data centers, and it is multiple right to obtain The second distance answered, and the client is calculated according to the first distance and the second distance and accesses the service resources institute Distance through link obtains multiple corresponding link ranges;
Preset weighted value is combined according to the link range and the network flow, from current all available strange land numbers According to the strange land data center for determining highest priority in center.
8. a kind of device for realizing that gateway strange land is mostly living, which is characterized in that be applied to data center systems, the system, data center System includes at least Liang Ge data center, and each data center is separately positioned on different areas, and in each data It is interconnected between the heart by preset backup link, described device includes:
Receiving module, for receiving the request address of client transmission, wherein the request address includes the first IP address, institute It is corresponding with local data center to state the first IP address;
Access modules, for accessing the first gateway of the local data center according to first IP address, and described in judgement Whether the first gateway is in available mode;
Determining module is used for when first gateway is in down state, can from remaining according to scheduled priority policy The strange land data center of highest priority is determined in the data center of strange land;
Calling module for the second gateway of the highest strange land data center of access privileges, and calls highest priority The strange land data center and the local data center between the backup link so that the client pass through it is described Backup link accesses the service resources of the local data center.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the processor realizes that realization gateway strange land described in any one of claims 1 to 7 is more when executing the computer program The step of method living.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method that realization gateway strange land is lived more described in any one of claims 1 to 7 is realized when being executed by processor.
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 true CN110177007A (en) 2019-08-27
CN110177007B 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)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110635950A (en) * 2019-09-30 2019-12-31 深圳供电局有限公司 Double-data-center disaster recovery system
CN110809064A (en) * 2019-09-05 2020-02-18 连连银通电子支付有限公司 IP address switching method, device and system
CN110855808A (en) * 2019-10-11 2020-02-28 新浪网技术(中国)有限公司 Domain name automatic switching method, device and system based on distributed monitoring strategy
CN110868450A (en) * 2019-10-15 2020-03-06 平安科技(深圳)有限公司 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
CN111526038A (en) * 2020-03-26 2020-08-11 口碑(上海)信息技术有限公司 Service request distribution method and device, computer equipment and readable storage medium
WO2020211364A1 (en) * 2019-04-16 2020-10-22 平安科技(深圳)有限公司 Method and apparatus for achieving multi-site high availability of gateway, computer device, and storage medium
CN112039710A (en) * 2020-09-02 2020-12-04 曙光信息产业(北京)有限公司 Service fault processing method, terminal device and readable storage medium
CN112187738A (en) * 2020-09-11 2021-01-05 中国银联股份有限公司 Service data access control method, device and computer readable storage medium
CN112507381A (en) * 2020-12-21 2021-03-16 中电福富信息科技有限公司 Asset information and security management device supporting multiple operating systems
CN112565327A (en) * 2019-09-26 2021-03-26 广州虎牙科技有限公司 Access flow forwarding method, cluster management method and related device
CN114567646A (en) * 2022-03-08 2022-05-31 京东科技信息技术有限公司 Data processing method, data processing system, electronic device, and storage medium
CN114785465A (en) * 2022-04-26 2022-07-22 上海识装信息科技有限公司 Method, server and storage medium for realizing remote multi-activity
CN117041089A (en) * 2023-08-21 2023-11-10 江苏臻云技术有限公司 Equipment monitoring system and method for remote data center

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037861B (en) * 2021-03-25 2023-08-22 北京奇艺世纪科技有限公司 Service node connection method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090097478A1 (en) * 2007-10-10 2009-04-16 Microsoft Corporation Techniques to access messaging services for branch offices
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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090097478A1 (en) * 2007-10-10 2009-04-16 Microsoft Corporation Techniques to access messaging services for branch offices
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

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020211364A1 (en) * 2019-04-16 2020-10-22 平安科技(深圳)有限公司 Method and apparatus for achieving multi-site high availability of gateway, computer device, and storage medium
CN110809064A (en) * 2019-09-05 2020-02-18 连连银通电子支付有限公司 IP address switching method, device and system
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
CN112565327A (en) * 2019-09-26 2021-03-26 广州虎牙科技有限公司 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
CN110855808A (en) * 2019-10-11 2020-02-28 新浪网技术(中国)有限公司 Domain name automatic switching method, device and system based on distributed monitoring strategy
CN110868450A (en) * 2019-10-15 2020-03-06 平安科技(深圳)有限公司 Dual-computer room multi-entrance session keeping method, system, device and storage medium
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
CN111526038A (en) * 2020-03-26 2020-08-11 口碑(上海)信息技术有限公司 Service request distribution method and device, computer equipment and readable storage medium
CN112039710A (en) * 2020-09-02 2020-12-04 曙光信息产业(北京)有限公司 Service fault processing method, terminal device and readable storage medium
CN112187738A (en) * 2020-09-11 2021-01-05 中国银联股份有限公司 Service data access control method, device and computer readable storage medium
CN112507381A (en) * 2020-12-21 2021-03-16 中电福富信息科技有限公司 Asset information and security management device supporting multiple operating systems
CN114567646A (en) * 2022-03-08 2022-05-31 京东科技信息技术有限公司 Data processing method, data processing system, electronic device, and storage medium
CN114785465A (en) * 2022-04-26 2022-07-22 上海识装信息科技有限公司 Method, server and storage medium for realizing remote multi-activity
CN114785465B (en) * 2022-04-26 2024-04-12 上海识装信息科技有限公司 Implementation method, server and storage medium for multiple activities in different places
CN117041089A (en) * 2023-08-21 2023-11-10 江苏臻云技术有限公司 Equipment monitoring system and method for remote data center
CN117041089B (en) * 2023-08-21 2024-01-23 江苏臻云技术有限公司 Equipment monitoring system and method for remote data center

Also Published As

Publication number Publication date
WO2020211364A1 (en) 2020-10-22
CN110177007B (en) 2022-03-18

Similar Documents

Publication Publication Date Title
CN110177007A (en) Realize gateway strange land method, apparatus, computer equipment and storage medium mostly living
CN103490886B (en) The verification method of permissions data, apparatus and system
CN106911728B (en) The choosing method and device of host node in distributed system
CN1949774B (en) Method and apparatus for managing web application program conversation
CN108206830B (en) Vulnerability scanning method, apparatus, computer equipment and storage medium
CN112367321B (en) Method for quickly constructing service call and middle station API gateway
CN110381072A (en) Data verification method, system and computer readable storage medium based on block chain
CN109547458A (en) Login validation method, device, computer equipment and storage medium
US20110202645A1 (en) Methods and Apparatus to Test Network Elements
CN108108973A (en) Business risk control method and device
EP3085023B1 (en) Communications security
CN108900640A (en) Node calls link generation method, device, computer equipment and storage medium
CN107864143B (en) Self-evolution efficient proxy resource supply system and method
CN108429765A (en) A kind of method, server and system for realizing domain name mapping based on block chain
CN110213217A (en) Data access method, relevant apparatus, gateway and data access system
CN109120616A (en) A kind of identity identifying method, device, agency service end and storage medium
CN110990183A (en) Database cluster anomaly detection method and device and computer-readable storage medium
CN110109812A (en) Statistical method, device, computer equipment and the storage medium of access log data
CN110378691A (en) Block chain dispositions method, device and computer equipment based on deployment center
CN109166040A (en) Transaction auditing method, device, equipment and storage medium based on block chain
CN109857391A (en) Processing method and processing device, storage medium and the electronic device of data
KR20210130989A (en) api gateway accelerator system and methods
CN112799970B (en) Test data processing method, device, electronic equipment and medium
CN112398857B (en) Firewall testing method, device, computer equipment and storage medium
CN113872828A (en) State monitoring method for block chain prediction machine

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