Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The embodiments of the invention provide a kind of method of data processing, this method is mainly used in client-side, such as Fig. 1 institutes
Show, this method mainly includes:
101st, domain name and the current environmental information of terminal to be visited is obtained.
When user desires access to a certain network address in client, it can be inputted by clickthrough or network address input field
The mode of network address triggers client and accesses the network address.Net is inputted when the link in user's webpage clicking or in network address input field
Location and after being linked, client can obtain domain name to be visited from the network address of access, and after the domain name is obtained, it is determined that
The current environmental information of terminal, so as to the IP address needed for subsequently being searched based on the environmental information.
Specifically, environmental information mainly includes geographical position and network type.Wherein, network type mainly includes 2G (The
2rd Generation Telecommunication, Generation Mobile Telecommunication System technology) network, 3G (The 3rd
Generation Telecommunication, 3rd generation mobile communication technology) network, 4G (The 4rd Generation
Telecommunication, forth generation mobile communication technology) network and WiFi (Wireless Fidelity, Wireless Fidelity)
Network.
102nd, IP corresponding with domain name and matching with the environmental information is searched from default memory space
Location.
Specifically, after client determines its affiliated terminal current environmental information, can be first from default memory space
The IP address corresponding with domain name to be visited is searched, if finding the corresponding IP address of the domain name from default memory space,
The IP address that the environmental information current with terminal is matched is searched from the IP address found, to find and the two
After the IP address that part is matched, step 103 is performed.
If the 103, finding the IP address, based on default IP quality-ordereds algorithm, quality is carried out to the IP address
Sequence, so as to which after quality-ordered result is obtained, operation is attached according to the quality-ordered result.
If specifically, found from default memory space it is corresponding with domain name to be visited and with terminal current context information
The IP address matched, then in order that client is quickly successfully established with a certain IP address in these IP address is connected, first base
In default IP quality-ordered algorithms, these IP address to acquisition carry out quality-ordered, then according to quality-ordered result, successively
Attempt to set up with the IP address of quality from high to low and be connected, untill with a certain IP address successful connection.
The method of data processing provided in an embodiment of the present invention, can first determine terminal after domain name to be visited is obtained
Current environmental information, then IP corresponding with the domain name and matching with environmental information is searched from default memory space
These IP address if finding the IP address, based on default IP quality-ordereds algorithm, are carried out quality-ordered, obtained by location
After quality-ordered result, operation is attached according to quality-ordered result.With in the prior art directly by default memory space
The corresponding IP address of domain name is compared as IP address to be connected, the present invention will meet simultaneously it is corresponding with domain name to be visited and
It is defined as IP address to be connected with the match IP address of the two conditions of environmental information, so that from default memory space
The IP address of middle acquisition is the IP address that terminal is presently in connect under environment (including geographical position and network type),
And then avoid IP address of the generation in the case where the corresponding IP address of domain name of default memory space storage is not terminal current environment
In the case of, also it is attached with these IP address, so as to cause the Connection Time long, or even causes connection to be lost because of connection time-out
The phenomenon lost.It follows that the present invention can one group of IP address easily connecting at present of quick obtaining client, then according to this
The quality of group IP address attempts connection successively, so as to further increase the efficiency of connection IP address.
Further, according to the embodiment shown in Fig. 1, an alternative embodiment of the invention additionally provides a kind of data processing
Method, as shown in Fig. 2 this method mainly includes:
201st, domain name and the current environmental information of terminal to be visited is obtained.
202nd, IP corresponding with domain name and matching with the environmental information is searched from default memory space
Location.
The specific implementation of this step can be such as following step A1-A3:
A1, the corresponding IP address of lookup domain name from the default memory space.
If A2, finding the corresponding IP address of domain name, by the environmental information with for describing to store the IP
The terminal environments mark of the terminal environments information is matched during address.
This step can be specifically refined as:
A1, the geographical position in the terminal environments mark of the acquisition IP address and network type.
A2, according to predeterminated position range algorithm, determine the corresponding position range in the geographical position.
Because in the range of certain position, the IP address of server is one group of identical IP address, so it is determined that terminal
, it is necessary to first be calculated according to predeterminated position scope when whether the geographical position current with terminal is matched in geographical position in environmental labelses
Method, determine terminal environments mark in the corresponding position range in geographical position, then judge the current geographical position of terminal whether
In the position range, so that it is determined that the current geographical position of terminal IP address whether corresponding with domain name in default memory space
Geographical position is matched.
Wherein, predeterminated position range algorithm can have a variety of, for example, can be by the geographical position in being identified with terminal environments
For the center of circle, the corresponding position in geographical position in being identified using the circle that pre-set radius (such as 5KM) is radius determination as terminal environments
Scope.
A3, judge geographical position in the environmental information whether in the position range and in the environmental information
Network type whether with the terminal environments identify in network type it is identical.
If network class of the geographical position in a4, the environmental information in the position range and in the environmental information
Network type during type is identified with the terminal environments is identical, it is determined that the terminal environments of the environmental information and the IP address
The match is successful for mark;If the geographical position in the environmental information is not in the position range or in the environmental information
Network type during network type is identified with the terminal environments is differed, it is determined that the environmental information and the IP address
It fails to match for terminal environments mark.
Exemplary, be stored with the corresponding IP address of 4 domain names to be visited in default memory space, respectively IP1,
IP2, IP3 and IP4.Wherein, IP1 terminal environments are designated " geographical position:Beijing Station;Network type:WiFi ", IP2's
Terminal environments are designated " geographical position:Shijiazhuang Railway Station;Network type:4G ", IP3 terminal environments are designated " geographical position:North
Jingxi district station;Network type:WiFi " and IP4 terminal environments are designated " geographical position:Hangzhou West Lake;Network type:2G”.
The current environmental information of terminal is " geographical position:Three inner villages;Network type:WiFi ", then determine the end of each IP address respectively
The geographical position correspondence position scope in environmental labelses is held, then by the geographical position in the current environmental information of terminal and net
Corresponding with each IP address position range and network type are matched network type respectively, finally determine that IP1 and IP3 is matched into
It fails to match by work(, IP2 and IP4.
A3, the IP address that the match is successful is defined as IP that is corresponding with domain name and matching with the environmental information
Address.
In addition, default memory space includes internal memory and/or database.When only IP address is stored to internal memory or database
When middle, client can be searched directly from internal memory or database it is corresponding with domain name to be visited and with environmental information phase
The IP address matched somebody with somebody.When the default memory space for storing IP address includes internal memory and database, client first can file for reference from interior
Look for the IP address;If finding the IP address from internal memory, the IP address is directly obtained from internal memory;If not from
The IP address is found in the internal memory, then carries out quadratic search from database again.
If the 203, finding the IP address, based on default IP quality-ordereds algorithm, quality is carried out to the IP address
Sequence, so as to which after quality-ordered result is obtained, operation is attached according to the quality-ordered result.
Wherein, based on default IP quality-ordereds algorithm, it is to the specific implementation that the IP address carries out quality-ordered:
Obtain the weighted value and the dimension values of the corresponding each dimension of the IP address of each dimension in default dimension collection;According to pre-
If the weighted value of quality calculation formula, the dimension values of each dimension and each dimension, the quality of the IP address is calculated;Obtaining
After the quality for obtaining each IP address, quality-ordered operation is carried out.
Wherein, preset dimension collection include TTL (Time To Live, life span) value, history test the speed number of success, go through
History tests the speed the frequency of failure, last time successful connection time and actual successful connection number of times.
Specifically, ttl value is sets up the duration of connection, ttl value is bigger, and connection speed is smaller, and IP mass is poorer, due to
When ttl value can determine that subsequent client is attached operation substantially, correspondence IP address whether can successful connection, so upper
The weighted value for stating ttl value in dimension is larger, for example, can be 50%.In actual applications, client can be deposited regularly to default
Each IP address stored in storage space is tested the speed, and obtains corresponding ttl value;Often test the speed successfully once, history tests the speed success
Number of times cumulative 1, often tests the speed failure once, and history tests the speed the frequency of failure cumulative 1;Test the speed number of success and history of history tests the speed unsuccessfully
The weighted value of number of times is small compared to ttl value, for example, can be 10%.The last time successful connection time successfully connects for last time
Connect the time of certain IP address;After user feedback is successfully connected certain IP address, the last time successful connection time can be updated to instead
The time of feedback;The difference between time and last time successful connection time during progress quality-ordered is smaller, IP address quality
Higher, the weighted value of the dimension can be 10%.Actual successful connection number of times for user feedback certain IP address that is successfully connected
Cumulative number, i.e., after user, which is known, is successfully connected certain IP address, can be successfully connected by client end interface to client feedback
The corresponding actual successful connection number of times of the IP address is added 1 by the IP address, client after obtaining;Due to actual successful connection number of times
It can reflect that client IP address corresponding with certain domain name is attached the actual conditions of operation, so actual successful connection number of times
Weight ratio history number of success, the history frequency of failure etc. that tests the speed that tests the speed it is big, for example can be 20%.
In actual applications, the computational methods of preset quality calculation formula are mainly:First respectively according to the dimension of each dimension
Angle value and weighted value calculate the quality score under the dimension, and then the quality score of each dimension is summed, and obtain IP
The final quality in address.
For example, the computational methods of the quality score of actual successful connection number of times can be:Wherein nxFor
The actual successful connection number of times of current IP address, nmaxFor the maximum of actual successful connection number of times in all IP address to be sorted
Value, m is the weighted value of actual successful connection number of times, such as works as nxFor 5, nmax50, m be 20% when, the matter of actual successful connection number of times
It is 2 to measure score value.
It should be noted that compared with prior art, the embodiment of the present invention by add actual successful connection number of times this
Dimension so that IP quality-ordered results are more accurate.
In addition, cloud server can monitor the actual connection of each client, and it is actual according to each client
Connection increase either reduces the weighted value of dimension or the existing dimension of adjustment, and the renewal that will carry these dimensional informations
Instruction is handed down to each client;Client is received after the more new command of cloud server transmission, can be according to more new command
The dimensional information of middle carrying, updates default dimension collection and/or the weighted value of dimension, so that the accuracy rate of quality-ordered is improved,
And then improve the efficiency that subsequent client connects IP address.
If the 204, not finding the IP address, the domain name solution for carrying domain name is sent to domain name resolution server
Analysis request.
Wherein, domain name resolution server can be the domain name resolution server of operator, or the special service visitor
The domain name resolution server at family end.
When client determines IP address not corresponding with domain name and matching with environmental information in default memory space
When, the domain name mapping request for carrying the domain name can be sent to domain name resolution server, so that domain name resolution server is received
After domain name mapping request, the domain name is parsed, corresponding IP address is obtained.
205th, the corresponding IP address of domain name that domain name resolution server is sent is received.
206th, based on the default IP quality-ordereds algorithm, quality-ordered is carried out to the IP address received, to obtain
Obtain after quality-ordered result, operation is attached according to the quality-ordered result.
This step is consistent with the specific implementation of above-mentioned steps 203, will not be repeated here.
Further, due to the limited storage space of terminal, so needing periodically or irregularly to presetting memory space
Cleared up, to mitigate terminal burden, it is ensured that normal operation of terminal.Therefore, client can be according to default cleaning rule, to pre-
If the IP address in memory space is cleared up.
As soon as specifically, after due to that may be accessed twice for some domain name users, not visiting again, it is possible to
To in preset time period untapped IP address clear up;Order due to client according to IP address quality from high to low
Connection is attempted, so generally, client can be successfully connected the higher IP address of a certain quality, without trial and quality
Poor IP address connection, it is possible to clear up the IP address that quality is less than predetermined threshold value;Due to the IP of server
Location may be changed, so client can also will store IP address of the duration more than preset duration threshold value and delete, so as to follow-up
The newest corresponding IP address of same domain name is obtained from domain name resolution server side.
In addition, for same domain name, because the corresponding server of different network type in a certain position range may
It is identical, or including of determining of client is smaller than actual position range with the position range of a collection of IP address, so in advance
If it is possible that the different IP address of IP address content same terminal environmental labelses in memory space, therefore can be deposited default
The multiple identical IP address cleanings stored up in space are an IP address, and identify progress to the terminal environments of multiple identical IP address
Merging treatment.
For example, be stored with default memory space 3 IP4 (such as 192.168.1.1), and each IP4 terminal environments mark
It is respectively " geographical position to know:Chaoyang District, Beijing City;Network type:WiFi ", " geographical position:Chaoyang District, Beijing City;Network class
Type:3G " and " geographical position:Haidian District, Beijing City;Network type:3G ", then can delete 2 192.168.1.1, then will
3 terminal environments marks are merged into:" geographical position:Chaoyang District, Beijing City and Haidian District, Beijing City;Network type:WiFi and
3G”。
Further, according to above method embodiment, an alternative embodiment of the invention additionally provides a kind of data
The device of processing, as shown in figure 3, the device mainly includes:Acquiring unit 31, searching unit 32 and sequencing unit 33.Wherein,
Acquiring unit 31, domain name to be visited and the current environmental information of terminal for obtaining;
Searching unit 32, for from default memory space search it is corresponding with domain name and with the environmental information phase
The IP(Internet Protocol) IP address of matching;
Sequencing unit 33, for when the searching unit 32 finds the IP address, based on default IP quality-ordereds
Algorithm, quality-ordered is carried out to the IP address, after quality-ordered result is obtained, to be entered according to the quality-ordered result
Row attended operation.
The device of data processing provided in an embodiment of the present invention, can first determine terminal after domain name to be visited is obtained
Current environmental information, then IP corresponding with the domain name and matching with environmental information is searched from default memory space
These IP address if finding the IP address, based on default IP quality-ordereds algorithm, are carried out quality-ordered, obtained by location
After quality-ordered result, operation is attached according to quality-ordered result.With in the prior art directly by default memory space
The corresponding IP address of domain name is compared as IP address to be connected, the present invention will meet simultaneously it is corresponding with domain name to be visited and
It is defined as IP address to be connected with the match IP address of the two conditions of environmental information, so that from default memory space
The IP address of middle acquisition is the IP address that terminal is presently in connect under environment (including geographical position and network type),
And then avoid IP address of the generation in the case where the corresponding IP address of domain name of default memory space storage is not terminal current environment
In the case of, also it is attached with these IP address, so as to cause the Connection Time long, or even causes connection to be lost because of connection time-out
The phenomenon lost.It follows that the present invention can one group of IP address easily connecting at present of quick obtaining client, then according to this
The quality of group IP address attempts connection successively, so as to further increase the efficiency of connection IP address.
Further, as shown in figure 4, the device also includes:
Transmitting element 34, for when the searching unit 32 does not find the IP address, to domain name resolution service
Device sends the domain name mapping request for carrying domain name;
First receiving unit 35, the corresponding IP address of domain name for receiving the transmission of domain name resolution server;
The sequencing unit 33, is additionally operable to be based on the default IP quality-ordereds algorithm, first receiving unit is connect
The IP address received carries out quality-ordered, after quality-ordered result is obtained, to be connected according to the quality-ordered result
Connect operation.
Further, as shown in figure 4, the device also includes:
Adding device 36, for receiving the domain that domain name resolution server is sent in first receiving unit 35
After the corresponding IP address of name, the terminal environments for including the environmental information for the IP address addition that receives are identified;
Memory cell 37, for the adding device 36 to be added to IP address and domain name after terminal environments mark
Store to the default memory space.
Further, as shown in figure 4, the searching unit 32 includes:
Subelement 321 is searched, for searching the corresponding IP address of domain name from the default memory space;
Coupling subelement 322, will for when the lookup subelement 321 finds the corresponding IP address of domain name
The terminal environments mark of the terminal environments information is matched when the environmental information is with for describing to store the IP address;
Determination subelement 323, for the IP address that the match is successful of coupling subelement 322 to be defined as and domain name
IP address that is corresponding and matching with the environmental information.
Further, as shown in figure 4, the coupling subelement 322 includes:
Acquisition module 3221, for obtaining geographical position and network type during the terminal environments of the IP address are identified;
Determining module 3222, for according to predeterminated position range algorithm, determining that the acquisition module 3221 is obtained described
The corresponding position range in geographical position;
Judge module 3223, for judge the geographical position in the environmental information whether in the position range and
Network type during whether the network type in the environmental information identifies with the terminal environments is identical;
The determining module 3222, is additionally operable in the judged result of the judge module 3223 is the environmental information
Network type of the geographical position in the position range and in the environmental information is identical with the network type of the IP address
When, determining the environmental information, the match is successful with the terminal environments mark in terminal environments mark, when the judge module 3223
Judged result be geographical position net not in the position range or in the environmental information in the environmental information
When the network type of network type and the IP address is differed, the environmental information and the end in terminal environments mark are determined
Holding environmental labelses, it fails to match.
Further, as shown in figure 4, the device also includes:
Unit 38 is cleared up, for according to default cleaning rule, clearing up the IP address in the default memory space.
Further, as shown in figure 4, the cleaning unit 38 includes:
First cleaning subelement 381, in preset time period untapped IP address clear up;
Second cleaning subelement 382, the IP address for being less than predetermined threshold value to quality is cleared up;
3rd cleaning subelement 383, the IP address for being more than preset duration threshold value to storage duration is cleared up;
Duplicate removal subelement 384, for being carried out to the IP address in the default memory space at duplicate removal processing, the duplicate removal
Manage for being an IP address by the cleaning of multiple identical IP address, and progress is identified to the terminal environments of multiple identical IP address
Merge.
Further, as shown in figure 4, the sequencing unit 33 includes:
Obtain subelement 331, weighted value and the IP address pair for obtaining each dimension in default dimension collection
The dimension values for each dimension answered, the default dimension collection includes life span ttl value, history and tested the speed number of success, history
Test the speed the frequency of failure, last time successful connection time and actual successful connection number of times;
Computation subunit 332, for according to preset quality calculation formula, the dimension values of each dimension and each dimension
Weighted value, calculates the quality of the IP address;
Sort subelement 333, for after the quality of each IP address is obtained, carrying out quality-ordered operation.
Further, as shown in figure 4, the device also includes:
Second receiving unit 39, the more new command for receiving cloud server transmission;
Updating block 310, for the dimension carried in the more new command according to second receiving unit 310 reception
Information, updates the default dimension collection and/or the weighted value of dimension.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, above-described embodiment
In " first ", " second " etc. be to be used to distinguish each embodiment, and do not represent the quality of each embodiment.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the device of foregoing description
With the specific work process of unit, the corresponding process in preceding method embodiment is may be referred to, be will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, exist
Above in the description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself
All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features come generation
Replace.
Although in addition, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of be the same as Example does not mean in of the invention
Within the scope of and form different embodiments.For example, in the following claims, times of embodiment claimed
One of meaning mode can be used in any combination.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) come realize data processing according to embodiments of the present invention device some or
The some or all functions of person's whole part.The present invention is also implemented as perform method as described herein one
Divide or whole equipment or program of device (for example, computer program and computer program product).It is such to realize this hair
Bright program can be stored on a computer-readable medium, or can have the form of one or more signal.It is such
Signal can be downloaded from internet website and obtained, and either provided or provided in any other form on carrier signal.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.