CN105099987B - Business access method, the apparatus and system of terminal - Google Patents
Business access method, the apparatus and system of terminal Download PDFInfo
- Publication number
- CN105099987B CN105099987B CN201410168210.1A CN201410168210A CN105099987B CN 105099987 B CN105099987 B CN 105099987B CN 201410168210 A CN201410168210 A CN 201410168210A CN 105099987 B CN105099987 B CN 105099987B
- Authority
- CN
- China
- Prior art keywords
- server
- terminal
- connection
- address
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
This application discloses a kind of business access method of terminal, apparatus and systems, belong to internet arena.This method includes:First server receives the first connection that terminal is sent and establishes inquiry message, and the Internet protocol IP address of inquiry message at least carried terminal is established in the first connection;First server establishes addition transmission in inquiry message in the first connection and invites the time, obtains the second connection and establishes inquiry message;Second connection is established inquiry message and is sent respectively at least one second server by first server, and first server and second server are the servers that same service is provided for terminal;First server sends connection to terminal when sending the arrival of invitation time, according to the IP address of terminal and establishes invitation message;If response message is established in the connection that first server receives terminal transmission, first server provides the terminal with service.Present invention reduces lower deployment costs, accelerate business processing speed, and then increase usage experience.
Description
Technical field
The present invention relates to internet arena, more particularly to a kind of business access method of terminal, apparatus and system.
Background technology
With the development of internet, the service type that internet is provided is more and more, the range of user oriented group of institute
Also it is increasing.In contrast, in internet the hardware performance of server development far from matching demand development.So
In order to ensure that the communication efficiency of terminal is best and user obtains best usage experience, terminal is needed from known multiple offers
The server for selecting geographical location nearest in the server of same services, and nearest server is accessed, by nearest server
Service is provided for it.
The service access process of terminal can be at present:Terminal is to DNS (Domain Name Server, domain name clothes
It is engaged in device) the scheduler dispatches DNS query message of function, which carries the IP (Internet of domain name and the terminal
Protocol, Internet protocol) address, the DNS query message is with being used to inquire the IP of the corresponding server of domain name
Location.The IP address that the IP address for the terminal that scheduler is carried according to DNS query message and public network address library include and geography
Correspondence between position searches the corresponding geographical location of IP address of terminal, the geographical location of acquisition is determined as the end
The geographical location at end.Further, from the correspondence between stored geographic range and server ip address, terminal is obtained
Geographical location where the corresponding server ip address of geographic range, the server ip address of acquisition is determined as from the terminal
The IP address of nearest server, and the IP address of the server is sent to the terminal, make the terminal according to the IP received
The server nearest from terminal is accessed in address, and service is provided for the terminal by the server nearest from terminal.
Inventor has found that the prior art has at least the following problems:
Since the corresponding IP address in geographical location often changes in real network, so public network address library is difficult to tie up
Shield.Meanwhile if the IP address of the terminal passes through network address translation in the operator network, at this point, the IP address of the terminal
It can not reflect the true geographical location of terminal.So depend only on the IP address of the terminal and geographic range and service
Correspondence between device IP address cannot be guaranteed that communication efficiency when server provides service for terminal is best.
Invention content
In order to solve problem of the prior art, an embodiment of the present invention provides a kind of business access method of terminal, devices
And system.The technical solution is as follows:
In a first aspect, a kind of business access method of terminal is provided, the method includes:
First server receives the first connection that terminal is sent and establishes inquiry message, and inquiry message is established in first connection
At least carry the Internet protocol IP address of the terminal;
The first server establishes addition transmission in inquiry message in the described first connection and invites the time, obtains the second company
Connect foundation inquiry message;
Described second connection is established inquiry message and is sent respectively at least one second server by the first server,
The first server and the second server are the servers that same service is provided for the terminal;
The first server it is described send the time is invited to reach when, according to the IP address of the terminal to the terminal
It sends connection and establishes invitation message;
If the first server receives the connection that the terminal is sent and establishes response message, the first service
Device provides the service to the terminal.
With reference to first aspect, in the first possible realization method of above-mentioned first aspect, the first server exists
First connection establishes addition transmission in inquiry message and invites the time, obtains the second connection and establishes before inquiry message, also wraps
It includes:
The first server record receives the time that inquiry message is established in first connection;
The first server is obtained respectively between each second server at least one second server
Communication delay, obtain at least one communication delay;
The first server selects maximum communication delay from least one communication delay, according to the maximum
Communication delay determine delay time;
The first server will receive first connection establish time and the delay time of inquiry message into
Row is added, and is obtained described send and is invited the time.
With reference to first aspect or the first possible realization method of first aspect, second in above-mentioned first aspect can
In the realization method of energy, the resource size also carried needed for foundation connection is established in inquiry message in first connection;
Correspondingly, the first server sends connection and establishes to invite and disappears according to the IP address of the terminal to the terminal
Before breath, further include:
The first server obtains the idling-resource size in the first server;
Idling-resource size in the first server first server is established with described needed for connection
Resource size;
It is big to determine that the idling-resource size in the first server is greater than or equal to the resource established needed for connection
It is small.
Second of possible realization method with reference to first aspect, in the third possible realization side of above-mentioned first aspect
In formula, before the first server establishes invitation message according to the IP address of the terminal to terminal transmission connection, also
Including:
The first server establishes the resource size needed for connecting according to described, and the company of foundation is reserved for the terminal
Connect required resource.
With reference to first aspect, the possible realization method of the first of first aspect, first aspect second of possible reality
The third possible realization method of existing mode or first aspect, in the 4th kind of possible realization method of above-mentioned first aspect
In, the described second connection is established inquiry message and is sent respectively at least one second server by the first server, including:
First server selected section second server from least one second server;
Described second connection is established inquiry message and is sent respectively to the part second server by the first server.
The 4th kind of possible realization method with reference to first aspect, in the 5th kind of possible realization side of above-mentioned first aspect
In formula, first server selected section second server from least one second server, including:
The first server obtains correspondingly according to the IP address of the terminal from stored public network address library
Position is managed, the public network address library includes the correspondence between IP address and geographical location;
The first server determines the geographical model where the geographical location of the terminal according to the geographical location of acquisition
It encloses;
The first server obtains institute from the correspondence between stored geographic range and server ip address
The corresponding at least one server ip address of geographic range where stating the geographical location of terminal;
The corresponding server of at least one server ip address of acquisition is determined as selecting by the first server
Part second server.
Second aspect provides a kind of business access method of terminal, the method includes:
Second server receives the second connection that first server is sent and establishes inquiry message, and second connection, which is established, askes
Ask that message at least carries the Internet protocol IP address for sending and inviting time and terminal, inquiry message is established in second connection
To be the first server establish inquiry message according to the first connection that the terminal is sent generate, the first server with
The second server is the server that same service is provided for the terminal;
When it is described send the time is invited to reach when, the second server is according to the IP address of the terminal to the terminal
It sends connection and establishes invitation message;
If the second server receives the connection that the terminal is sent and establishes response message, the second service
Device provides the service to the terminal.
With reference to second aspect, in the first possible realization method of above-mentioned second aspect, second connection is established
Inquire the resource size for also carrying and being established needed for connection in message;
Correspondingly, the second server sends connection and establishes to invite and disappears according to the IP address of the terminal to the terminal
Before breath, further include:
The second server obtains the idling-resource size in the second server;
Idling-resource size in the second server second server is established with described needed for connection
Resource size;
It is big to determine that the idling-resource size in the second server is greater than or equal to the resource established needed for connection
It is small.
With reference to the first possible realization method of second aspect, in second of possible realization side of above-mentioned second aspect
In formula, before the second server establishes invitation message according to the IP address of the terminal to terminal transmission connection, also
Including:
The second server establishes the resource size needed for connecting according to described, and the company of foundation is reserved for the terminal
Connect required resource.
The third aspect provides a kind of service access device of terminal, is integrated in first server, described device packet
It includes:
Inquiry message is established in receiving module, the first connection for receiving terminal transmission, and inquiry is established in first connection
Message at least carries the Internet protocol IP address of the terminal;
Add module, first connection for being received in the receiving module are established addition transmission in inquiry message and are invited
Please the time, obtain the second connection establish inquiry message;
Sending module, for by the add module obtain it is described second connection establish inquiry message be sent respectively to
A few second server, the first server and the second server are the services that same service is provided for the terminal
Device;And
When the transmission invites the time to reach, connection foundation is sent to the terminal according to the IP address of the terminal and is invited
It please message;
Module is provided, if response message is established in the connection that the terminal transmission is received for the first server,
Then the service is provided to the terminal.
With reference to the third aspect, in the first possible realization method of the above-mentioned third aspect, described device further includes:
Logging modle, for recording the time that the receiving module receives first connection and establishes inquiry message;
Acquisition module, for obtaining respectively between each second server at least one second server
Communication delay obtains at least one communication delay;
Determining module, for selecting maximum communication from least one communication delay that the acquisition module obtains
Time delay determines delay time according to the communication delay of the maximum;
Computing module, for that will receive, the time of inquiry message will be established in first connection and the delay time carries out
It is added, obtains described send and invite the time.
With reference to the possible realization method of the first of the third aspect or the third aspect, second in the above-mentioned third aspect can
In the realization method of energy, the resource size also carried needed for foundation connection is established in inquiry message in first connection;
Correspondingly, described device further includes comparison module:
The acquisition module is additionally operable to obtain the idling-resource size in the first server;
The comparison module is established with described needed for connection for the idling-resource size in the first server
Resource size;
The determining module is additionally operable to determine that the idling-resource size in the first server is greater than or equal to described build
Resource size needed for vertical connection triggers the sending module when the transmission invites the time to reach, according to the terminal
IP address sends connection to the terminal and establishes invitation message.
With reference to second of possible realization method of the third aspect, in the third possible realization side of the above-mentioned third aspect
In formula, described device further includes:
Reserved module is established for sending connection to the terminal according to the IP address of the terminal in the sending module
Before invitation message, according to it is described establish connection needed for resource size, for the terminal reserve it is described establish connection needed for
Resource.
Second of possible reality of the first possible realization method, the third aspect with reference to the third aspect, the third aspect
The third possible realization method of existing mode or the third aspect, in the 4th kind of possible realization method of the above-mentioned third aspect
In, the sending module includes:
Selecting unit, for the selected section second server from least one second server;
Transmitting element is sent respectively to the part second server for the described second connection to be established inquiry message.
With reference to the 4th kind of possible realization method of the third aspect, in the 5th kind of possible realization side of the above-mentioned third aspect
In formula, the selecting unit includes:
Subelement is obtained, for the IP address according to the terminal, is obtained from stored public network address library corresponding
Geographical location, the public network address library include the correspondence between IP address and geographical location;
Determination subelement for the geographical location obtained according to the acquisition subelement, determines the geographical position of the terminal
Geographic range where putting;
Subelement is obtained, is additionally operable to from the correspondence between stored geographic range and server ip address, obtains
The corresponding at least one server ip address of geographic range where taking the geographical location of the terminal;
It is corresponding to be additionally operable at least one server ip address for obtaining the acquisition subelement for determination subelement
Server is determined as the part second server of selection.
Fourth aspect provides a kind of service access device of terminal, is integrated in second server, described device packet
It includes:
Inquiry message is established in receiving module, the second connection for receiving first server transmission, and second connection is built
Vertical inquiry message at least carries the Internet protocol IP address for sending and inviting time and terminal, and inquiry is established in second connection
Message is that the first server is generated according to the first connection foundation inquiry message that the terminal is sent, the first service
Device and the second server are the servers that same service is provided for the terminal;
Sending module, for when it is described send the time is invited to reach when, according to the IP address of the terminal to the terminal
It sends connection and establishes invitation message;
Module is provided, if response message is established in the connection that the terminal transmission is received for the second server,
Then the service is provided to the terminal.
With reference to fourth aspect, in the first possible realization method of above-mentioned fourth aspect, second connection is established
Inquire the resource size for also carrying and being established needed for connection in message;
Correspondingly, described device further includes acquisition module, comparison module and determining module:
The acquisition module, for obtaining the idling-resource size in the second server;
The comparison module is established with described needed for connection for the idling-resource size in the second server
Resource size;
The determining module, for determining that the idling-resource size in the second server is greater than or equal to the foundation
Resource size needed for connection triggers the sending module when the transmission invites the time to reach, according to the IP of the terminal
Address sends connection to the terminal and establishes invitation message.
With reference to the first possible realization method of fourth aspect, in second of possible realization side of above-mentioned fourth aspect
In formula, described device further includes:
Reserved module is established for sending connection to the terminal according to the IP address of the terminal in the sending module
Before invitation message, according to it is described establish connection needed for resource size, for the terminal reserve it is described establish connection needed for
Resource.
5th aspect, provides a kind of service access system of terminal, and the system comprises terminal, such as third aspect to the
The first server and at least one such as the 4th described in any realization method in 5th kind of possible realization method of three aspects
The second server described in any realization method in second of possible realization method of aspect to fourth aspect;
For selecting the first server from least two servers, described at least two are serviced for the terminal
Other servers in device in addition to the first server are as the second server;
The terminal is additionally operable to send the first connection foundation inquiry message, first connection to the first server
Establish the Internet protocol IP address that inquiry message at least carries the terminal;
The terminal is additionally operable to record each connection foundation invitation when receiving each connection and establishing invitation message
The receiving time of message, and according to the receiving time of record, determine that sending the connection that the terminal receives earliest establishes invitation
The third server of message, and send connection to the third server and establish response message, the third server is described
A server in first server and at least one second server.
With reference to the 5th aspect, in the first possible realization method of the above-mentioned 5th aspect, the terminal is additionally operable to:
Using specified server as first server;Or,
The server identification of user's selection is received, using the corresponding server of the server identification of reception as first service
Device;Or,
According to the IP address of the terminal, corresponding geographical location is obtained from stored public network address library, according to obtaining
The geographical location taken determines the geographic range where the geographical location of the terminal, from stored geographic range and server
In correspondence between IP address, the corresponding server ip of geographic range where obtaining the geographical location of the terminal
The corresponding server of the server ip address of acquisition is determined as first server by location, and the public network address library includes IP address
Correspondence between geographical location.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
In embodiments of the present invention, first server is established inquiry message generation according to the first connection that terminal is sent and is carried
Have and send the second connection foundation inquiry message for inviting the time, connect when second server receives the second of first server transmission
When connecing foundation inquiry message, first server and second server are sent out when the transmission invites the time to reach to the terminal
Connection is sent to establish invitation message.Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not
Server selects the server nearest from the terminal according to the IP address of terminal, so when the terminal accesses the server, it can
To ensure that the communication efficiency of terminal is best.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of Organization Chart of the service access system of terminal provided in an embodiment of the present invention;
Fig. 2 is the business access method flow chart of the first terminal provided in an embodiment of the present invention;
Fig. 3 is the business access method flow chart of second of terminal provided in an embodiment of the present invention;
Fig. 4 is the business access method flow chart of the third terminal provided in an embodiment of the present invention;
Fig. 5 is that (Transfer Control Protocol pass transport control protocol to a kind of TCP provided in an embodiment of the present invention
View) message basic format schematic diagram;
Fig. 6 is the message format schematic diagram that inquiry message is established in a kind of first connection provided in an embodiment of the present invention;
Fig. 7 is the message format schematic diagram that inquiry message is established in a kind of second connection provided in an embodiment of the present invention;
Fig. 8 is the message format schematic diagram that invitation message is established in a kind of connection provided in an embodiment of the present invention;
Fig. 9 is the message structure schematic diagram that response message is established in a kind of connection provided in an embodiment of the present invention;
Figure 10 is the service access apparatus structure schematic diagram of the first terminal provided in an embodiment of the present invention;
Figure 11 is the service access apparatus structure schematic diagram of second of terminal provided in an embodiment of the present invention;
Figure 12 is the service access apparatus structure schematic diagram of the third terminal provided in an embodiment of the present invention;
Figure 13 is the service access apparatus structure schematic diagram of the 4th kind of terminal provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1 is a kind of Organization Chart of the service access system of terminal provided in an embodiment of the present invention.In the framework of the system
Figure includes terminal and at least two servers, the terminal can respectively at least two server by network connection, and
It (can also be not drawn into figure) by network connection between at least two server.At least two server is used for and terminal
Data interaction is carried out, and internet data is stored in each server.At least two server is additionally operable to send terminal
Message handled, and to terminal send respond.In embodiments of the present invention, which can be from least two server
Middle selection first server, it is whole when terminal needs to access nearest server using other servers as second server
It holds to first server and sends the first connection foundation inquiry message, which establishes inquiry message life according to the first connection
Inquiry message is established, and inquiry message is established into the second connection and is sent at least one second server into the second connection.When this
At least one second server receive the second connection establish inquiry message after, there are idling-resource server can simultaneously to
The terminal sends connection and establishes invitation message.When terminal, which receives first connection, establishes invitation message, which can incite somebody to action
The connection establishes the corresponding server of invitation message and is determined as the server of nearest neighbours, and access the server, by the service
Device provides service for it.Wherein, the detailed implementation process embodiment as described below of the service access of terminal.
Fig. 2 is a kind of business access method flow chart of terminal provided in an embodiment of the present invention, and the present embodiment is from first
The business access method of terminal is described in the angle of server, and this method includes:
Step 201:First server receives the first connection that terminal is sent and establishes inquiry message, and inquiry is established in the first connection
The Internet protocol IP address of message at least carried terminal.
Step 202:First server establishes addition transmission in inquiry message in the first connection and invites the time, obtains the second company
Connect foundation inquiry message.
Step 203:Second connection is established inquiry message and is sent respectively at least one second server by first server,
First server and second server are the servers that same service is provided for the terminal.
Step 204:First server sends to terminal according to the IP address of terminal and connects when sending the arrival of invitation time
Establish invitation message.
Step 205:If response message, first server are established in the connection that first server receives terminal transmission
Service is provided to the terminal.
Optionally, first server establishes addition transmission in inquiry message in the first connection and invites the time, obtains the second company
Before connecing foundation inquiry message, further include:
First server record receives the time that inquiry message is established in the first connection;
When first server obtains communication between each second server at least one second server respectively
Prolong, obtain at least one communication delay;
First server selects maximum communication delay from least one communication delay, true according to maximum communication delay
Determine delay time;
The time that first server will receive the first connection foundation inquiry message is added with delay time, is sent out
It send and invites the time.
Optionally, the first connection establishes in inquiry message and also carries the resource size established needed for connection;
Correspondingly, it before first server establishes invitation message according to the IP address of terminal to terminal transmission connection, also wraps
It includes:
First server obtains the idling-resource size in first server;
The idling-resource size that first server compares in first server connects required resource size with establishing;
Determine that the idling-resource size that first server includes is greater than or equal to the resource size established needed for connection.
Optionally, before first server establishes invitation message according to the IP address of the terminal to terminal transmission connection,
It further includes:
Resource size of the first server according to needed for establishing connection reserves the resource established needed for connection for the terminal.
Optionally, the second connection is established inquiry message and is sent at least one second server by first server, including:
First server selected section second server from least one second server;
The part second server for inquiring that message is sent respectively to selection is established in second connection by first server.
Optionally, first server selected section second server from least one second server, including:
First server obtains corresponding geographical location according to the IP address of terminal from stored public network address library,
Public network address library includes the correspondence between IP address and geographical location;
First server determines the geographic range where the geographical location of terminal according to the geographical location of acquisition;
First server obtains the terminal from the correspondence between stored geographic range and server ip address
Geographical location where the corresponding at least one server ip address of geographic range;
The corresponding server of at least one server ip address of acquisition is determined as the portion of selection by first server
Divide second server.
In embodiments of the present invention, first server is established inquiry message generation according to the first connection that terminal is sent and is carried
Have and send the second connection foundation inquiry message for inviting the time, connect when second server receives the second of first server transmission
When connecing foundation inquiry message, first server and second server are sent out when the transmission invites the time to reach to the terminal
Connection is sent to establish invitation message.So that terminal establishes invitation message according to the connection of reception, the service of nearest neighbours is selected
Device is not that server selects the server nearest from the terminal according to the IP address of terminal, so when the terminal accesses the clothes
During business device, it ensure that the communication efficiency of terminal is best.Further, due to the server of terminal access, there are idling-resources
Server, so the terminal can be successfully accessing the server, and after the terminal accesses the server, the server
Process performance it is preferable, accelerate business processing speed, and then increase usage experience.
Fig. 3 is a kind of business access method flow chart of terminal provided in an embodiment of the present invention, and the present embodiment is from second
The business access method of terminal is described in the angle of server, and this method includes:
Step 301:Second server receives the second connection that first server is sent and establishes inquiry message, and the second connection is built
Vertical inquiry message at least carries the Internet protocol IP address for sending and inviting time and terminal, and inquiry message is established in the second connection
It is that first server establishes inquiry message generation according to the first connection that terminal is sent, first server and second server are
The server of same service is provided for terminal.
Step 302:When the transmission invites the time to reach, second server is sent according to the IP address of terminal to terminal
Invitation message is established in connection.
Step 303:If response message, second service are established in the connection that the second server receives terminal transmission
Device provides the terminal with service.
Optionally, the second connection establishes in inquiry message and also carries the resource size established needed for connection;
Correspondingly, it before second server establishes invitation message according to the IP address of terminal to terminal transmission connection, also wraps
It includes:
Second server obtains the idling-resource size in second server;
The idling-resource size that second server compares in second server connects required resource size with establishing;
Determine that the idling-resource size in second server is greater than or equal to the resource size established needed for connection.
Optionally, it before second server establishes invitation message according to the IP address of terminal to terminal transmission connection, also wraps
It includes:
Resource size of the second server according to needed for establishing connection reserves the resource established needed for connection for terminal.
In embodiments of the present invention, terminal is to select first server from least two servers, and others are serviced
Device does not redeploy new server, so reducing lower deployment cost as second server.When second server receives
When establishing inquiry message to the second connection that first server is sent, at least one second server can will be established needed for connection
The resource size of resource size and self residual is compared, so as to make there are the second servers of idling-resource to be sent out to the terminal
Connection is sent to establish invitation message.And the resource that first server also can will establish the required resource size of connection and self residual
Size is compared, if first server, there are idling-resource, which also can send connection to the terminal and establish
Invitation message.Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, be not server according to
The IP address of terminal selects the server nearest from the terminal, so when the terminal accesses the server, ensures the communication of terminal
Best results.Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully accessing
The server, and after the terminal accesses the server, the process performance of the server is preferable, accelerates business processing speed
Degree, and then increase usage experience.
Fig. 4 is a kind of business access method flow chart of terminal provided in an embodiment of the present invention, and the present embodiment is from terminal
Angle the business access method of terminal is described, this method includes:
Step 401:Terminal selects first server from least two servers, will be at least two server except the
For other servers except one server as second server, first server and second server are provided for the terminal
The server of same service.
Wherein, terminal can select according to any one of following three kinds of situations situation from least two servers
One server, including:
The first, the terminal is using specified server as first server.
Wherein, an IP address or domain name specified can be set in advance in the terminal, by the IP address specified of setting
Or the corresponding given server of domain name is determined as first server, at this point, no matter the terminal when access server, the end
It is fixed to hold corresponding first server.
Secondth, the terminal receives the server identification of user's selection, by the corresponding server of the server identification of reception
As first server.
What the server identification that user selects can input with moving for user hand into terminal, it can also be user from terminal
It is selected in stored server identification.
Wherein, server identification can be the IP address or domain name of server, and the embodiment of the present invention does not do this specific limit
It is fixed.
When server identification is the domain name of server, the terminal is using the corresponding server of the domain name as first server
Later, which can send query messages to name server, with the IP according to the inquiry of the domain name of the server server
Address.It is the prior art according to the IP address of the inquiry of the domain name of the server server, is no longer described in detail herein.
The third, the terminal according to the IP address of the terminal, obtain corresponding geography from stored public network address library
Position according to the geographical location of acquisition, determines the geographic range where the geographical location of the terminal, from stored geographic range
In correspondence between server ip address, the corresponding server of geographic range where obtaining the geographical location of the terminal
The corresponding server of the server ip address of acquisition is determined as first server by IP address, and public network address library includes IP address
Correspondence between geographical location.
It should be added that public network address library and geographic range can be configured in the terminal in advance with server ip
Correspondence between location.
In addition, the terminal not only can select first server by above-mentioned three kinds of modes from least two servers,
The terminal can also select first server from least two servers in other way, and the embodiment of the present invention is not another
One lists.
It should be added that can be previously stored the IP address or domain name of at least two servers in terminal, this is extremely
Few two servers are believable server.It is previously stored the IP address of at least two servers or the method for domain name in the terminal
Three kinds of including but not limited to following modes, including:A, user manually inputs the IP of at least two server in the terminal
Address or domain name.B, network administrator generates configuration file, and should according to the IP address or domain name of at least two server
Configuration file distributes to the terminal.C, the IP address or domain name of newest all trusted servers are stored on each server.
When the terminal accesses any one server, which can send out the IP address of the newest server of storage or domain name
The terminal is given, makes server ip address or domain name that terminal update is locally stored.
Step 402:Terminal sends the first connection to first server and establishes inquiry message, and inquiry message is established in the first connection
At least carry the IP address of the terminal.
After terminal has selected first server and second server from least two servers, which can give birth to
Inquiry message is established, and send first connection to first server and establish inquiry message into the first connection.First connection is built
Vertical inquiry message is for inquiring which of at least two servers server can provide service for the terminal.
Further, the first connection, which is established in inquiry message, can also carry that judge whether at least two server can
To provide the information of service, for example, the identity information of the corresponding user of the terminal, foundation connect the letters such as required resource size
Breath.
Step 403:When first server, which receives the first connection, establishes inquiry message, record receives the first connection and builds
The time of vertical inquiry message.
Wherein, when first server, which receives the first connection, establishes inquiry message, when which obtains current
Between, current time is determined as receiving the time that the first connection establishes inquiry message.For example, first server receives first
When inquiry message is established in connection, the current time which obtains is 10:13:02, then the first server determine to connect
The time for receiving the first connection foundation inquiry message is 10:13:02.
Step 404:First server is obtained respectively between each second server at least one second server
Communication delay, obtain at least one communication delay.
During access server each due to terminal, the first server and second server of selection may be different, so, eventually
When holding each access server, first server is required for according to the communication delay between at least two server, obtains the
The one server communication delay between each second server at least one second server respectively.
Wherein, the communication delay between at least two server is fixed, it is possible to obtain at least two clothes in advance
Communication delay between business device, and be stored in each server.It, can after first server and second server has been selected
With the communication delay between at least two servers according to storage, determine the first server respectively with this at least one second
The communication delay between each second server in server, obtains at least one communication delay.It can also be terminal access
During server, which obtains it between each second server at least one second server in real time
Communication delay.The application is not specifically limited this.
Wherein, itself and at least one second service are obtained respectively in real time when first server is in terminal access server
During communication delay between each second server in device, which obtains itself and at least one second server
In each second server between the method for communication delay include a variety of, lift an a simplest example, the first server
When can send a latency message at least one second server simultaneously, and record the transmission for sending the latency message
Between;When at least one second server receives the latency message, a time delay is replied to the first server immediately and rung
It should;When the first server receives the DELAY RESPONSE that each second server is sent, record receives the DELAY RESPONSE respectively
Receiving time, respectively by the half of the time interval between the sending time and receiving time determine the first server with this
Communication delay between two servers.
Wherein, each second server corresponds to a communication delay, and communication delay is first server and the second clothes
Time between business device needed for transmission message.
For example, include 4 second servers, respectively second server 1, second server 2, second server in system
3 and second server 4, first server to the time of the 4 second server transmission delay message be 10:13:03.This first
The receiving time that server receives the DELAY RESPONSE of the transmission of second server 1 is 10:13:04, it receives second server 2 and sends out
The receiving time for the DELAY RESPONSE sent is 10:13:05, the receiving time of DELAY RESPONSE for receiving the transmission of second server 3 is
10:13:07, the receiving time for receiving the DELAY RESPONSE of the transmission of second server 4 is 10:13:09.Second service will be received
The receiving time 10 for the DELAY RESPONSE that device 1 is sent:13:04 with time 10 of transmission delay message:13:Time interval between 03
The half 0.5s of 1s is determined as the communication delay between first server and second server 1;Second server 2 will be received to send out
The receiving time 10 for the DELAY RESPONSE sent:13:05 with time 10 of transmission delay message:13:Time interval 2s's between 03
Half 1s is determined as the communication delay between first server and second server 2;By receive that second server 3 sends when
Prolong the receiving time 10 of response:13:07 with time 10 of transmission delay message:13:The half 2s of time interval 4s between 03
The communication delay being determined as between first server and second server 3;The DELAY RESPONSE for second server 4 will be received sending
Receiving time 10:13:09 with time 10 of transmission delay message:13:The half 3s of time interval 6s between 03 is determined as
Communication delay between first server and second server 4.
Step 405:First server selects maximum communication delay from least one communication delay, according to maximum
Communication delay determines delay time.
Specifically, which is compared by first server respectively, from during at least one communication
The maximum communication delay of Yanzhong selection, delay time is determined according to maximum communication delay.
For example, first server selects maximum communication delay 3s from 4 communication delay 0.5s, 1s, 2s and 3s, according to
Maximum communication delay 3s determines delay time.
Wherein, the operation for determining delay time according to maximum communication time delay is specifically as follows:Maximum communication delay is true
It is set to delay time.Alternatively, maximum communication delay is added with preset time interval, delay time is obtained.
If the operation for determining delay time according to maximum communication time delay is:By maximum communication delay with it is preset when
Between be spaced and be added, obtain delay time.For example, preset time interval is 1s, then by maximum communication delay 3s and in advance
If time interval 1s be added, obtain delay time as 4s.
Wherein, preset time interval is set in advance, and preset time interval cannot be too big.
Wherein, step 404 and step 405 can be performed in any time between step 401 and step 406, that is,
It says, step 404 and step 405 can perform before step 402, can also perform after step 403, can also be in step
Perform, can also be performed simultaneously with step 402 or step 403 between 402 and step 403, the embodiment of the present invention with step 404 and
Step 405 illustrates for performing after step 403.
It should be added that in embodiments of the present invention, server can be selected from least one communication delay
Maximum communication delay is selected, delay time is determined according to maximum communication delay, certainly, network administrator can also be according to common sense
Estimate with experience and the delay time is configured.Preferably, which can be from least one communication delay for server
The maximum communication delay of middle selection, determines according to maximum communication delay.
Step 406:First server will receive the first connection and establish the time of inquiry message and delay time progress
It is added, obtains sending and invite the time.
Wherein, the time for receiving the first connection foundation inquiry message is a moment, and delay time is a time
Interval, so, will receive the first connection establish inquiry message time be added with the delay time after, obtained hair
It is also a moment to send and invite the time.
For example, the time 10 that first server will receive the first connection foundation inquiry message:13:02 with the delay time
4s is added, and it is 10 to obtain transmission and invite the time:13:06.
Step 407:First server establishes addition transmission in inquiry message in the first connection and invites the time, obtains the second company
Foundation inquiry message is connect, and inquiry message is established into the second connection and is sent at least one second server.
Due to factors etc. such as the distance between first server and at least one second server and Network status,
It is different so as to cause the communication delay between the first server and at least one second server, so in order to overcome first
Communication delay between server and at least one second server, ensures the first server and at least one second service
Device establishes invitation message to terminal replies connection simultaneously, which establishes in inquiry message in the first connection and add hair
It send and invites the time, transmission is made to invite before the time reaches, all second servers, which receive the second connection, to be established inquiry and disappears
Breath, and can make to send to connect to establish simultaneously to the terminal when transmission invites the time to reach there are the server of idling-resource to invite
It please message.
In embodiments of the present invention, the second connection can be established inquiry message and be sent to all second by first server
Server, can also from all second servers selected section second server, by second connection establish inquiry message hair
Give the part second server of selection.
When first server from least one second server selected section second server, and by second connection establish
When inquiry message is sent to the part second server of selection, first server selected section from least one second server
The concrete operations of second server can be:First server is according to the IP address of the terminal, from stored public network address library
Middle to obtain corresponding geographical location, which includes the correspondence between IP address and geographical location;First service
Device determines the geographic range where the geographical location of the terminal according to the geographical location of acquisition;From stored geographic range with
In correspondence between server ip address, the geographic range where obtaining the geographical location of the terminal is corresponding at least one
Server ip address;The corresponding server of at least one server ip address of acquisition is determined as the part second service of selection
Device.
Wherein, the correspondence between the geographic range and server ip address that are stored in first server can be a pair of
More relationships, i.e. a geographic range can correspond at least one server ip address, that is to say, that there may be at least one
Server is responsible for the communication of a geographic range.For example, China is deployed with three servers in total, due to the network of China
More independent, terminal of the physical location in Chinese range must be that time delay is shortest using the server of China.It is whole simultaneously
The server ip address of a China will not frequently occur change or mistakes and omissions (but be specific to different provinces and cities may just can not essence
It is really corresponding).Therefore, by this one-to-many mapping relations, inquiry message is established when first server receives the first connection
Afterwards, first determine whether that the IP address of the terminal is located at China, then the second connection only is established inquiry message is sent to China
Three servers, the server without being transmitted to European Area or America area.
It should be added that public network address library and geographic range and service can be configured in first server in advance
Correspondence between device IP address.
Wherein, it establishes in inquiry message to add to send in the first connection and invite the time, generation the second connection foundation inquiry disappears
After breath, the second connection, which is established the IP address that the terminal is at least carried in inquiry message and sent, invites the time.
Step 408:When at least one second server, which receives the second connection, establishes inquiry message, invited sending
When time reaches, first server and at least one second server send to the terminal all in accordance with the IP address of the terminal and connect
It connects and establishes invitation message.
Preferably, in embodiments of the present invention, disappear when at least one second server receives the second connection foundation inquiry
During breath, for each second server at least one second server, whether which can determine itself
There are idling-resource, if there are idling-resources, when sending the arrival of invitation time, the second server for the second server
Can connection be sent to the terminal according to the IP address of the terminal and establish invitation message.And first server can also determine itself
With the presence or absence of idling-resource, if there are idling-resources, when sending the arrival of invitation time, first server for first server
Can connection be sent to the terminal according to the IP address of the terminal and establish invitation message.
Optionally, it is established in inquiry message due to the first connection and also carries the resource size established needed for connection, so the
Two connections establish in inquiry message and also carry the resource size established needed for connection;Accordingly at least one second clothes
The each second server being engaged in device is invited when the second server sends connection foundation according to the IP address of the terminal to the terminal
Please be before message, which obtains the idling-resource size in second server, compares the sky in the second server
Not busy resource size is with establishing the resource size needed for connection;If the idling-resource size in the second server is greater than or equal to
The resource size needed for connection is established, then the second server is determined as to the server there are idling-resource.When by this second
Server is determined as after the server there are idling-resource, and when sending the arrival of invitation time, which can root
Connection is sent to the terminal establish invitation message according to the IP address of the terminal.
Optionally, when first server according to the IP address of the terminal to the terminal send connection establish invitation message it
Before, which can also obtain the idling-resource size in first server, compare the idle money in first server
Source size is with establishing the resource size needed for connection;It is established if the idling-resource size in the first server is greater than or equal to
The first server, then is determined as the server there are idling-resource by the resource size needed for connection.When by the first service
Device is determined as after the server there are idling-resource, and when sending the arrival of invitation time, which can also basis
The IP address of the terminal sends connection to the terminal and establishes invitation message.
Further, after the server there are idling-resource is determined, the server there are idling-resource can be with
Resource size according to needed for establishing connection reserves the resource established needed for connection for the terminal.I.e. when first server exists
During idling-resource, first server can be that the terminal reserves the resource established needed for connection, when second server is in the presence of idle
During resource, second server can be that the terminal reserves the resource established needed for connection.
Wherein, it after reserving the resource established needed for connection for the terminal, avoids and accesses the server in the terminal
In the process, the resource is occupied by other terminals.When the terminal accesses the server, which can smoothly access this
Server, and the resource in the server provides service for the terminal enough.
Further, for each second server at least one second server, when the second server does not have
During available free resource, which abandons second connection and establishes inquiry message, without any processing.
It should be added that in embodiments of the present invention, can first server be ensured with usage time synchronous protocol
Time synchronization between at least one second server, time synchronization protocol are selected according to requirement of the practical application to precision
It selects, can include but is not limited to the following two kinds agreement, including:
The first, NTP (Network Time Protocol, network event synchronous protocol), precision can in LAN
Up to 0.lms, its local precision most of on the internet can reach 1-50ms.
Secondth, PTP (Precision Time Protocol, accurate clock synchronization protocol), PTP is known as IEEE1588,
Referred to as 1588.1588 points are two versions of 1588v1 and 1588v2, and 1588v1 can only achieve the time synchronization essence of sub- Millisecond
Degree, and 1588v2 can reach submicrosecond grade synchronization accuracy.
Optionally, in embodiments of the present invention, whether first server and at least one second server judge itself
Storing idling-resource is determined according to actual conditions, and the present invention is not specifically limited this.
Step 409:Terminal receives connection and establishes invitation message, records each connection received and establishes connecing for invitation message
Between time receiving.
Due to the terminal and the distance between the first server and at least one second server or network state etc. because
Element differs, institute different so as to cause the communication delay between the terminal and the first server and at least one second server
Invitation message is established in the connection that each server transmission there are idling-resource can be successively received with the terminal.In order to make the end
End selects nearest server to provide best service for it, when terminal needs record receives the reception for establishing invitation message
Between.
Step 410:Terminal determines that sending the connection that the terminal receives earliest establishes invitation according to the receiving time of record
The third server of message, and send connection to third server and establish response message, third server be first server and
A server at least one second server.
Since there are the servers of idling-resource there may be multiple, so the terminal may receive multiple servers
Invitation message is established in the connection of transmission, and the time that invitation message arrival is established in each connection may be different.
Specifically, which is compared the receiving time of record, and earliest connect is selected from the receiving time of record
Between time receiving, the IP address that the third server of invitation message is established in the connection that earliest receiving time receives is obtained, according to acquisition
Third server IP address, to third server send connection establish response message, to access third server.
Optionally, which, which can not also record, receives the receiving time that invitation message is established in connection, when the terminal connects
First connection is received when establishing invitation message, it is true which just establishes the corresponding server of invitation message by this first connection
It is set to third server, and sends connection to third server and establish response message, accesses third server.
Further, since each server there are idling-resource is to send connection to the terminal simultaneously and establish to invite to disappear
Third server so the communication delay between third server and the terminal is minimum, can be determined as from the terminal most by breath
Near server, and best communication for the terminal can be provided and provide the server of optimal use experience to the user.When
After terminal access third server, service is provided for the terminal by third server.
For example, the time that invitation message is established in the connection for receiving first server transmission of terminal record is 10:13:
35, receive second server 1 transmission connection establish invitation message time be 10:13:15, receive second server 2
The time that invitation message is established in the connection of transmission is 10:13:24, the connection foundation invitation for receiving the transmission of second server 3 disappears
The time of breath is 10:13:25, receive second server 4 transmission connection establish invitation message time be 10:13:30.It should
Terminal determines to receive connection earliest and establishes the corresponding server of invitation message as second server 1, and the terminal is by second service
Device 1 is determined as third server, and sends connection to third server and establish response message, to access third server.
Further, in embodiments of the present invention, inquiry message is established in the first connection, inquiry message is established in the second connection,
Invitation message is established in connection and connection is established response message and can be sent by the form of message, due to involved in the present embodiment
The message arrived is less, and to the more demanding of reliability, therefore, TCP message, first service may be used in the embodiment of the present invention
Device and second server provide service using fixed port, terminal can optionally idle port to first server or second service
Device sends message.
As shown in figure 5, Fig. 5 shows the basic format of TCP message, the basic format of TCP message include TCP header,
Type of message, attribute type, property value length and property value.
Wherein, type of message can be 4 bits, respectively:
0:Inquiry message is established in first connection.It can adeditive attribute after the type message.
1:Inquiry message is established in second connection.It can adeditive attribute after the type message.
2:Invitation message is established in connection.
3:Response message is established in connection.
Other:Retain.
Wherein, attribute type may be 4 bits, respectively:
0:Attribute end mark.The attribute length of the attribute is 0.
1:User name (or IP address).
2:It sends and invites the time.
Other:Retain.
Wherein, property value length can be 8 bits, and unit is byte.I.e. property value longest can be 255 bytes.
Wherein, property value can take different values according to different attribute types.Such as:When attribute type is user name
When, which can be ASCII text-strings.When attribute type invites the time to send, which can be according to
Year:Month:Day:When:Point:Second:Millisecond form, in addition to 2 bytes are accounted for year, others respectively account for 1 byte, in total 8 bytes.
As shown in fig. 6, Fig. 6 is the message format that terminal establishes inquiry message to the first connection that first server is sent,
Show that the message establishes inquiry message for the first connection in Fig. 6, and it is Abcd to carry user name (or IP address).As shown in fig. 7,
Fig. 7 is the message format that first server establishes inquiry message to the second connection that second server is sent, and Fig. 7 shows the message
Inquiry message is established for the second connection, it is Abcd to carry user name (or IP address), also carries to send and invite the time, and send and invite
Please the time be 2014 2 months 26 days 10 when 13 divide 06 second 100 milliseconds.It is built as shown in figure 8, Fig. 8 sends connection for second server
The message format of vertical invitation message, Fig. 8 show that the message establishes invitation message for connection.As shown in figure 9, Fig. 9 for the terminal to
Connection is received earliest establishes the message format that response message is established in the connection that the corresponding server of invitation message is sent, the i.e. end
It holds to send to third server and connects the message format for establishing response message, Fig. 9 shows that the message establishes response message for connection.
In embodiments of the present invention, terminal is to select first server from least two servers, and others are serviced
Device does not redeploy new server, so reducing lower deployment cost as second server.When second server receives
When establishing inquiry message to the second connection that first server is sent, at least one second server can connect institute by establishing respectively
The resource size and the resource size of self residual needed is compared, so as to make that there are the second servers of idling-resource to the end
End sends connection and establishes invitation message.And first server can will also establish resource size and self residual needed for connection
Resource size is compared, if first server, there are idling-resource, which can also send to the terminal and connect
Establish invitation message.Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not server
The server nearest from the terminal is selected according to the IP address of terminal, so when the terminal accesses the server, ensures terminal
Communication efficiency is best.Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully
The server is accessed, and after the terminal accesses the server, the process performance of the server is preferable, accelerates at business
Speed is managed, and then increases usage experience.
Figure 10 is a kind of service access apparatus structure schematic diagram of terminal provided in an embodiment of the present invention, which is integrated in
In first server, referring to Figure 10, which includes:
Inquiry message is established in receiving module 1001, the first connection for receiving terminal transmission, and inquiry is established in the first connection
Message at least carries the Protocol IP address interconnected between the network of the terminal;
Add module 1002, the first connection for being received in receiving module 1001 are established addition transmission in inquiry message and are invited
Please the time, obtain the second connection establish inquiry message;
Sending module 1003, for by add module 1002 obtain second connection establish inquiry message be sent respectively to
A few second server, first server and second server are the servers that same service is provided for terminal;And
When sending the arrival of invitation time, connection is sent to the terminal according to the IP address of the terminal and establishes invitation message;
Module 1004 is provided, if response message is established in the connection that terminal transmission is received for first server, to
The terminal provides service.
Optionally, which further includes:
Logging modle, for recording the time that receiving module 1001 receives the first connection and establishes inquiry message;
Acquisition module is logical between each second server at least one second server respectively for obtaining
Believe time delay, obtain at least one communication delay;
Determining module, for selecting maximum communication delay, root from least one communication delay that acquisition module obtains
Delay time is determined according to maximum communication delay;
Computing module, the time for that will receive the first connection foundation inquiry message are added with delay time, obtain
The time is invited to sending.
Optionally, the first connection establishes in inquiry message and also carries the resource size established needed for connection;
Correspondingly, which further includes comparison module:
Acquisition module is additionally operable to obtain the idling-resource size in first server;
Comparison module is big for comparing the resource required with establishing connection of the idling-resource size included by first server
It is small;
Determining module is additionally operable to determine that the idling-resource size in first server is greater than or equal to and establishes needed for connection
Resource size, triggering sending module send to the terminal according to the IP address of the terminal and connect when transmission invites the time to reach
Establish invitation message.
Optionally, which further includes:
Reserved module establishes invitation message for sending connection to the terminal according to the IP address of the terminal in sending module
Before, the resource size according to needed for establishing connection reserves the resource established needed for connection for the terminal.
Optionally, sending module 1003 includes:
Selecting unit, for the selected section second server from least one second server;
Transmitting element, for the second connection to be established the part second server for inquiring that message is sent respectively to selection.
Optionally, selecting unit includes:
First obtains subelement, for the IP address according to the terminal, obtains and corresponds to from stored public network address library
Geographical location, public network address library includes correspondence between IP address and geographical location;
First determination subelement for the geographical location obtained according to subelement is obtained, determines the geographical location institute of terminal
Geographic range;
Second obtains subelement, for from the correspondence between stored geographic range and server ip address,
The corresponding at least one server ip address of geographic range where obtaining the geographical location of the terminal;
Determination subelement is additionally operable to the corresponding service of at least one server ip address that will obtain subelement acquisition
Device is determined as the part second server of selection.
In embodiments of the present invention, terminal is that a server is selected from multiple servers as first server, will
Other servers do not redeploy new server, so reducing lower deployment cost as second server.In addition,
Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not IP of the server according to terminal
The address choice server nearest from the terminal so when the terminal accesses the server, ensures that the communication efficiency of terminal is best.
Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully accessing the server,
And after the terminal accesses the server, the process performance of the server is preferable, accelerates business processing speed, Jin Erzeng
Usage experience is added.
Figure 11 is a kind of service access apparatus structure schematic diagram of terminal provided in an embodiment of the present invention, which is integrated in
In second server, referring to Figure 11, which includes:
Inquiry message is established in receiving module 1101, the second connection for receiving first server transmission, and the second connection is built
Vertical inquiry message at least carries the Internet protocol IP address for sending and inviting time and terminal, and inquiry message is established in the second connection
It is that first server establishes inquiry message generation according to the first connection that terminal is sent, first server and second server are
The server of same service is provided for terminal;
Sending module 1102, for when sending the arrival of invitation time, being sent according to the IP address of the terminal to the terminal
Invitation message is established in connection;
Module 1103 is provided, is disappeared if receiving the connection that the terminal sends for the second server and establishing response
Breath, then provide the terminal with service.
Optionally, the second connection establishes in inquiry message and also carries the resource size established needed for connection;
Correspondingly, which further includes acquisition module, comparison module and determining module:
Acquisition module, for obtaining the idling-resource size in second server;
Comparison module is big for comparing the resource required with establishing connection of the idling-resource size included by second server
It is small;
Determining module, for determining that the idling-resource size that second server includes is greater than or equal to needed for this connection
Resource size, triggering sending module send connection to terminal when sending the arrival of invitation time, according to the IP address of terminal and establish
Invitation message.
Optionally, which further includes:
Reserved module, for sending module according to the IP address of terminal to terminal send connection establish invitation message it
Before, the resource size according to needed for establishing connection reserves the resource established needed for connection for the terminal.
In embodiments of the present invention, terminal is that a server is selected from multiple servers as first server, will
Other servers do not redeploy new server, so reducing lower deployment cost as second server.When second
When inquiry message is established in the second connection that server receives first server transmission, multiple second servers can connect this
Required resource size and the resource size of self residual are compared, so as to make there are the second server of idling-resource to this
Terminal sends connection and establishes invitation message.And first server also can be by the resource size and self residual needed for this connection
Resource size be compared, if first server, there are idling-resource, which can also send to the terminal connects
It connects and establishes invitation message.Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not service
Device selects the server nearest from the terminal according to the IP address of terminal, so when the terminal accesses the server, ensures terminal
Communication efficiency it is best.Since the server of terminal access is the server there are idling-resource, so the terminal can succeed
Ground accesses the server, and after the terminal accesses the server, the process performance of the server is preferable, accelerates business
Processing speed, and then increase usage experience.
A kind of service access system of terminal provided in an embodiment of the present invention can refer to shown in attached drawing 4, which is included eventually
End, the first server as described in above-described embodiment and at least one second server as described in above-described embodiment;
The terminal for selecting first server from least two servers, will remove first at least two servers
Other servers except server are as second server;
The terminal is additionally operable to send the first connection foundation inquiry message to first server, and the first connection establishes inquiry and disappears
Breath at least carries the Internet protocol IP address of the terminal;
The terminal is additionally operable to each connection of record when receiving each connection and establishing invitation message and establishes invitation message
Receiving time, and according to the receiving time of record determines to send invitation message is established in the connection that the terminal receives earliest the
Three servers, and send connection to third server and establish response message, third server are first servers and at least one
A server in second server.
Optionally, which is additionally operable to:
Using specified server as first server;Or,
The server identification of user's selection is received, using the corresponding server of the server identification of reception as first service
Device;Or,
According to the IP address of terminal, corresponding geographical location is obtained from stored public network address library, according to acquisition
Geographical location determines the geographic range where the geographical location of the terminal, from stored geographic range and server ip address
Between correspondence in, the corresponding server ip address of geographic range where obtaining the geographical location of the terminal will obtain
The corresponding server of server ip address be determined as first server, public network address library is included between IP address and geographical location
Correspondence.
In embodiments of the present invention, terminal is that a server is selected from multiple servers as first server, will
Other servers do not redeploy new server, so reducing lower deployment cost as second server.In addition,
Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not IP of the server according to terminal
The address choice server nearest from the terminal so when the terminal accesses the server, ensures that the communication efficiency of terminal is best.
Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully accessing the server,
And after the terminal accesses the server, the process performance of the server is preferable, accelerates business processing speed, Jin Erzeng
Usage experience is added.
Figure 12 is a kind of service access apparatus structure schematic diagram of terminal provided in an embodiment of the present invention, should referring to Figure 12
Device includes transmitter 1201, receiver 1202, memory 1203, processor 1204 and communication bus 1205, including:
Memory 1203, for storing message and data;
Inquiry message is established in receiver 1202, the first connection for receiving terminal transmission, and the first connection establishes inquiry and disappears
The Internet protocol IP address of breath at least carried terminal;
Processor 1204, when the first connection foundation for being received in receiver 1202 inquires that addition transmission is invited in message
Between, it obtains the second connection and establishes inquiry message;
Transmitter 1201, the second connection for processor 1204 to be obtained establish inquiry message and are sent respectively at least one
A second server, first server and second server are the servers that same service is provided for terminal;And
When sending the arrival of invitation time, connection is sent to terminal according to the IP address of terminal and establishes invitation message;
Processor 1204 establishes response message if being additionally operable to first server and receiving the connection that terminal is sent, to
Terminal provides service.
Wherein, processor 1204 may be a kind of IC chip, have the processing capacity of signal.In the process of realization
In, each step of the above method can be complete by the integrated logic circuit of the hardware in processor or the instruction of software form
Into.These instructions can be by processor therein to coordinate realization and control, for performing the side of announcement of the embodiment of the present invention
Method.Above-mentioned processor can also be general processor, digital signal processor (Digital Signal Processing,
DSP), application-specific integrated circuit (application specific integrated circuit), ready-made programmable gate array
(Field Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor are patrolled
Collect device, discrete hardware components.
Wherein, above-mentioned general processor can be microprocessor or the processor can also be any conventional processing
Device, decoder etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware processor and perform
Completion is performed into or with hardware in processor and software module combination.Software module can be located at random access memory, dodge
It deposits, read-only memory, this fields such as programmable read only memory or electrically erasable programmable memory, register are ripe to deposit
In storage media.
In addition, each hardware component of the service access device of terminal is coupled by communication bus 1205, wherein
Communication bus 1205 further includes power bus, controlling bus and status signal bus in addition in addition to including data/address bus.But in order to
Various buses are all designated as communication bus 1205 by clear explanation in fig. 12.
A kind of service access device of the terminal provided in present apparatus embodiment can be integrated in first server network element and set
In standby, applied in the attached scene shown in Fig. 2 of embodiment of the method, the function of the service access device of terminal is realized.The industry of terminal
Other additional functions that business access device can be realized and the interactive process with other network element devices, please refer to method implementation
To the description of the service access device of terminal in example, repeat no more herein.
In embodiments of the present invention, terminal is that a server is selected from multiple servers as first server, will
Other servers do not redeploy new server, so reducing lower deployment cost as second server.In addition,
Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not IP of the server according to terminal
The address choice server nearest from the terminal so when the terminal accesses the server, ensures that the communication efficiency of terminal is best.
Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully accessing the server,
And after the terminal accesses the server, the process performance of the server is preferable, accelerates business processing speed, Jin Erzeng
Usage experience is added.
Figure 13 is a kind of service access apparatus structure schematic diagram of terminal provided in an embodiment of the present invention, should referring to Figure 13
Device includes transmitter 1301, receiver 1302, memory 1303, processor 1304 and communication bus 1305, including:
Memory 1303, for storing message and data;
Inquiry message is established in receiver 1302, the second connection for receiving first server transmission, and the second connection is established
Inquiry message at least carries the Internet protocol IP address for sending and inviting time and terminal, and inquiry message is established in the second connection is
First server establishes what inquiry message generated according to the first connection that terminal is sent, first server and second server be for
Terminal provides the server of same service;
Transmitter 1301, for when sending the arrival of invitation time, sending connection to terminal according to the IP address of terminal and building
Vertical invitation message;
Processor 1304, if response message is established in the connection that terminal transmission is received for second server, to end
Offer service is provided.
Wherein, processor 1304 may be a kind of IC chip, have the processing capacity of signal.In the process of realization
In, each step of the above method can be complete by the integrated logic circuit of the hardware in processor or the instruction of software form
Into.These instructions can be by processor therein to coordinate realization and control, for performing the side of announcement of the embodiment of the present invention
Method.Above-mentioned processor can also be general processor, digital signal processor (Digital Signal Processing,
DSP), application-specific integrated circuit (application specific integrated circuit), ready-made programmable gate array
(Field Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor are patrolled
Collect device, discrete hardware components.
Wherein, above-mentioned general processor can be microprocessor or the processor can also be any conventional processing
Device, decoder etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware processor and perform
Completion is performed into or with hardware in processor and software module combination.Software module can be located at random access memory, dodge
It deposits, read-only memory, this fields such as programmable read only memory or electrically erasable programmable memory, register are ripe to deposit
In storage media.
In addition, each hardware component of the service access device of terminal is coupled by communication bus 1305, wherein
Communication bus 1305 further includes power bus, controlling bus and status signal bus in addition in addition to including data/address bus.But in order to
Various buses are all designated as communication bus 1305 by clear explanation in fig. 13.
A kind of service access device of the terminal provided in present apparatus embodiment can be integrated in second server network element and set
In standby, applied in the attached scene shown in Fig. 3 of embodiment of the method, the function of the service access device of terminal is realized.The industry of terminal
Other additional functions that business access device can be realized and the interactive process with other network element devices, please refer to method implementation
To the description of the service access device of terminal in example, repeat no more herein.
In embodiments of the present invention, terminal is that a server is selected from multiple servers as first server, will
Other servers do not redeploy new server, so reducing lower deployment cost as second server.In addition,
Terminal establishes invitation message according to the connection of reception, selects the server of nearest neighbours, is not IP of the server according to terminal
The address choice server nearest from the terminal so when the terminal accesses the server, ensures that the communication efficiency of terminal is best.
Since the server of terminal access is the server there are idling-resource, so the terminal can be successfully accessing the server,
And after the terminal accesses the server, the process performance of the server is preferable, accelerates business processing speed, Jin Erzeng
Usage experience is added.
It should be noted that:The service access device for the terminal that above-described embodiment provides is in the service access of terminal, only
With the division progress of above-mentioned each function module for example, in practical application, can as needed and by above-mentioned function distribution by
Different function modules is completed, i.e., the internal structure of device is divided into different function modules, described above complete to complete
Portion or partial function.In addition, the service access device for the terminal that above-described embodiment provides and the business access method of terminal are real
It applies example and belongs to same design, specific implementation process refers to embodiment of the method, and which is not described herein again.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment
It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.
Claims (22)
1. a kind of business access method of terminal, which is characterized in that the method includes:
First server receives the first connection that terminal is sent and establishes inquiry message, and first connection establishes inquiry message at least
Carry the Internet protocol IP address of the terminal;
The first server establishes addition transmission in inquiry message in the described first connection and invites the time, obtains the second connection and builds
Vertical inquiry message;
Described second connection is established inquiry message and is sent respectively at least one second server by the first server, described
First server and the second server are the servers that same service is provided for the terminal;
The first server is sent when the transmission invites the time to reach according to the IP address of the terminal to the terminal
Invitation message is established in connection;
If the first server receives the connection that the terminal is sent and establishes response message, the first server to
The terminal provides the service.
2. the method as described in claim 1, which is characterized in that the first server establishes inquiry in the described first connection and disappears
Addition, which is sent, in breath invites the time, obtains the second connection and establishes before inquiry message, further includes:
The first server record receives the time that inquiry message is established in first connection;
The first server obtains logical between each second server at least one second server respectively
Believe time delay, obtain at least one communication delay;
The first server selects maximum communication delay from least one communication delay, is led to according to described maximum
Letter time delay determines delay time;
The first server will receive first connection and establish the time of inquiry message and delay time progress phase
Add, obtain described send and invite the time.
3. method as claimed in claim 1 or 2, which is characterized in that first connection, which establishes in inquiry message also to carry, builds
Resource size needed for vertical connection;
Correspondingly, the first server according to the IP address of the terminal to the terminal send connection establish invitation message it
Before, it further includes:
The first server obtains the idling-resource size in the first server;
Idling-resource size and the resource established needed for connection in the first server first server
Size;
Determine that the idling-resource size in the first server is greater than or equal to the resource size established needed for connection.
4. method as claimed in claim 3, which is characterized in that the first server is according to the IP address of the terminal to institute
It states terminal transmission connection to establish before invitation message, further include:
The first server establishes the resource size needed for connecting according to described, and reserving described establish for the terminal connects institute
The resource needed.
5. the method as described in claim 1,2 or 4, which is characterized in that the first server establishes the described second connection
Inquiry message is sent respectively at least one second server, including:
First server selected section second server from least one second server;
Described second connection is established inquiry message and is sent respectively to the part second server by the first server.
6. method as claimed in claim 5, which is characterized in that the first server is from least one second server
Middle selected section second server, including:
The first server obtains corresponding geographical position according to the IP address of the terminal from stored public network address library
It puts, the public network address library includes the correspondence between IP address and geographical location;
The first server determines the geographic range where the geographical location of the terminal according to the geographical location of acquisition;
The first server obtains the end from the correspondence between stored geographic range and server ip address
The corresponding at least one server ip address of geographic range where the geographical location at end;
The corresponding server of at least one server ip address of acquisition is determined as the portion of selection by the first server
Divide second server.
7. method as claimed in claim 3, which is characterized in that the described second connection is established inquiry and disappeared by the first server
Breath is sent respectively at least one second server, including:
First server selected section second server from least one second server;
Described second connection is established inquiry message and is sent respectively to the part second server by the first server.
8. the method for claim 7, which is characterized in that the first server is from least one second server
Middle selected section second server, including:
The first server obtains corresponding geographical position according to the IP address of the terminal from stored public network address library
It puts, the public network address library includes the correspondence between IP address and geographical location;
The first server determines the geographic range where the geographical location of the terminal according to the geographical location of acquisition;
The first server obtains the end from the correspondence between stored geographic range and server ip address
The corresponding at least one server ip address of geographic range where the geographical location at end;
The corresponding server of at least one server ip address of acquisition is determined as the portion of selection by the first server
Divide second server.
9. a kind of business access method of terminal, which is characterized in that the method includes:
Second server receives the second connection that first server is sent and establishes inquiry message, and second connection establishes inquiry and disappears
Breath at least carries the Internet protocol IP address for sending and inviting time and terminal, and it is institute that inquiry message is established in second connection
It states first server and establishes what inquiry message generated according to the first connection that the terminal is sent, the first server and described
Second server is the server that same service is provided for the terminal;
When the transmission invites the time to reach, the second server is sent according to the IP address of the terminal to the terminal
Invitation message is established in connection;
If the second server receives the connection that the terminal is sent and establishes response message, the second server to
The terminal provides the service.
10. method as claimed in claim 9, which is characterized in that second connection, which establishes in inquiry message also to carry, establishes
Resource size needed for connection;
Correspondingly, the second server according to the IP address of the terminal to the terminal send connection establish invitation message it
Before, it further includes:
The second server obtains the idling-resource size in the second server;
Idling-resource size and the resource established needed for connection in the second server second server
Size;
Determine that the idling-resource size in the second server is greater than or equal to the resource size established needed for connection.
11. method as claimed in claim 10, which is characterized in that the second server according to the IP address of the terminal to
The terminal sends connection and establishes before invitation message, further includes:
The second server establishes the resource size needed for connecting according to described, and reserving described establish for the terminal connects institute
The resource needed.
12. a kind of service access device of terminal, is integrated in first server, which is characterized in that described device includes:
Inquiry message is established in receiving module, the first connection for receiving terminal transmission, and inquiry message is established in first connection
At least carry the Internet protocol IP address of the terminal;
Add module, when the first connection foundation for being received in the receiving module inquires that addition transmission is invited in message
Between, it obtains the second connection and establishes inquiry message;
Sending module is sent respectively at least one for second connection that the add module obtains to be established inquiry message
A second server, the first server and the second server are the servers that same service is provided for the terminal;
And
When the transmission invites the time to reach, invited and disappeared to terminal transmission connection foundation according to the IP address of the terminal
Breath;
Module is provided, if response message is established in the connection that the terminal transmission is received for the first server, to
The terminal provides the service.
13. device as claimed in claim 12, which is characterized in that described device further includes:
Logging modle, for recording the time that the receiving module receives first connection and establishes inquiry message;
Acquisition module, for obtaining the communication between each second server at least one second server respectively
Time delay obtains at least one communication delay;
Determining module, during for selecting maximum communication from least one communication delay that the acquisition module obtains
Prolong, delay time is determined according to the communication delay of the maximum;
Computing module, for that will receive, the time of inquiry message will be established in first connection and the delay time carries out phase
Add, obtain described send and invite the time.
14. device as claimed in claim 13, which is characterized in that first connection, which establishes in inquiry message also to carry, establishes
Resource size needed for connection;
Correspondingly, described device further includes comparison module:
The acquisition module is additionally operable to obtain the idling-resource size in the first server;
The comparison module, for the idling-resource size in the first server and the money established needed for connection
Source size;
The determining module is additionally operable to determine that the idling-resource size in the first server is greater than or equal to the company of foundation
Required resource size is connect, triggers the sending module when the transmission invites the time to reach, according to the IP of the terminal
Location sends connection to the terminal and establishes invitation message.
15. device as claimed in claim 14, which is characterized in that described device further includes:
Reserved module establishes invitation for sending connection to the terminal according to the IP address of the terminal in the sending module
Before message, the resource size needed for connecting is established according to described, the required resource of the foundation connection is reserved for the terminal.
16. the device as described in claim 12-15 any claims, which is characterized in that the sending module includes:
Selecting unit, for the selected section second server from least one second server;
Transmitting element is sent respectively to the part second server for the described second connection to be established inquiry message.
17. device as claimed in claim 16, which is characterized in that the selecting unit includes:
Subelement is obtained, for the IP address according to the terminal, corresponding geography is obtained from stored public network address library
Position, the public network address library include the correspondence between IP address and geographical location;
Determination subelement for the geographical location obtained according to the acquisition subelement, determines the geographical location institute of the terminal
Geographic range;
Subelement is obtained, is additionally operable to from the correspondence between stored geographic range and server ip address, obtains institute
The corresponding at least one server ip address of geographic range where stating the geographical location of terminal;
Determination subelement is additionally operable to the corresponding service of at least one server ip address for obtaining the acquisition subelement
Device is determined as the part second server of selection.
18. a kind of service access device of terminal, is integrated in second server, which is characterized in that described device includes:
Inquiry message is established in receiving module, the second connection for receiving first server transmission, and second connection, which is established, askes
Ask that message at least carries the Internet protocol IP address for sending and inviting time and terminal, inquiry message is established in second connection
To be the first server establish inquiry message according to the first connection that the terminal is sent generate, the first server with
The second server is the server that same service is provided for the terminal;
Sending module, for when the transmission invites the time to reach, being sent according to the IP address of the terminal to the terminal
Invitation message is established in connection;
Module is provided, if response message is established in the connection that the terminal transmission is received for the second server, to
The terminal provides the service.
19. device as claimed in claim 18, which is characterized in that second connection, which establishes in inquiry message also to carry, establishes
Resource size needed for connection;
Correspondingly, described device further includes acquisition module, comparison module and determining module:
The acquisition module, for obtaining the idling-resource size in the second server;
The comparison module, for the idling-resource size in the second server and the money established needed for connection
Source size;
The determining module connects for determining that the idling-resource size in the second server is greater than or equal to described establish
Required resource size triggers the sending module when the transmission invites the time to reach, according to the IP address of the terminal
Connection, which is sent, to the terminal establishes invitation message.
20. device as claimed in claim 19, which is characterized in that described device further includes:
Reserved module establishes invitation for sending connection to the terminal according to the IP address of the terminal in the sending module
Before message, the resource size needed for connecting is established according to described, the required resource of the foundation connection is reserved for the terminal.
21. a kind of service access system of terminal, which is characterized in that the system comprises terminal, such as claim 12-17 are any
First server and at least one second service as described in claim 18-20 any claims described in claim
Device;
The terminal, will be at least two server for selecting the first server from least two servers
Other servers in addition to the first server are as the second server;
The terminal is additionally operable to send the first connection foundation inquiry message to the first server, and first connection is established
Inquiry message at least carries the Internet protocol IP address of the terminal;
The terminal, be additionally operable to receive it is each connection establish invitation message when record it is described it is each connection establish invitation message
Receiving time, and according to the receiving time of record, determine that sending the connection that the terminal receives earliest establishes invitation message
Third server, and to the third server send connection establish response message, the third server is described first
A server in server and at least one second server.
22. system as claimed in claim 21, which is characterized in that the terminal is additionally operable to:
Using specified server as first server;Or,
The server identification of user's selection is received, using the corresponding server of the server identification of reception as first server;Or,
According to the IP address of the terminal, corresponding geographical location is obtained from stored public network address library, according to acquisition
Geographical location determines the geographic range where the geographical location of the terminal, from stored geographic range with server ip
In correspondence between location, the corresponding server ip address of geographic range where obtaining the geographical location of the terminal will
The corresponding server of server ip address of acquisition is determined as first server, and the public network address library includes IP address and geography
Correspondence between position.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410168210.1A CN105099987B (en) | 2014-04-24 | 2014-04-24 | Business access method, the apparatus and system of terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410168210.1A CN105099987B (en) | 2014-04-24 | 2014-04-24 | Business access method, the apparatus and system of terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105099987A CN105099987A (en) | 2015-11-25 |
CN105099987B true CN105099987B (en) | 2018-06-26 |
Family
ID=54579554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410168210.1A Active CN105099987B (en) | 2014-04-24 | 2014-04-24 | Business access method, the apparatus and system of terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105099987B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106453560B (en) * | 2016-10-14 | 2019-12-03 | 北京小米移动软件有限公司 | Time obtaining method and device |
CN112068822A (en) * | 2020-08-26 | 2020-12-11 | 深圳市卓智荟教育科技有限公司 | Visual generation method, device, equipment and storage medium of education terminal |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101227304B (en) * | 2007-01-19 | 2010-12-08 | 中兴通讯股份有限公司 | Method and apparatus for implementation of inquire switching business |
CN100574474C (en) * | 2007-03-13 | 2009-12-23 | 中兴通讯股份有限公司 | Set up the method that communication traffic connects in a kind of communication system |
CN101056320B (en) * | 2007-05-29 | 2010-08-18 | 中兴通讯股份有限公司 | A file transfer method and its system in the data meeting |
CN101431737B (en) * | 2007-11-05 | 2012-07-04 | 华为技术有限公司 | Multimedia conversation call control method and application server thereof |
CN101577883B (en) * | 2008-08-07 | 2014-02-05 | 中兴通讯股份有限公司 | Method, device and system for talking connection |
-
2014
- 2014-04-24 CN CN201410168210.1A patent/CN105099987B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN105099987A (en) | 2015-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6614788B1 (en) | Network address management | |
CN114338594B (en) | ARP (Address resolution protocol) response-substituting method, device, equipment and storage medium in Kubernetes environment | |
CN103781055A (en) | Data downloading method and associated device | |
US9054976B2 (en) | Network configuration system based on location and configuration method thereof | |
CN105245639A (en) | Host and IP address conflict prevention method thereof | |
CN104488240B (en) | Session management method, address management method and relevant device | |
CN111064786B (en) | Account identifier management method and device | |
CN114500633B (en) | Data forwarding method, related device, program product and data transmission system | |
CN105991481A (en) | Message forwarding method and message forwarding apparatus | |
CN105099987B (en) | Business access method, the apparatus and system of terminal | |
CN109379239B (en) | Method and device for configuring access switch in OpenStack environment | |
CN112688817B (en) | Network service issuing method, system and device based on government affair cloud and storage medium | |
CN103401787A (en) | Static route issuing method and UPE (Ultimate Provider Edge) | |
CN116566830A (en) | Network configuration method, device, system, edge equipment and storage medium | |
CN109274774A (en) | A kind of date storage method, device and computer readable storage medium | |
WO2022105508A1 (en) | Route tracing method and apparatus, device, and storage medium | |
CN114006910B (en) | Information synchronization method and device | |
CN112511440A (en) | Message forwarding method, system, storage medium and electronic equipment | |
KR20040056378A (en) | Dual stack transition mechanism router and method for cache table | |
JP3134823B2 (en) | Automatic setting method of IP address in TCP / IP network | |
CN117082152B (en) | Service processing method, system and device | |
CN110809033A (en) | Message forwarding method and device and switching server | |
US20080198762A1 (en) | Cross-subnet-nodes subnet node device detection method | |
CN109561170A (en) | Address pool creation method, device, address pool management system and storage medium | |
CN111224876B (en) | Message processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |