[go: up one dir, main page]

CN102036422B - Method, device and system for acquiring IP address - Google Patents

Method, device and system for acquiring IP address Download PDF

Info

Publication number
CN102036422B
CN102036422B CN200910093692.8A CN200910093692A CN102036422B CN 102036422 B CN102036422 B CN 102036422B CN 200910093692 A CN200910093692 A CN 200910093692A CN 102036422 B CN102036422 B CN 102036422B
Authority
CN
China
Prior art keywords
address
type
network side
dns
analysis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN200910093692.8A
Other languages
Chinese (zh)
Other versions
CN102036422A (en
Inventor
李振强
李连源
党京
金鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN200910093692.8A priority Critical patent/CN102036422B/en
Publication of CN102036422A publication Critical patent/CN102036422A/en
Application granted granted Critical
Publication of CN102036422B publication Critical patent/CN102036422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种IP地址获取方法、装置及系统,用于解决现有技术中双栈终端访问业务失败率高的问题。主要技术方案包括:请求网络侧分配第一类型的互联网协议IP地址,并根据网络侧分配的第一类型的IP地址进行域名服务器DNS解析;在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。根据该技术方案,当DNS解析失败或终端获取的IP地址与其访问业务的地址不匹配时,进一步获取第二类型的IP地址,从而避免了由于终端获取的IP地址类型与其访问业务对应的地址类型不匹配而导致的业务访问失败问题,提高了双栈终端访问业务的成功率,充分发挥了双栈终端的双栈能力。

The invention discloses an IP address acquisition method, device and system, which are used to solve the problem of high failure rate of dual-stack terminal access services in the prior art. The main technical solutions include: requesting the network side to allocate the first type of Internet protocol IP address, and performing DNS resolution of the domain name server according to the first type of IP address allocated by the network side; after the DNS resolution fails or when the DNS resolution succeeds and the resolution results When the carried address does not match the IP address of the first type, the network side is requested to allocate the IP address of the second type. According to this technical solution, when the DNS resolution fails or the IP address obtained by the terminal does not match the address of its access service, the second type of IP address is further obtained, thereby avoiding the problem of the IP address type obtained by the terminal corresponding to the address type of its access service. The problem of service access failure caused by mismatch improves the success rate of dual-stack terminals to access services, and fully utilizes the dual-stack capabilities of dual-stack terminals.

Description

一种IP地址获取方法、装置及系统A method, device and system for obtaining an IP address

技术领域 technical field

本发明涉及移动通信技术领域,尤其涉及一种IP地址获取方法、装置及系统。The present invention relates to the technical field of mobile communication, in particular to an IP address acquisition method, device and system.

背景技术 Background technique

在移动通信领域,终端数量越来越多,因此,IPv4地址已经渐渐不能满足众多终端对IP(Internet Protocol,互联网协议)地址的需求,IPv6具有比IPv4更广泛的地址空间,因此,IPv6在移动通信领域的使用有着光明的前景。In the field of mobile communication, the number of terminals is increasing. Therefore, IPv4 addresses have gradually been unable to meet the needs of many terminals for IP (Internet Protocol, Internet Protocol) addresses. IPv6 has a wider address space than IPv4. Therefore, IPv6 is used in mobile The use in the field of communication holds a bright future.

由于基于IPv4实现的网络规模已经相当庞大,多数应用也专门针对IPv4开发,因此,通信网络向IPv6过渡将经历一个漫长的时期,在相当长一段时间内IPv4和IPv6将共存。为了适应该过渡期,越来越多的终端可以同时支持IPv4和IPv6,这类终端称为双栈终端。目前双栈终端在通过APN(Access PointName,接入点名称)访问互联网业务时,如图1所示,执行如下步骤:Since the network scale based on IPv4 is quite large, and most applications are developed specifically for IPv4, the transition of communication networks to IPv6 will go through a long period, and IPv4 and IPv6 will coexist for a long period of time. In order to adapt to the transition period, more and more terminals can support IPv4 and IPv6 at the same time, and such terminals are called dual-stack terminals. At present, when a dual-stack terminal accesses Internet services through APN (Access PointName, access point name), as shown in Figure 1, perform the following steps:

步骤101、终端MS根据使用的APN指定PDP类型为IPv4或IPv6,并向SGSN(Serving GPRS Support Node,服务GPRS支持节点)发送PDP(PacketData Protocol,数据包协议)上下文激活请求(Activate PDP Context Request),该PDP上下文激活请求中包括用户请求获取的地址类型;Step 101, the terminal MS specifies that the PDP type is IPv4 or IPv6 according to the APN used, and sends a PDP (PacketData Protocol, data packet protocol) context activation request (Activate PDP Context Request) to the SGSN (Serving GPRS Support Node, serving GPRS support node) , the PDP context activation request includes the address type requested by the user;

步骤102、SGSN对MS鉴权通过后,向GGSN(Gateway GPRS SupportNode,网关GPRS支持节点)发送PDP上下文创建请求(Create PDP ContextRequest);Step 102, SGSN sends PDP context creation request (Create PDP ContextRequest) to GGSN (Gateway GPRS SupportNode, gateway GPRS support node) after passing MS authentication;

步骤103、GGSN向SGSN反馈PDP上下文创建响应(Create PDP ContextResponse),并在该PDP上下文中包含用户请求获取的地址(为IPv4地址或IPv6地址前缀);Step 103, GGSN feeds back the PDP context creation response (Create PDP ContextResponse) to SGSN, and includes the address (for IPv4 address or IPv6 address prefix) that user requests to obtain in this PDP context;

步骤104、SGSN向MS反馈PDP上下文激活接受(Activate PDP ContextAccept)。Step 104: The SGSN feeds back the PDP context activation acceptance (Activate PDP ContextAccept) to the MS.

如果MS接收的PDP上下文中包含的是IPv4地址,则终端可以直接根据该IPv4地址进行DNS解析并在解析成功后访问业务,如果MS接收的PDP上下文中包含的是IPv6地址前缀,终端还需接收GGSN下发的路由器宣告消息,该消息中包含IPv6地址前缀,可以基于该IPv6地址前缀生成IPv6地址,并根据生成的IPv6地址进行DNS解析并在解析成功后访问业务,其中,路由宣告消息可以由GGSN根据定时机制主动下发,也可以基于MS的路由器请求消息下发。If the PDP context received by the MS contains an IPv4 address, the terminal can directly perform DNS resolution based on the IPv4 address and access the service after the resolution is successful. If the PDP context received by the MS contains an IPv6 address prefix, the terminal also needs to receive The router announcement message sent by the GGSN contains an IPv6 address prefix, and an IPv6 address can be generated based on the IPv6 address prefix, and DNS resolution is performed according to the generated IPv6 address and the service is accessed after the resolution is successful. The GGSN sends it actively according to the timing mechanism, or it can send it based on the router request message of the MS.

现有终端通过以上流程只能获得IPv4地址或者IPv6地址前缀,由于通常终端在访问业务之前只知道其要访问业务的域名(如www.abc.com),而无法确定其要访问的业务服务器支持的IP地址类型,因此,如果终端通过PDP激活获得了IPv4地址,而其要访问的为IPv6业务,则终端在通过DNS(DomainName Server,域名服务器)系统询问要访问业务的IPv4地址时,DNS系统向终端回复要访问的域名不存在的信息,导致终端业务访问失败,反之亦然。Existing terminals can only obtain IPv4 addresses or IPv6 address prefixes through the above process. Usually, terminals only know the domain name of the service they want to access (such as www.abc.com) before accessing the service, and cannot determine the service server they want to access. Therefore, if the terminal obtains an IPv4 address through PDP activation, and the service it wants to access is an IPv6 service, when the terminal queries the IPv4 address of the service to be accessed through the DNS (Domain Name Server, domain name server) system, the DNS system Reply to the terminal with the information that the domain name to be accessed does not exist, resulting in failure of terminal service access, and vice versa.

综上所述,现有双栈终端访问业务时,在未知其要访问的业务支持的IP类型的前提下,其只能获取到IPv4地址或IPv6地址前缀,导致终端访问业务的失败率高,终端的双栈能力也没有得到充分发挥。To sum up, when existing dual-stack terminals access services, they can only obtain IPv4 addresses or IPv6 address prefixes without knowing the IP types supported by the services they want to access, resulting in a high failure rate for terminals accessing services. The dual-stack capability of the terminal has not been fully utilized.

发明内容 Contents of the invention

有鉴于此,本发明实施例提供一种IP地址获取方法、装置及系统,用于解决现有技术中双栈终端访问业务失败率高的问题。In view of this, the embodiments of the present invention provide an IP address acquisition method, device and system, which are used to solve the problem of high failure rate of dual-stack terminal access services in the prior art.

本发明实施例通过如下技术方案实现:Embodiments of the present invention are realized through the following technical solutions:

根据本发明实施例的一个方面,提供了一种IP地址获取方法。According to an aspect of the embodiments of the present invention, a method for obtaining an IP address is provided.

根据本发明实施例提供的IP地址获取方法,包括:The method for obtaining an IP address according to an embodiment of the present invention includes:

请求网络侧分配第一类型的互联网协议IP地址,并根据网络侧分配的第一类型的IP地址进行域名服务器DNS解析;Requesting the network side to allocate the first type of Internet protocol IP address, and performing domain name server DNS resolution according to the first type of IP address allocated by the network side;

在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与所述第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。After the DNS resolution fails or when the DNS resolution succeeds and the address carried in the resolution result does not match the IP address of the first type, request the network side to allocate the IP address of the second type.

根据本发明实施例的另一个方面,还提供了一种IP地址获取装置。According to another aspect of the embodiments of the present invention, a device for obtaining an IP address is also provided.

根据本发明实施例提供的IP地址获取装置,包括:The device for obtaining an IP address according to an embodiment of the present invention includes:

第一通信单元,用于请求网络侧分配第一类型的互联网协议IP地址,并接收网络侧分配的第一类型的IP地址;The first communication unit is configured to request the network side to allocate a first type of Internet Protocol IP address, and receive the first type of IP address allocated by the network side;

DNS解析单元,用于根据所述第一通信单元接收的第一类型的IP地址进行域名服务器DNS解析;A DNS resolution unit, configured to perform domain name server DNS resolution according to the first type of IP address received by the first communication unit;

第二通信单元,用于在所述DNS解析单元解析失败后或在DNS解析成功且解析结果中携带的地址与所述第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。The second communication unit is configured to request the network side to allocate a second type of IP after the DNS resolution unit fails to resolve or when the DNS resolution is successful and the address carried in the resolution result does not match the first type of IP address address.

根据本发明实施例的另一个方面,还提供了一种IP地址获取系统。According to another aspect of the embodiments of the present invention, an IP address acquisition system is also provided.

根据本发明实施例提供的IP地址获取系统,包括:The IP address obtaining system provided according to the embodiment of the present invention includes:

IP地址分配服务器,用于接收终端的互联网协议IP地址分配请求,并根据所述请求中指定的IP地址类型分配相应类型的IP地址;The IP address allocation server is used to receive the terminal's Internet Protocol IP address allocation request, and allocate a corresponding type of IP address according to the IP address type specified in the request;

终端,用于请求所述IP地址分配服务器分配第一类型的IP地址,并根据所述IP地址分配服务器分配的第一类型的IP地址进行域名服务器DNS解析;以及,在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与所述第一类型的IP地址不匹配时,请求所述IP地址分配服务器分配第二类型的IP地址。A terminal, configured to request the IP address allocation server to allocate a first type of IP address, and perform DNS resolution of a domain name server according to the first type of IP address allocated by the IP address allocation server; and, after DNS resolution fails or at When the DNS resolution is successful and the address carried in the resolution result does not match the IP address of the first type, requesting the IP address allocation server to allocate the IP address of the second type.

通过本发明实施例提供的上述至少一个技术方案,终端首先请求网络侧分配第一类型的IP地址,根据网络侧分配的第一类型的IP地址进行DNS解析,并在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。根据本发明实施例提供的技术方案,当DNS解析失败或确定终端获取的IP地址类型与其访问业务对应的地址类型不匹配时,进一步获取第二类型的IP地址,从而避免了由于终端获取的IP地址类型与其访问业务对应的地址类型不匹配而导致的业务访问失败问题,提高了双栈终端访问业务的成功率。Through at least one of the above technical solutions provided by the embodiments of the present invention, the terminal first requests the network side to allocate the first type of IP address, performs DNS resolution according to the first type of IP address allocated by the network side, and after DNS resolution fails or in the DNS When the resolution is successful and the address carried in the resolution result does not match the IP address of the first type, the network side is requested to allocate the IP address of the second type. According to the technical solution provided by the embodiment of the present invention, when the DNS resolution fails or it is determined that the type of IP address obtained by the terminal does not match the type of address corresponding to the access service, the second type of IP address is further obtained, thereby avoiding the The problem of service access failure caused by the mismatch between the address type and the address type corresponding to the access service improves the success rate of dual-stack terminal access services.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

附图说明 Description of drawings

附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the description, and are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention. In the attached picture:

图1为本发明背景技术提供的终端获取IP地址的流程图;Fig. 1 is the flow chart of the terminal obtaining IP address provided by the background technology of the present invention;

图2为本发明实施例提供的获取IP地址以及访问业务的方法第一流程图;Fig. 2 is the first flowchart of the method for acquiring an IP address and accessing services provided by an embodiment of the present invention;

图3为本发明实施例提供的获取IP地址以及访问业务的方法第二流程图;FIG. 3 is a second flow chart of a method for obtaining an IP address and accessing services provided by an embodiment of the present invention;

图4为本发明实施例提供的获取IP地址以及访问业务的方法第三流程图;FIG. 4 is a third flow chart of a method for obtaining an IP address and accessing services provided by an embodiment of the present invention;

图5为本发明实施例提供的IP地址获取装置第一示意图;FIG. 5 is a first schematic diagram of an IP address acquisition device provided by an embodiment of the present invention;

图6为本发明实施例提供的IP地址获取装置第二示意图;FIG. 6 is a second schematic diagram of an IP address obtaining device provided by an embodiment of the present invention;

图7为本发明实施例提供的IP地址获取装置第三示意图;FIG. 7 is a third schematic diagram of an IP address obtaining device provided by an embodiment of the present invention;

图8为本发明实施例提供的IP地址获取系统示意图。FIG. 8 is a schematic diagram of an IP address acquisition system provided by an embodiment of the present invention.

具体实施方式 Detailed ways

为了给出提高双栈终端访问业务的成功率的实现方案,本发明实施例提供了一种IP地址获取方法、装置及系统,以下结合说明书附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。并且在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to provide an implementation plan for improving the success rate of dual-stack terminal access services, embodiments of the present invention provide an IP address acquisition method, device, and system. The preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings. It should be understood that, The preferred embodiments described here are only used to illustrate and explain the present invention, not to limit the present invention. And in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

根据本发明实施例,提供了一种获取IP地址以及访问业务的方法,如图2所示,包括:According to an embodiment of the present invention, a method for obtaining an IP address and accessing services is provided, as shown in FIG. 2 , including:

步骤201、双栈终端请求网络侧分配第一类型的IP地址。Step 201, the dual-stack terminal requests the network side to allocate a first type of IP address.

该步骤中,第一类型的IP地址为IPv4地址和IPv6地址中确定需要优先获取的地址。In this step, the first type of IP address is determined to be preferentially obtained among the IPv4 address and the IPv6 address.

步骤202、接收网络侧分配的第一类型的IP地址。Step 202, receiving the first type of IP address allocated by the network side.

该步骤中,若步骤201请求的是IPv4地址类型,则网络侧直接分配一个IPv4地址给双栈终端,若步骤201请求的是IPv6地址类型,则网络侧分配一个IPv6地址前缀给双栈终端,由双栈终端根据网络侧分配的IPv6地址前缀生成用于访问业务的IPv6地址。In this step, if what step 201 requests is the IPv4 address type, then the network side directly assigns an IPv4 address to the dual-stack terminal, and if what the step 201 requests is an IPv6 address type, then the network side assigns an IPv6 address prefix to the dual-stack terminal, The dual-stack terminal generates an IPv6 address for accessing services according to the IPv6 address prefix allocated by the network side.

步骤203、根据网络侧分配的第一类型的IP地址进行DNS解析。Step 203, performing DNS resolution according to the first type of IP address allocated by the network side.

该步骤中,若终端在步骤201请求网络侧分配的是IPv4地址,其需要获取待访问业务服务器的IPv4地址,则向DNS系统发送地址解析请求,请求DNS返回业务服务器对应的A类地址(即IPv4地址),该请求中携带业务服务器对应的域名;若终端在步骤201请求网络侧分配的是IPv6地址,其需要获取待访问业务服务器的IPv6地址,则向DNS系统发送地址解析请求,请求DNS返回业务服务器对应的AAAA类地址(即IPv6地址),该请求中携带业务服务器对应的域名。In this step, if the terminal requests the network side to allocate an IPv4 address in step 201, and it needs to obtain the IPv4 address of the service server to be accessed, it sends an address resolution request to the DNS system and requests the DNS to return the corresponding Class A address of the service server (i.e. IPv4 address), the request carries the domain name corresponding to the service server; if the terminal requests the network side to allocate an IPv6 address in step 201, it needs to obtain the IPv6 address of the service server to be accessed, and then sends an address resolution request to the DNS system, requesting DNS Return the AAAA address corresponding to the service server (that is, the IPv6 address), and the request carries the domain name corresponding to the service server.

步骤204、判断DNS解析是否成功并且在解析成功时解析结果中携带的地址与第一类型的IP地址是否匹配,若是,执行步骤205,否则执行步骤206。Step 204 , judging whether the DNS resolution is successful and whether the address carried in the resolution result matches the first type of IP address if the resolution is successful, and if so, execute step 205 ; otherwise, execute step 206 .

该步骤中,若DNS解析终端请求访问的业务服务器支持该终端请求获取的地址类型,则返回相应类型的IP地址给终端,终端接收DNS返回的IP地址后,若确定与其在步骤202中获取的IP地址相匹配,则确定DNS解析成功;若DNS解析终端请求访问的业务服务器不支持该终端请求获取的地址类型,则返回业务服务器域名不存在的消息,终端接收该消息后,确定DNS解析失败。In this step, if the service server requested by the DNS analysis terminal to access supports the address type requested by the terminal, then return the corresponding type of IP address to the terminal. If the IP addresses match, it is determined that the DNS resolution is successful; if the service server requested by the DNS resolution terminal does not support the address type requested by the terminal, a message that the domain name of the service server does not exist will be returned, and the terminal will determine that the DNS resolution has failed after receiving the message .

步骤205、根据解析结果中与网络侧分配的第一类型的IP地址匹配的IP地址访问业务。Step 205, accessing the service according to the IP address in the analysis result that matches the first type of IP address allocated by the network side.

步骤206、双栈终端请求网络侧分配第二类型的IP地址。Step 206, the dual-stack terminal requests the network side to allocate the second type of IP address.

该步骤中,若确定为优先获取的第一类IP地址为IPv4地址,则第二类型的IP地址为IPv6地址;若确定为优先获取的第一类IP地址为IPv6地址,则第二类型的IP地址为IPv4地址。In this step, if the first type of IP address determined to be preferentially obtained is an IPv4 address, then the second type of IP address is an IPv6 address; if the first type of IP address determined to be preferentially obtained is an IPv6 address, then the second type of IP address The IP address is an IPv4 address.

步骤207、接收网络侧分配的第二类型的IP地址。Step 207, receiving the second type of IP address allocated by the network side.

上述步骤201中,可以通过如下策略确定第一类型的IP地址:In the above step 201, the first type of IP address can be determined by the following strategy:

双栈终端可以向用户提供设置界面由用户设置IPv4地址和IPv6地址中优先获取的地址类型,并将用户设置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或者,The dual-stack terminal can provide the user with a setting interface for the user to set the preferred address type among the IPv4 address and IPv6 address, and determine the preferred address type among the IPv4 address and IPv6 address set by the user as the first type of IP address; or,

由网络侧确定IPv4地址和IPv6地址中优先获取的地址类型,并通过设定通信方式(例如短消息)下发给终端,终端将网络侧配置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或者,The network side determines the preferred address type among the IPv4 address and IPv6 address, and sends it to the terminal by setting the communication method (such as short message), and the terminal uses the preferred address type among the IPv4 address and IPv6 address configured on the network side, determined to be an IP address of the first type; or,

终端在出厂时默认IPv4地址和IPv6地址中的一种为优先获取的地址类型,即第一类型的IP地址。When the terminal leaves the factory, one of the IPv4 address and the IPv6 address is the preferred address type to be obtained by default, that is, the first type of IP address.

根据本发明实施例,优先获取策略可以灵活设置,此处不一一列举。具体在设置时,为了提高优先获取的IP地址访问业务的成功率,可以参考具体的网络环境配置优先获取的IP地址类型,例如,可以根据网络中IPv4业务以及IPv6业务所占的比例决定,在网络向IPv6过渡的初期,业务仍然以IPv4为主,因此,终端可以配置优先获取的IP地址类型为IPv4,而在网络向IPv6过渡的后期,业务可能将以IPv6为主,因此,终端可以配置优先获取的IP地址类型为IPv6。According to the embodiment of the present invention, the priority acquisition policy can be flexibly set, and will not be listed here. Specifically, in setting, in order to improve the success rate of accessing services from IP addresses that are preferentially obtained, you can refer to the specific network environment to configure the type of IP addresses that are preferentially obtained. For example, it can be determined according to the proportion of IPv4 services and IPv6 services in the network. In the early stage of network transition to IPv6, services are still dominated by IPv4. Therefore, terminals can configure the preferred IP address type to be IPv4. In the later stages of network transition to IPv6, services may be dominated by IPv6. Therefore, terminals can configure The preferred IP address type is IPv6.

进一步地,本发明实施例中,还可以对根据上述策略确定的优先获取的地址类型进行调整,具体如下:Further, in the embodiment of the present invention, the priority address type determined according to the above policy may also be adjusted, specifically as follows:

确定根据网络侧分配的第一类型的IP地址(即优先获取的IP地址)进行DNS解析的解析结果中携带的地址与该第一类型的IP地址的匹配率,当该匹配率低于设定阈值(例如50%)时,将第二类型的IP地址确定为优先获取的地址类型。其中:DNS解析的匹配率=DNS解析结果中与终端获取的IP地址类型的匹配次数/业务访问的总次数。Determine the matching rate of the address carried in the resolution result of DNS analysis based on the first type of IP address assigned by the network side (that is, the IP address that is preferentially obtained) and the first type of IP address, when the matching rate is lower than the set When the threshold value (for example, 50%), the IP address of the second type is determined as the address type to be obtained preferentially. Wherein: the matching rate of DNS resolution=the number of matches between the DNS resolution result and the type of IP address obtained by the terminal/the total number of business visits.

本发明又一实施例中,在步骤207接收网络侧分配的第二类型的IP地址之后,还可以进一步对该第二类型的IP地址进行DNS解析,以提高业务访问的成功率,避免由于IP地址不匹配造成的网络资源浪费。具体如图3所示,包括如下步骤:In yet another embodiment of the present invention, after receiving the second type of IP address assigned by the network side in step 207, DNS analysis may be further performed on the second type of IP address to improve the success rate of service access and avoid Waste of network resources caused by address mismatch. Specifically as shown in Figure 3, it includes the following steps:

步骤301、根据网络侧分配的第二类型的IP地址进行DNS解析。Step 301, perform DNS resolution according to the second type of IP address allocated by the network side.

该步骤中,具体DNS解析过程与上述步骤203所述的解析过程基本一致,此处不再详细描述。In this step, the specific DNS resolution process is basically the same as the resolution process described in step 203 above, and will not be described in detail here.

步骤302、判断DNS解析是否成功并且在解析成功时解析结果中携带的地址与第二类型的IP地址是否匹配,若是,执行步骤303,否则执行步骤304。Step 302 , judging whether the DNS resolution is successful and whether the address carried in the resolution result matches the second type of IP address if the resolution is successful, if so, execute step 303 , otherwise execute step 304 .

步骤303、根据解析结果中与网络侧分配的第二类型的IP地址匹配的IP地址访问业务。Step 303, accessing the service according to the IP address in the analysis result that matches the second type of IP address allocated by the network side.

步骤304、提示终端业务无法访问。Step 304, prompting that the terminal service cannot be accessed.

考虑到DNS系统工作方式的不同,在设定情况下,DNS系统会同时返回业务服务器对应的IPv4地址和IPv6地址,或者在DNS解析终端请求访问的业务服务器不支持该终端请求获取的地址类型时,也会返回一个IP地址,该IP地址可能与终端请求DNS返回的地址类型不同,因此,根据本发明实施例,在执行步骤301即对网络侧分配的第二类型的IP地址进行DNS解析之前,进一步执行如下步骤:Considering the different working methods of the DNS system, the DNS system will return the corresponding IPv4 address and IPv6 address of the business server at the same time, or when the business server requested by the DNS analysis terminal does not support the address type requested by the terminal , will also return an IP address, which may be different from the type of address returned by the terminal requesting DNS. Therefore, according to the embodiment of the present invention, before executing step 301, that is, performing DNS resolution on the second type of IP address assigned by the network side , further perform the following steps:

从步骤203即根据第一类型的IP地址进行DNS解析的解析结果中查找与第二类型的IP地址匹配的地址,若查找到,则根据查找到的IP地址访问业务,而不需执行上述步骤301~步骤304,若未查找到,则执行上述步骤301~步骤304。Search for an address that matches the second type of IP address from the resolution result of DNS resolution based on the first type of IP address in step 203, if found, then access the service based on the found IP address without performing the above steps Steps 301 to 304, if not found, execute the above steps 301 to 304.

根据本发明实施例,在执行上述步骤之前,需要进行双栈终端的配置,具体有如下配置方式:According to the embodiment of the present invention, before performing the above steps, it is necessary to configure the dual-stack terminal, specifically as follows:

现有双栈终端中,终端的APN和可以使用的IP地址类型绑定,即IPv4APN和IPv6 APN,没有既可以使用IPv4地址类型又可以使用IPv6地址类型的APN。终端通过IPv4 APN只能进行IPv4地址申请,终端通过IPv6 APN只能进行IPv6地址申请。通过本发明实施例设置双栈APN,使得双栈终端通过双栈APN既可以进行IPv4地址申请又可以进行IPv6地址申请。双栈APN的具体设置方式包括但不限于如下方式:In the existing dual-stack terminal, the APN of the terminal is bound to the available IP address types, that is, IPv4 APN and IPv6 APN. There is no APN that can use both IPv4 address types and IPv6 address types. Terminals can only apply for IPv4 addresses through IPv4 APN, and terminals can only apply for IPv6 addresses through IPv6 APN. The dual-stack APN is set through the embodiment of the present invention, so that the dual-stack terminal can apply for both an IPv4 address and an IPv6 address through the dual-stack APN. The specific setting methods of dual-stack APN include but not limited to the following methods:

方式一、双栈APN可以绑定的新地址类型IPv4v6,当终端通过该类型的APN进行地址获取时,可以申请IPv4地址,也可以申请IPv6地址。Method 1: A new address type IPv4v6 that can be bound to a dual-stack APN. When a terminal obtains an address through this type of APN, it can apply for an IPv4 address or an IPv6 address.

方式二、不将APN和具体地址类型进行绑定,无论终端申请哪种类型的地址,都可以通过该APN。Method 2: The APN is not bound to a specific address type, and no matter which type of address the terminal applies for, it can pass through the APN.

为了更好地理解本发明实施例,以下以访问PS域业务为例,对本发明实施例上述技术方案进行更为详尽的描述:In order to better understand the embodiment of the present invention, the above technical solution of the embodiment of the present invention is described in more detail below by taking access to PS domain services as an example:

假设确定的优先获取的地址类型(即第一类型的IP地址)为IPv4,如图4所示,获取IP地址以及访问业务具体执行如下步骤:Assuming that the determined preferred address type (i.e. the first type of IP address) is IPv4, as shown in Figure 4, the following steps are specifically performed for obtaining the IP address and accessing the service:

步骤401、双栈终端通过双栈APN激活PS域业务,指定PDP类型为IPv4,向网络侧发送PDP上下文激活请求。Step 401, the dual-stack terminal activates PS domain services through the dual-stack APN, specifies the PDP type as IPv4, and sends a PDP context activation request to the network side.

步骤402、接收网络侧在对该双栈终端鉴权通过后反馈的PDP上下文,该PDP上下文中携带网络侧为该终端分配的IPv4地址。Step 402: Receive the PDP context fed back by the network side after the dual-stack terminal passes the authentication, and the PDP context carries the IPv4 address allocated by the network side for the terminal.

步骤403、从接收的PDP上下文中获取IPv4地址,并根据该IPv4地址进行DNS解析。Step 403, obtain the IPv4 address from the received PDP context, and perform DNS resolution according to the IPv4 address.

步骤404、判断解析是否成功并且在解析成功时解析结果中携带的地址与IPv4地址是否匹配,若是,执行步骤405,否则执行步骤406。Step 404 , judging whether the parsing is successful and whether the address carried in the parsing result matches the IPv4 address if the parsing is successful, if yes, go to step 405 , otherwise go to step 406 .

步骤405、通过解析结果中与获取的IPv4地址匹配的IP地址访问业务。Step 405, accessing the service through the IP address matching the obtained IPv4 address in the analysis result.

步骤406、双栈终端通过双栈APN激活PS域业务,指定PDP类型为IPv6,向网络侧发送PDP上下文激活请求。Step 406, the dual-stack terminal activates the PS domain service through the dual-stack APN, specifies the PDP type as IPv6, and sends a PDP context activation request to the network side.

步骤407、接收网络侧在对该双栈终端鉴权通过后反馈的PDP上下文,该PDP上下文中携带网络侧为该终端分配的IPv6地址前缀。Step 407: Receive the PDP context fed back by the network side after the dual-stack terminal passes the authentication, and the PDP context carries the IPv6 address prefix allocated by the network side for the terminal.

步骤408、从根据IPv4地址进行DNS解析的解析结果中查找是否有IPv6地址。Step 408: Find whether there is an IPv6 address from the result of DNS resolution based on the IPv4 address.

步骤409、判断是否查找到IPv6地址,若是,则执行步骤410,否则执行步骤411。Step 409 , judging whether an IPv6 address is found, if yes, execute step 410 , otherwise execute step 411 .

步骤410、通过查找到的IPv6地址访问业务。Step 410, accessing the service through the found IPv6 address.

步骤411、从接收的PDP上下文中获取IPv6地址,并根据该IPv6地址进行DNS解析。Step 411, obtain the IPv6 address from the received PDP context, and perform DNS resolution according to the IPv6 address.

步骤412、判断解析是否成功并且在解析成功时解析结果中携带的地址与IPv4地址是否匹配,若是,执行步骤413,否则执行步骤414。Step 412 , judging whether the parsing is successful and whether the address carried in the parsing result matches the IPv4 address if the parsing is successful, if so, go to step 413 , otherwise go to step 414 .

步骤413、通过解析结果中与获取的IPv6地址匹配的地址访问业务。Step 413, accessing the service through the address matching the obtained IPv6 address in the analysis result.

步骤414、业务访问失败。Step 414, service access fails.

与上述流程对应,本发明实施例还提供了一种IP地址获取装置,如图5所示,该装置包括:Corresponding to the above process, the embodiment of the present invention also provides an IP address acquisition device, as shown in Figure 5, the device includes:

第一通信单元501、DNS解析单元502以及第二通信单元503;其中:The first communication unit 501, the DNS resolution unit 502, and the second communication unit 503; wherein:

第一通信单元501,用于请求网络侧分配第一类型的互联网协议IP地址,并接收网络侧分配的第一类型的IP地址;The first communication unit 501 is configured to request the network side to allocate a first type of Internet Protocol IP address, and receive the first type of IP address allocated by the network side;

DNS解析单元502,用于根据第一通信单元接收的第一类型的IP地址进行域名服务器DNS解析;A DNS resolution unit 502, configured to perform domain name server DNS resolution according to the first type of IP address received by the first communication unit;

第二通信单元503,用于在DNS解析单元502解析失败后或在DNS解析成功且解析结果中携带的地址与第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。The second communication unit 503 is configured to request the network side to allocate a second type of IP address after the DNS resolution unit 502 fails to resolve or when the DNS resolution is successful and the address carried in the resolution result does not match the first type of IP address.

进一步地,如图6所示,本发明实施例提供的装置还可以包括:Further, as shown in FIG. 6, the device provided by the embodiment of the present invention may further include:

优先获取IP地址确定单元504,用于在请求网络侧分配第一类型的IP地址之前,将用户设置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或,将网络侧通过设定通信方式配置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或,将默认的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址。The preferentially obtained IP address determining unit 504 is configured to determine the preferentially obtained address type among the IPv4 address and IPv6 address set by the user as the first type of IP address before requesting the network side to allocate the first type of IP address; or, Determining the preferred address type among the IPv4 address and IPv6 address configured on the network side by setting the communication mode as the first type of IP address; or, determining the preferred address type among the default IPv4 address and IPv6 address as The first type of IP address.

更具体地,上述优先获取IP地址确定单元504,还用于:More specifically, the above-mentioned priority acquisition IP address determination unit 504 is also used to:

确定根据网络侧分配的第一类型的IP地址进行DNS解析的解析结果中携带的地址与第一类型的IP地址的匹配率,当该匹配率低于设定阈值时,将第二类型的IP地址确定为优先获取的地址类型。Determine the matching rate of the address carried in the resolution result of DNS analysis based on the first type of IP address allocated by the network side and the first type of IP address, and when the matching rate is lower than the set threshold, the second type of IP address The address is determined to be the type of address to be obtained first.

进一步地,如图7所示,本发明实施例提供的装置还可以包括:业务访问单元505;其中:Further, as shown in FIG. 7, the device provided by the embodiment of the present invention may further include: a service access unit 505; wherein:

DNS解析单元502还用于:接收网络侧分配的第二类型的IP地址后,根据网络侧分配的第二类型的IP地址进行DNS解析;或,接收网络侧分配的第二类型的IP地址后,从根据第一类型的IP地址进行DNS解析的解析结果中查找与第二类型的IP地址匹配的地址,若未查找到,根据网络侧分配的第二类型的IP地址进行DNS解析;The DNS resolution unit 502 is also used for: after receiving the second type of IP address assigned by the network side, perform DNS resolution according to the second type of IP address assigned by the network side; or, after receiving the second type of IP address assigned by the network side , searching for an address matching the second type of IP address from the result of DNS resolution based on the first type of IP address, if not found, performing DNS resolution according to the second type of IP address assigned by the network side;

业务访问单元505,用于在DNS解析单元505解析成功并且解析结果中携带的地址与第二类型的IP地址匹配时,根据解析结果中与第二类型的IP地址匹配的地址访问业务;或从根据第一类型的IP地址进行DNS解析的解析结果中查找到与第二类型的IP地址匹配的地址时,根据查找到的IP地址访问业务。The service access unit 505 is configured to access the service according to the address matching the second type of IP address in the resolution result when the DNS resolution unit 505 resolves successfully and the address carried in the resolution result matches the second type of IP address; or from When an address matching the second type of IP address is found in the result of DNS resolution based on the first type of IP address, the service is accessed according to the found IP address.

应当理解,该实施例提供的IP地址获取装置所实现的功能与上述实施例提供的获取IP的方法流程一一对应,对于该装置各个功能单元所实现的更为详细的处理流程,在上述方法实施例中已做详细描述,此处不再详细描述。It should be understood that the functions implemented by the device for obtaining an IP address provided in this embodiment correspond one-to-one to the flow of the method for obtaining an IP provided in the above embodiment. For the more detailed processing flow implemented by each functional unit of the device, in the above method It has been described in detail in the embodiments, and will not be described in detail here.

与上述流程对应,本发明实施例还提供了一种IP地址获取系统,如图8所示,该系统包括:Corresponding to the above process, the embodiment of the present invention also provides an IP address acquisition system, as shown in Figure 8, the system includes:

IP地址分配服务器801以及终端802;其中:IP address assignment server 801 and terminal 802; Wherein:

IP地址分配服务器801,用于接收终端的IP地址分配请求,并根据该请求中指定的IP地址类型分配相应类型的IP地址;The IP address assignment server 801 is configured to receive the IP address assignment request of the terminal, and assign a corresponding type of IP address according to the IP address type specified in the request;

终端802,用于请求IP地址分配服务器801分配第一类型的IP地址,并根据IP地址分配服务器801分配的第一类型的IP地址进行DNS解析;以及,在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与第一类型的IP地址不匹配时,请求IP地址分配服务器801分配第二类型的IP地址。The terminal 802 is used to request the IP address allocation server 801 to allocate the first type of IP address, and perform DNS analysis according to the first type of IP address allocated by the IP address allocation server 801; and, after the DNS analysis fails or after the DNS analysis succeeds And when the address carried in the analysis result does not match the IP address of the first type, request the IP address allocation server 801 to allocate the IP address of the second type.

进一步地,本发明实施例中,上述终端802还用于:Further, in the embodiment of the present invention, the above-mentioned terminal 802 is also used for:

在请求IP地址分配服务器801分配第一类型的IP地址之前,将用户设置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或,将网络侧设备通过设定通信方式配置的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址;或,将默认的IPv4地址和IPv6地址中优先获取的地址类型,确定为第一类型的IP地址。Before requesting the IP address allocation server 801 to allocate the first type of IP address, determine the preferred address type among the IPv4 address and IPv6 address set by the user as the first type of IP address; The preferred address type among the IPv4 address and IPv6 address configured in the communication mode is determined as the first type of IP address; or, the preferred address type among the default IPv4 address and IPv6 address is determined as the first type of IP address .

进一步地,本发明实施例中,上述终端802还用于:Further, in the embodiment of the present invention, the above-mentioned terminal 802 is also used for:

确定根据IP地址分配服务器801分配的第一类型的IP地址进行DNS解析的解析结果中携带的地址与所述第一类型的IP地址的匹配率,当该匹配率低于设定阈值时,将第二类型的IP地址确定为优先获取的地址类型。Determine the matching rate of the address carried in the DNS analysis result of the first type of IP address assigned by the IP address allocation server 801 and the first type of IP address, and when the matching rate is lower than the set threshold, the The IP address of the second type is determined as the address type to be obtained preferentially.

进一步地,本发明实施例中,上述终端802还用于:Further, in the embodiment of the present invention, the above-mentioned terminal 802 is also used for:

在请求IP地址分配服务器801分配第二类型的IP地址之后,根据IP地址分配服务器801分配的第二类型的IP地址进行DNS解析,在解析成功后并且解析结果中携带的地址与第二类型的IP地址匹配时,根据解析结果中与第二类型的IP地址匹配的地址访问业务;或,After requesting the IP address allocation server 801 to allocate the second type of IP address, DNS resolution is performed according to the second type of IP address allocated by the IP address allocation server 801, after the resolution is successful and the address carried in the resolution result is the same as the second type of IP address When the IP address matches, access the service according to the address matching the second type of IP address in the analysis result; or,

在请求IP地址分配服务器801分配第二类型的IP地址之后,从根据第一类型的IP地址进行DNS解析的解析结果中查找与第二类型的IP地址匹配的地址,若查找到,则根据查找到的IP地址访问业务,否则,根据IP地址分配服务器801分配的第二类型的IP地址进行DNS解析,并在解析成功并且解析结果中携带的地址与第二类型的IP地址匹配时,根据解析结果中与第二类型的IP地址匹配的地址访问业务。After requesting the IP address allocation server 801 to allocate the second type of IP address, search for an address matching the second type of IP address from the resolution results of DNS analysis based on the first type of IP address, if found, then according to the search Otherwise, DNS resolution is performed according to the second type of IP address assigned by the IP address assignment server 801, and when the resolution is successful and the address carried in the resolution result matches the second type of IP address, according to the resolution Addresses matching the IP addresses of the second type in the result access services.

实际应用中,上述IP地址分配服务器801可以为GGSN,或PDN Gateway(Packet Data Network Gateway分组数据网络网关)。In practical applications, the above-mentioned IP address assignment server 801 may be a GGSN, or a PDN Gateway (Packet Data Network Gateway).

通过本发明实施例提供的上述至少一个技术方案,终端首先请求网络侧分配第一类型的互联网协议IP地址,根据网络侧分配的第一类型的IP地址进行DNS解析,并在DNS解析失败后或在DNS解析成功且解析结果中携带的地址与第一类型的IP地址不匹配时,请求网络侧分配第二类型的IP地址。根据本发明实施例提供的技术方案,当DNS解析失败或确定终端获取的IP地址类型与其访问业务对应的地址类型不匹配时,进一步获取第二类型的IP地址,从而避免了由于终端获取的IP地址类型与其访问业务对应的地址类型不匹配而导致的业务访问失败问题,提高了双栈终端访问业务的成功率。Through at least one of the above technical solutions provided by the embodiments of the present invention, the terminal first requests the network side to allocate a first type of Internet protocol IP address, performs DNS resolution according to the first type of IP address allocated by the network side, and after DNS resolution fails or When the DNS resolution is successful and the address carried in the resolution result does not match the IP address of the first type, the network side is requested to allocate the IP address of the second type. According to the technical solution provided by the embodiment of the present invention, when the DNS resolution fails or it is determined that the type of IP address obtained by the terminal does not match the type of address corresponding to the access service, the second type of IP address is further obtained, thereby avoiding the The problem of service access failure caused by the mismatch between the address type and the address type corresponding to the access service improves the success rate of dual-stack terminal access services.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (6)

1. An IP address acquisition method, comprising:
requesting a network side to distribute a first type of Internet Protocol (IP) address, and performing Domain Name Server (DNS) resolution according to the first type of IP address distributed by the network side;
requesting a network side to allocate an IP address of a second type after DNS analysis fails or when DNS analysis succeeds and an address carried in an analysis result is not matched with the IP address of the first type;
before requesting the network side to allocate the first type of IP address, the method further includes:
determining the address type which is preferentially acquired from the IPv4 address and the IPv6 address set by the user as an IP address of a first type; or,
determining an address type preferentially acquired from an IPv4 address and an IPv6 address configured by a network side through a set communication mode as an IP address of a first type; or,
determining the address type preferentially acquired from the default IPv4 address and the IPv6 address as an IP address of a first type;
the method further comprises the following steps:
determining the matching rate of an address carried in an analysis result of performing DNS analysis according to a first type of IP address distributed by a network side and the first type of IP address, and determining the second type of IP address as the address type acquired preferentially when the matching rate is lower than a set threshold value.
2. The method of claim 1, wherein after requesting the network side to assign the second type of IP address, further comprising:
performing DNS analysis according to a second type of IP address distributed by a network side, and accessing service according to an address matched with the second type of IP address in an analysis result when the analysis is successful and an address carried in the analysis result is matched with the second type of IP address; or,
searching an address matched with the second type of IP address from an analysis result of DNS analysis according to the first type of IP address, if the address is searched, accessing the service according to the searched IP address, otherwise, performing DNS analysis according to the second type of IP address distributed by the network side, and accessing the service according to the address matched with the second type of IP address in the analysis result when the analysis is successful and the address carried in the analysis result is matched with the second type of IP address.
3. An IP address acquisition apparatus, comprising:
the first communication unit is used for requesting the network side to distribute the first type of Internet protocol IP address and receiving the first type of IP address distributed by the network side;
the DNS analysis unit is used for carrying out domain name server DNS analysis according to the IP address of the first type received by the first communication unit;
the second communication unit is used for requesting the network side to allocate the IP address of the second type after the DNS analysis unit fails to analyze or when the DNS analysis is successful and the address carried in the analysis result is not matched with the IP address of the first type;
further comprising:
a priority acquisition IP address determining unit, configured to determine, as a first type IP address, an address type that is acquired preferentially from an IPv4 address and an IPv6 address set by a user before requesting a network side to allocate the first type IP address; or, the address type preferentially acquired from the IPv4 address and the IPv6 address configured by the network side through the set communication mode is determined as the IP address of the first type; or, determining the address type preferentially acquired from the default IPv4 address and the IPv6 address as the IP address of the first type;
the preferentially-acquiring IP address determining unit is further configured to:
determining the matching rate of an address carried in an analysis result of performing DNS analysis according to a first type of IP address distributed by a network side and the first type of IP address, and determining the second type of IP address as the address type acquired preferentially when the matching rate is lower than a set threshold value.
4. The apparatus of claim 3,
the DNS resolution unit is further configured to: after receiving the second type of IP address distributed by the network side, performing DNS analysis according to the second type of IP address distributed by the network side; or after receiving the second type of IP address distributed by the network side, searching an address matched with the second type of IP address from a resolution result of performing DNS resolution according to the first type of IP address, and if the address is not searched, performing DNS resolution according to the second type of IP address distributed by the network side;
the device further comprises: the service access unit is used for accessing services according to the address matched with the IP address of the second type in the resolution result when the DNS resolution unit successfully resolves the IP address of the second type and the address carried in the resolution result is matched with the IP address of the second type; or when the address matched with the IP address of the second type is found in the resolution result of the DNS resolution according to the IP address of the first type, accessing the service according to the found IP address.
5. An IP address acquisition system, comprising:
the IP address allocation server is used for receiving an Internet protocol IP address allocation request of the terminal and allocating IP addresses of corresponding types according to the IP address type appointed in the request;
the terminal is used for requesting the IP address allocation server to allocate the IP address of the first type and carrying out domain name server DNS analysis according to the IP address of the first type allocated by the IP address allocation server; and requesting the IP address allocation server to allocate a second type of IP address after DNS resolution fails or when DNS resolution succeeds and an address carried in a resolution result is not matched with the first type of IP address;
the terminal is further configured to:
before requesting the IP address distribution server to distribute the first type of IP address, determining the address type which is preferentially obtained from the IPv4 address and the IPv6 address set by the user as the first type of IP address; or, the address type preferentially acquired from the IPv4 address and the IPv6 address configured by the network side device through the set communication mode is determined as the IP address of the first type; or, determining the address type preferentially acquired from the default IPv4 address and the IPv6 address as the IP address of the first type;
the terminal is further configured to:
determining a matching rate of an address carried in an analysis result of performing DNS analysis according to the first type of IP address allocated by the IP address allocation server and the first type of IP address, and determining the second type of IP address as a preferentially acquired address type when the matching rate is lower than a set threshold value.
6. The system of claim 5, wherein the terminal is further configured to:
after requesting the IP address allocation server to allocate a second type of IP address, performing DNS analysis according to the second type of IP address allocated by the IP address allocation server, and when the analysis is successful and an address carried in an analysis result is matched with the second type of IP address, accessing a service according to the address matched with the second type of IP address in the analysis result; or,
after requesting the IP address allocation server to allocate a second type of IP address, searching an address matched with the second type of IP address from an analysis result of performing DNS analysis according to the first type of IP address, if so, accessing a service according to the searched IP address, otherwise, performing DNS analysis according to the second type of IP address allocated by the IP address allocation server, and accessing the service according to the address matched with the second type of IP address in the analysis result when the analysis is successful and the address carried in the analysis result is matched with the second type of IP address.
CN200910093692.8A 2009-09-27 2009-09-27 Method, device and system for acquiring IP address Active CN102036422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910093692.8A CN102036422B (en) 2009-09-27 2009-09-27 Method, device and system for acquiring IP address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910093692.8A CN102036422B (en) 2009-09-27 2009-09-27 Method, device and system for acquiring IP address

Publications (2)

Publication Number Publication Date
CN102036422A CN102036422A (en) 2011-04-27
CN102036422B true CN102036422B (en) 2014-09-17

Family

ID=43888530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910093692.8A Active CN102036422B (en) 2009-09-27 2009-09-27 Method, device and system for acquiring IP address

Country Status (1)

Country Link
CN (1) CN102036422B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790808B (en) * 2011-05-16 2015-11-25 北京奇虎科技有限公司 A kind of domain name analytic method and system, a kind of client
CN103812955B (en) * 2012-11-12 2018-04-03 中国移动通信集团公司 A kind of terminal obtains method, terminal and the system of management platform address
CN102984294A (en) * 2012-12-07 2013-03-20 中兴通讯股份有限公司 IPv6 DNS address distribution and acquisition method and device
CN104660398B (en) * 2015-01-28 2018-02-13 北京深思数盾科技股份有限公司 A kind of generation method of encryption key
CN109802959A (en) * 2019-01-07 2019-05-24 烽火通信科技股份有限公司 Internet protocol selection method and system under double stack environment
CN110191031B (en) * 2019-05-10 2021-06-29 杭州迪普科技股份有限公司 Network resource access method and device and electronic equipment
CN111417163B (en) * 2020-03-27 2022-05-20 Oppo广东移动通信有限公司 IP address recovery method, terminal and storage medium
CN114143230B (en) * 2020-09-02 2023-07-21 中国移动通信集团安徽有限公司 Method and device for calculating DNS resolution duration of dual-stack users
CN112153753B (en) * 2020-09-24 2022-09-16 维沃移动通信有限公司 Network connection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578296A (en) * 2003-07-29 2005-02-09 华为技术有限公司 Method for realizing double-stack transition
CN1773988A (en) * 2004-11-10 2006-05-17 华为技术有限公司 A communication method between serving general packet radio service support nodes
CN101534496A (en) * 2008-03-12 2009-09-16 中兴通讯股份有限公司 Method for obtaining home link information by user

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075138A1 (en) * 2004-09-28 2006-04-06 Utstarcom, Inc. Method and apparatus to facilitate IPv6 DNS requests

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578296A (en) * 2003-07-29 2005-02-09 华为技术有限公司 Method for realizing double-stack transition
CN1773988A (en) * 2004-11-10 2006-05-17 华为技术有限公司 A communication method between serving general packet radio service support nodes
CN101534496A (en) * 2008-03-12 2009-09-16 中兴通讯股份有限公司 Method for obtaining home link information by user

Also Published As

Publication number Publication date
CN102036422A (en) 2011-04-27

Similar Documents

Publication Publication Date Title
CN102036422B (en) Method, device and system for acquiring IP address
CN110677405B (en) Data processing method and device, electronic equipment and storage medium
CN102148878B (en) IP (internet protocol) address allocation method, system and device
US8161135B2 (en) Device identification number based name service
CN103229488B (en) IPv6 address source tracing method, device and system
WO2010069181A1 (en) Method and system for configuring ipv6 address
CN110995886B (en) Network address management method, device, electronic equipment and medium
CN102833732A (en) IPv6 (Internet Protocol Version 6) address stateless autoconfiguration system, data card and implementation method thereof
CN101841573A (en) Method and device for processing address information of Internet and Internet system
CN101997934A (en) Method and system for accessing addresses, mobile terminal and application method thereof
CN110225144A (en) Obtain and provide method, user equipment and the management server of service
WO2014086167A1 (en) Mobile terminal and address allocation method and system thereof
US7958220B2 (en) Apparatus, method and system for acquiring IPV6 address
CN103037442A (en) Method and system for achieving flow separation scheduling
CN102299974B (en) A kind of method and apparatus realizing IPv6 prefix assignment
WO2011147343A1 (en) Method, device and system for address assignment in internet protocol (ip) networks
EP2472788A1 (en) Method and system for implementing id/locator mapping
US8761046B2 (en) Communication system and method
CN104506665B (en) Distinguish method and system in a kind of IPv4/IPv6 addresses
CN106878479B (en) Address allocation method and device
CN102148882A (en) Dynamic domain name analytic method and system after deployment of NAT
CN1921496B (en) A method for DHCP client to identify DHCP server
JP2004015795A (en) IPv4 management method and management device in IPv6 wireless LAN environment
CN113037882B (en) Method for acquiring additional information of host and proxy equipment
CN104468575A (en) Method and device for achieving domain name registration in local area network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant