Method and device for acquiring local service and generating link local address

文档序号:1641604 发布日期:2019-12-20 浏览:30次 中文

阅读说明:本技术 一种获取本地服务、生成链路本地地址的方法及装置 (Method and device for acquiring local service and generating link local address ) 是由 张千里 李星 王继龙 包丛笑 于 2019-09-20 设计创作,主要内容包括:本申请实施例提供一种获取本地服务、生成链路本地地址的方法及装置,应用于用户设备,所述方法包括:在所述用户设备接入IPv6网络后,确定是否接收到路由器通告报文,其中,所述路由器通告报文中携带有用于指示本地服务入口的统一资源标识符URI;若没有接收到所述路由器通告报文,获取目标本地服务对应的链路本地地址,其中,所述链路本地地址中嵌入有目标本地服务对应的服务描述信息;基于所述链路本地地址,获取所述目标本地服务。如此,通过链路本地地址来获取本地服务,能够实现不依赖于DNS服务器、DHCP服务器等其它服务器,只需接入IPv6网络即可获取到所需的目标本地服务。(The embodiment of the application provides a method and a device for acquiring local service and generating a link local address, which are applied to user equipment, wherein the method comprises the following steps: after the user equipment accesses an IPv6 network, determining whether a router advertisement message is received or not, wherein the router advertisement message carries a Uniform Resource Identifier (URI) for indicating a local service entrance; if the router advertisement message is not received, acquiring a link local address corresponding to a target local service, wherein service description information corresponding to the target local service is embedded in the link local address; and acquiring the target local service based on the link local address. In this way, the local service is acquired through the link local address, and the required target local service can be acquired only by accessing the IPv6 network without depending on other servers such as a DNS server and a DHCP server.)

1. A method for acquiring local services, applied to a user equipment, the method comprising:

after the user equipment accesses an IPv6 network of version 6 of the Internet protocol, determining whether a router advertisement message is received, wherein the router advertisement message carries a Uniform Resource Identifier (URI) for indicating a local service entrance;

if the router advertisement message is not received, acquiring a link local address corresponding to a target local service, wherein service description information corresponding to the target local service is embedded in the link local address;

and acquiring the target local service based on the link local address.

2. The method of claim 1, wherein the obtaining the link local address corresponding to the target local service comprises:

obtaining an IPv6 address corresponding to the user equipment and service description information corresponding to the target local service, wherein the service description information comprises: service identification and communication protocol;

and embedding the service description information into the last 64 bits of the IPv6 address to generate the link local address.

3. The method of claim 2, wherein the embedding the service description information into the last 64 bits of the IPv6 address to generate the link-local address comprises:

encoding the service description information to obtain an interface identifier of the link local address;

and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address.

4. The method of claim 3, wherein said encoding the service description information to obtain the interface identifier of the link local address comprises:

coding the service identification to obtain 24 bits of coding information corresponding to the service identification;

coding the communication protocol to obtain 24 bits of coding information corresponding to the communication protocol;

and splicing the 24-bit coding information corresponding to the service identifier, the 24-bit coding information corresponding to the communication protocol and the preset 16-bit coding information to obtain the interface identifier of the link local address.

5. The method of claim 2, wherein the obtaining the target local service based on the link local address comprises:

and accessing the link local address through the communication protocol to acquire the target local service corresponding to the service identifier.

6. The method of claim 1, wherein after said determining whether a router advertisement message is received, the method further comprises:

if the router advertisement message is received, analyzing the router advertisement message to obtain the URI;

accessing a home service homepage for providing a home service based on the URI;

and acquiring the target local service from the local service homepage.

7. The method of claim 6, wherein the local service home page comprises: one or more of a local Domain Name System (DNS) service, a local Network Time Protocol (NTP) service, a local network authentication service, a local network troubleshooting service, a local geographic information service, a local emergency communication service, a local business service, a local network charging service.

8. A method for generating a link local address, applied to a user equipment, the method comprising:

after the user equipment accesses an internet protocol version 6 IPv6 network, obtaining an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service, wherein the service description information includes: service identification and communication protocol;

embedding the service description information into the last 64 bits of the IPv6 address, generating the link-local address of any one of claims 1-5.

9. The method according to claim 8, wherein said embedding the service description information into the last 64 bits of the IPv6 address, generating the link-local address according to any one of claims 1 to 5, comprises:

encoding the service description information to obtain an interface identifier of the link local address;

and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address.

10. The method of claim 9, wherein said encoding the service description information to obtain the interface identifier of the link local address comprises:

coding the service identification to obtain 24 bits of coding information corresponding to the service identification;

coding the communication protocol to obtain 24 bits of coding information corresponding to the communication protocol;

and splicing the 24-bit coding information corresponding to the service identifier, the 24-bit coding information corresponding to the communication protocol and the preset 16-bit coding information to obtain the interface identifier of the link local address.

11. An apparatus for acquiring local services, applied to a user equipment, the apparatus comprising:

a determining unit, configured to determine whether a router advertisement message is received after the user equipment accesses an internet protocol version 6 IPv6 network, where the router advertisement message carries a uniform resource identifier URI used for indicating a local service entry;

a first obtaining unit, configured to obtain a link local address corresponding to a target local service if the determining unit determines that the router advertisement packet is not received, where service description information corresponding to the target local service is embedded in the link local address;

a second obtaining unit, configured to obtain the target local service based on the link local address.

12. An apparatus for generating a link local address, applied to a user equipment, the apparatus comprising:

an obtaining unit, configured to obtain, after the ue accesses an IPv6 network of version 6 of an internet protocol, an IPv6 address corresponding to the ue and service description information corresponding to a target local service, where the service description information includes: service identification and communication protocol;

a generating unit, configured to embed the service description information into the last 64 bits of the IPv6 address, and generate the link local address according to any one of claims 1 to 5.

13. A computer-readable storage medium, characterized in that the storage medium comprises a stored program, wherein the program, when executed, controls a user equipment on which the storage medium is located to execute the steps of the method for acquiring local service according to any one of claims 1 to 7 or the method for generating link local address according to any one of claims 8 to 10.

14. A user equipment, the user equipment comprising:

at least one processor;

and at least one memory, bus connected with the processor;

the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the steps of the method of acquiring local services according to any one of claims 1 to 7 or the method of generating link local addresses according to any one of claims 8 to 10.

Technical Field

The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for acquiring a local service and generating a link local address.

Background

In recent years, more and more people frequently go and go around in various places due to the needs of life and work, however, local services such as local time service, local emergency communication service, local network authentication service, local geographic information service and the like are changed along with the different geographic positions of users.

At present, local services are mainly obtained through a DHCP (Dynamic Host Configuration Protocol) or a DNS (Domain Name System), but because these embodiments rely on other services such as a DNS server and a DHCP server, the architecture is complex and not easy to deploy, so that the support of the user equipment is poor, and a problem that the user equipment cannot obtain corresponding local services after accessing an IPv6(Internet Protocol Version 6, Version 6 of the Internet Protocol) network in a certain place often occurs.

Disclosure of Invention

In view of this, embodiments of the present application provide a method and an apparatus for acquiring a local service and generating a link local address, where the local service is acquired through the link local address, and the required target local service can be acquired only by accessing an IPv6 network without depending on other servers such as a DNS server and a DHCP server.

The embodiment of the application mainly provides the following technical scheme:

in a first aspect, an embodiment of the present application provides a method for acquiring a local service, which is applied to a user equipment, and the method includes: after the user equipment accesses an IPv6 network, determining whether a router advertisement message is received or not, wherein the router advertisement message carries a Uniform Resource Identifier (URI) for indicating a local service entrance; if the router advertisement message is not received, acquiring a link local address corresponding to a target local service, wherein service description information corresponding to the target local service is embedded in the link local address; and acquiring the target local service based on the link local address.

In a second aspect, an embodiment of the present application provides a method for generating a link local address, which is applied to a user equipment, and the method includes: after the user equipment accesses an IPv6 network, obtaining an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service, wherein the service description information comprises: service identification and communication protocol; and embedding the service description information into the last 64 bits of the IPv6 address to generate the link local address in the method for acquiring the local service.

In a third aspect, an embodiment of the present application provides an apparatus for acquiring a local service, which is applied to a user equipment, and the apparatus includes: a determining unit, configured to determine whether a router advertisement message is received after the user equipment accesses an internet protocol version 6 IPv6 network, where the router advertisement message carries a uniform resource identifier URI used for indicating a local service entry; a first obtaining unit, configured to obtain a link local address corresponding to a target local service if the determining unit determines that the router advertisement packet is not received, where service description information corresponding to the target local service is embedded in the link local address; a second obtaining unit, configured to obtain the target local service based on the link local address.

In a fourth aspect, an embodiment of the present application provides an apparatus for generating a link local address, which is applied to a user equipment, and the apparatus includes: an obtaining unit, configured to obtain, after the user equipment accesses an IPv6 network, an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service, where the service description information includes: service identification and communication protocol; a generating unit, configured to embed the service description information into the last 64 bits of the IPv6 address, and generate the link local address in the above method for acquiring a local service.

In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, where the storage medium includes a stored program, and when the program runs, the user equipment where the storage medium is located is controlled to execute the above method for acquiring a local service or the above steps of the method for generating a link local address.

In a sixth aspect, an embodiment of the present application provides a user equipment, where the user equipment includes: at least one processor; and at least one memory, bus connected with the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform the above-described method of obtaining local services or the above-described steps of the method of generating link local addresses.

According to the method and the device for acquiring the local service and generating the link local address, after the user equipment accesses the IPv6 network, the user equipment determines whether a router advertisement message is received, wherein the router advertisement message carries a Uniform Resource Identifier (URI) for indicating a local service entrance; if the user equipment determines that the router advertisement message is not received, the user equipment acquires a link local address corresponding to the target local service, wherein service description information corresponding to the target local service is embedded in the link local address; finally, a target local service is acquired based on the link local address. Therefore, the local service is acquired through the link local address carrying the service description information of the local service, dependence on other servers such as a DNS (domain name system) server and a DHCP (dynamic host configuration protocol) server can be effectively avoided, the required target local service can be acquired only by accessing an IPv6 network, the system structure is simple, and deployment is convenient.

Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. Other advantages of the application may be realized and attained by the instrumentalities and combinations particularly pointed out in the specification, claims, and drawings.

Drawings

The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.

Fig. 1 is a first schematic flowchart of a method for acquiring a local service in an embodiment of the present application;

fig. 2 is a first schematic diagram of a link local address in an embodiment of the present application;

fig. 3 is a diagram illustrating a link local address according to an embodiment of the present application;

fig. 4 is a flowchart illustrating a second method for acquiring local services in the embodiment of the present application;

fig. 5 is a flowchart illustrating a method of generating a link local address in an embodiment of the present application;

fig. 6 is a schematic structural diagram of an apparatus for acquiring a local service in an embodiment of the present application;

fig. 7 is a schematic structural diagram of an apparatus for generating a link local address in an embodiment of the present application;

fig. 8 is a schematic structural diagram of a user equipment in an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.

The embodiment of the application provides a method for acquiring local services. In practical application, the method for acquiring the local service is applied to the user equipment. Fig. 1 is a first schematic flowchart of a method for acquiring a local service in an embodiment of the present application, and referring to fig. 1, the method for acquiring a local service may include:

s101: after user equipment accesses an IPv6 network, determining whether a router advertisement message is received or not;

the router advertisement message carries a uniform resource identifier URI for indicating a local service entry.

Specifically, if the user equipment determines that it does not receive a router advertisement message issued by the router, S102 to S103 are executed.

S102: acquiring a link local address corresponding to a target local service;

the link local address is embedded with service description information corresponding to the target local service.

Here, the service description information may include: service identification and communication protocol.

In practical applications, the service identifier is an identifier used for characterizing a local service. Specifically, the service identifier may be a character string identifier, may also be a number identifier, and of course, may also be other identifiers capable of uniquely identifying the local service. Here, the embodiment of the present application is not particularly limited.

For example, taking the FIRE alarm service in the local emergency communication service as an example, the service identifier corresponding to the FIRE alarm service may be set to "FIRE" or "119". Of course, other arrangements are possible.

In practical applications, the communication protocol refers to communication, an ingress port, a resolution protocol, and the like, which the user equipment needs to follow to access the local service.

Illustratively, taking the fire alarm service in the local emergency communication service as an example, assuming that the fire alarm service is implemented by using a WWW (World Wide Web) Web page, a communication Protocol of the fire alarm service may be defined as "TCP _ WWW _ XML", where the communication Protocol "TCP _ WWW _ XML" refers to accessing the WWW service of the 80 port by using a TCP (Transmission control Protocol) technology and a HTTP (HyperText Transfer Protocol) technology, and the obtained content is an XML (Extensible Markup Language) document.

In practical application, as shown in fig. 2, the IPv6 protocol specifies that the IPv6 address has 128 bits and can be divided into two parts: the subnet prefix (subnet prefix) of the first 64 bits used for network routing and the Interface identifier (Interface Id, IID) of the last 64 bits used for addressing in the subnet. Generally, when IPv6 networking is performed, a user equipment is allocated layer by layer through an operator, a local Internet Registry (RIR), an Internet Assigned Numbers Authority (IANA), and The like, and an interface identifier generation scheme is unique to IPv6, and an interface identifier may be generated by a user equipment in a stateless generation manner or a DHCP server in a stateful generation manner. Then, when the network is oriented to the IPv6 network, in order to avoid relying on other servers such as a DHCP server and a DNS server, the user equipment may encode service description information corresponding to the local service into the IPv6 address in a stateless generation manner to generate the link local address, so that since the service description information is directly encoded into the last 64 bits of the link local address, after the user equipment acquires the link local address, the user equipment may acquire the local service corresponding to the service description information by accessing the link local address.

How to obtain the link local address corresponding to the target local service is described in the following with specific examples.

In another embodiment of the present application, the step S102 may include the following steps 1021 ~ 1022:

step 1021: obtaining an IPv6 address corresponding to user equipment and service description information corresponding to a target local service, wherein the service description information comprises: service identification and communication protocol;

specifically, after the user equipment is accessed into the IPv6 network, the user equipment can automatically obtain its IPv6 address. Next, as an example, when the user needs the target local service, the user may input service description information corresponding to the target local service to the user equipment through an input operation, or the user may perform a selection operation on the user equipment to select the service description information corresponding to the target local service, so that the user equipment may obtain the service description information corresponding to the target local service that the user needs to obtain according to the input operation or the selection operation of the user. Therefore, the user equipment obtains the IPv6 address corresponding to the user equipment and the service description information corresponding to the target local service.

Step 1022: and embedding the service description information corresponding to the target local service into the last 64 bits of the IPv6 address to generate a link local address corresponding to the target local service.

In a specific implementation process, the step 1022 may include: encoding the service description information to obtain an interface identifier of a link local address; and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address corresponding to the target local service.

As an example, in order to better distinguish the obtained interface identification of the link local address from the existing various interface identifications, the first 48 bits of the last 64 bits of the link local address may be set as encoding information generated based on the service description information, and the last 16 bits of the last 64 bits of the link local address may be set as encoding information preset by a person skilled in the art according to practical experience, that is, encoding information generated according to the service description information and the preset encoding information to generate the link local address. Thus, since the service description information includes: the service identifier and the communication protocol are encoded into 24-bit encoded information, so that, in the specific implementation process, the step of encoding the service description information to obtain the interface identifier of the link local address may include: coding the service identification to obtain 24 bits of coding information corresponding to the service identification; coding a communication protocol to obtain 24 bits of coding information corresponding to the communication protocol; and splicing the 24-bit coding information corresponding to the service identifier, the 24-bit coding information corresponding to the communication protocol and the preset 16-bit coding information to obtain the interface identifier of the link local address.

For example, referring to fig. 3, in order to distinguish the interface identifier of the generated link local address from the interface identifiers of the existing IPv6 addresses, the inventor of the present application finds that the preset 16-bit coded information can be set to 0 in a specific implementation process, and then the first 24 bits of the interface identifier of the generated link local address are 24-bit coded information corresponding to the service identifier, the middle 24 bits of the interface identifier of the generated link local address are 24-bit coded information corresponding to the communication protocol, and the last 16 bits of the interface identifier of the generated link local address are 0.

For another example, in order to distinguish the interface identifier of the link local address from the interface identifiers of the existing various IPv6 addresses, in addition to setting all the preset 16-bit encoded information to 0, any one byte of the 6 bytes in the first 48 bits, which are composed of the 24-bit encoded information corresponding to the service identifier and the 24-bit encoded information corresponding to the communication protocol, cannot be 0xFF, and the first byte is not 0, so that the obtained interface identifier of the link local address can be distinguished from most of generation schemes with special semantic interface identifiers. For example, in the process of implementing the embodiment of the present application, the inventor of the present application finds that, in an IVI address generation scheme, there is no situation where the last 16 bits of an interface identifier are 0, where IVI is a protocol conversion technology based on sit (Stateless IP/ICMP Translation ), and can solve the network layer Translation of IPv6 network and IPv4 network packets; in the lightweight 4over6(IPv 4over IPv6) scheme, the first 16 bits of the interface identifier are all 0; in EUI64(64-bit Extended Unique Identifier), the middle 16 bits of the interface Identifier are 0 xFFFE; in addition, most other manually-specified interface identifiers use the last 16 bits as part of the IPv4 address or as a numerical identifier, and this reserved address space does not conflict with any broadcast address in the subnet. Therefore, as verified in the specific implementation process by the inventor of the present application, the interface identifier of the link local address in the embodiment of the present application can be well distinguished from the existing various interface identifiers, and further, the local service can be effectively obtained based on the link local address.

In practical application, the service identifier of the local service may be a character string identifier or a digital identifier, and then, in order to obtain 24-bit encoding information corresponding to the service identifier, when the service identifier is the character string identifier, the service identifier may be encoded in a character string encoding manner; when the service identifier is a digital identifier, the service identifier may also be encoded by a digital encoding method. Of course, the service identifier may also be encoded by other encoding manners, and the embodiment of the present application is not specifically limited herein.

How to encode the service identifier is described below with specific examples.

First, how to encode the service identifier by means of character string encoding is described in a specific example.

As an example, when the service identifier is a character string identifier, the service identifier may be encoded using a 6-bit encoded character string encoding method. However, when the service identifier needs to be encoded into 24-bit encoded information, it indicates that 4 characters can be accommodated at most after the character string encoded by using 6-bit encoding, and at this time, if the length of the character that can be accommodated is not enough, i.e. the length of the service identifier is longer than the length after the character string encoding, an additional stop symbol needs to be supplemented at the tail.

Further, when the service identifier is a character string identifier, in order to avoid conflict with the setting of the IPv6 network, the 6-bit encoding such as "000000" and "111111" can be avoided in the implementation process.

Illustratively, 37 characters "a-z (case insensitive), 0-9, -" which may be used by the DNS may be mapped, plus the extra stop character required when the length of the service identification is longer, so that the total number of characters may be 38. Thus, a 6-bit encoded coding table as shown in table 1 below can be obtained. Next, taking a local service as a local FIRE alarm service as an example, assuming that a service identifier of the FIRE alarm service is "FIRE", after the service identifier is encoded by the encoding table, the 24-bit encoded information corresponding to the service identifier is obtained as 0x 454740.

Character(s) 6 bit encoding Character(s) 6 bit encoding Character(s) 6 bit encoding
Stop sign 000001 C/c 001110 P/p 011011
0 000010 D/d 001111 Q/q 011100
1 000011 E/e 010000 R/r 011101
2 000100 F/f 010001 S/s 011110
3 000101 G/g 010010 T/t 011111
4 000110 H/h 010011 U/u 100000
5 000111 I/i 010100 V/v 100001
6 001000 J/j 010101 W/w 100010
7 001001 K/k 010110 X/x 100011
8 001010 L/l 010111 Y/y 100100
9 001011 M/m 011000 Z/z 100101
A/a 001100 N/n 011001 - 100110
B/b 001101 O/o 011010

TABLE 1

Second, the encoding of the service identification by means of digital encoding is described as a specific example.

As an example, each service identifier may be set to correspond to a positive integer greater than 0, for example, still taking the local service as the local fire alarm service as an example, the service identifier of the fire alarm service may be set to 1, and the 24-bit encoded information (i.e. 3-byte encoded information) corresponding to the service identifier of the fire alarm service is 0x 000001. It should be noted that the above numbers are only examples, and the embodiments of the present application are not limited to this.

In practical applications, in order to obtain 24-bit encoding information corresponding to a communication protocol of a local service, the communication protocol may be encoded in a character string encoding manner, or may be encoded in a digital encoding manner, or of course, the communication protocol may also be encoded in other encoding manners, where this embodiment of the present application is not specifically limited.

For example, still taking the fire alarm service in the local emergency communication service as an example, assuming that the fire alarm service is implemented by using a WWW web page, the communication protocol of the fire alarm service may be defined as "TCP _ WWW _ XML", and in practical applications, because the character string included in the communication protocol is often long, in order to facilitate encoding, the communication protocol may be encoded by using a digital encoding method. For example, the communication protocol may be encoded in an integral manner, if "TCP _ WWW _ XML" may be directly encoded to 1, the 24-bit encoded information (3-byte encoded information) corresponding to the encoded communication protocol may be 0x000001, or the communication protocol may be encoded in a separate encoding manner, that is, the protocol, the port, and the parsing format may be separately encoded, and if TCP is encoded to 1, WWW is encoded to 1, and XML is encoded to 1, for example, the 24-bit encoded information (3-byte encoded information) corresponding to the encoded communication protocol may be 0x 010101.

For another example, taking the target local service as a FIRE alarm service as an example, and assuming that the service identifier corresponding to the FIRE alarm service is "FIRE", and the communication protocol corresponding to the FIRE alarm service is "TCP _ WWW _ XML", then, first, the service identifier of the FIRE alarm service is encoded by a character string encoding method based on the encoding table shown in table 1 above, and the 24-bit encoded information (i.e., 3-byte encoded information) corresponding to the service identifier of the FIRE alarm service is obtained as 0x 474540; and coding the communication protocol of the fire alarm service by a digital coding mode to obtain 24-bit coded information (namely 3-byte coded information) corresponding to the communication protocol of the fire alarm service, wherein the 24-bit coded information is 0x000001, and the link local address corresponding to the local fire alarm service for performing fire alarm through WWW can be the address of fe80::4547:4000:1: 0. Then, when the user needs to alarm the fire alarm, the 80 port of the local address of the link can be accessed through the user equipment, and the alarm is directly alarmed by using the WWW form.

S103: and acquiring the target local service based on the link local address.

In practical applications, the target local service may be one or more of a local DNS service, a local NTP (Network Time Protocol) service, a local Network authentication service, a local Network failure repair service, a local geographic information service, a local emergency communication service, a local business service, and a local Network charging service. Of course, other types of services, such as a local life information service, may also be used, and the embodiments of the present application are not specifically limited herein.

For example, a local DNS service may be used to provide DNS server addresses; the local NTP service may be used to synchronize the clock of the user equipment with the local time; the local network authentication service may be used to provide a network authentication server address; the local network fault repair service can be used for providing a local network fault repair number; the local geographic information service can be used for providing longitude information, latitude information and altitude information of the current geographic position of the user equipment; the local emergency communication service can be used for providing emergency communication numbers such as fire alarm numbers, emergency rescue numbers and the like; the local commercial service can be used for providing commercial information of shopping, traveling and the like around the local; the local network charging service may be used to provide local network charging information and flow information; the local life information service can be used for providing information of daily life, weather and the like.

In a specific implementation process, the step S103 may include: and accessing the link local address through a communication protocol to acquire the target local service corresponding to the service identifier.

Specifically, in the IPv6 network, since the service description information is embedded in the interface identifier of the link-local address acquired by the user equipment through S102, that is, the service description information is encoded in the last 64 bits of the IPv6 address, the service description information includes: a service identifier and a communication protocol, the user equipment can directly access the link local address through the communication protocol, so as to obtain the corresponding local service represented by the service identifier. Therefore, the local related services, such as emergency communication service, alarm service and the like, can be obtained without using any other services, such as domain name resolution, domain name resolution in a local area network and the like, before network authentication is carried out.

At this point, the process of acquiring the local service based on the link local address carrying the service description information corresponding to the local service is completed.

As can be seen from the above, in the method for acquiring a local service provided in this embodiment of the present application, after a user equipment accesses an IPv6 network, the user equipment may determine whether to receive a router advertisement message, where the router advertisement message carries a uniform resource identifier URI for indicating a local service entry; if the user equipment determines that the user equipment does not receive the router advertisement message, the user equipment acquires a link local address corresponding to the target local service, wherein service description information corresponding to the target local service is embedded in the link local address; finally, the target local service may be acquired based on the link local address. Therefore, the local service is acquired through the link local address carrying the service description information of the local service, dependence on other servers such as a DNS (domain name system) server and a DHCP (dynamic host configuration protocol) server can be effectively avoided, the required target local service can be acquired only by accessing an IPv6 network, the system structure is simple, and deployment is convenient.

Based on the foregoing embodiments, the present application provides a method for acquiring a local service. The method can be applied to the following scenes: the URI used for indicating the local service entrance is added in the router advertisement in advance, and when the user equipment accesses the IPv6 network and network authentication is completed, the user equipment receives the router advertisement message which is sent by the router and carries the URI used for indicating the local service entrance, so that the user equipment can acquire the required local service by accessing the URI.

Fig. 4 is a second flowchart illustrating a method for acquiring a local service in the embodiment of the present application, and referring to fig. 4, the method for acquiring a local service may include:

s101: after user equipment accesses an IPv6 network, determining whether a router advertisement message is received or not;

the router advertisement message carries a Uniform Resource Identifier (URI) for indicating a local service entrance; here, the URI is a local service portal URI containing various local configuration, usage, information, and the like related contents.

In practical application, when the IPv6 network is deployed, a URI indicating a local service entry may be added in a router advertisement in advance, and since a router sends a router advertisement message periodically at preset time intervals, after the user equipment accesses the IPv6 network and completes network authentication, the user equipment may receive the router advertisement message.

As an example, the router advertisement contains a LOCAL information (LOCAL _ INFO) option, the content of which is a URI address, the length of which (including type and length fields) is in units of 8 bytes, and the less part is filled with 0.

It should be noted that, in the embodiment of the present application, an 8-byte option is used in the router advertisement message to provide a URI for indicating a local service entry, and then a local service homepage corresponding to the URI provides each local service, instead of directly providing a local service using a 1-byte option in the router advertisement message, in this way, when the URI for indicating a local service entry is not changed, it is not necessary to frequently set the router advertisement message, and it is very convenient to add, delete, and modify the supported local services, and further, when more local services need to be supported, the extensibility is high.

Specifically, if it is determined that the user equipment obtains a router advertisement packet carrying a URI indicating a local service entry by performing S101, S401 to S403 may be performed to obtain a local service based on the URI; if it is determined that the user equipment does not obtain the router advertisement packet carrying the URI indicating the local service entry by performing S101, S102 to S103 may be performed to obtain the local service based on the link local address.

S401: analyzing the router advertisement message to obtain a URI;

as an example, in a non-emergency situation, in order to acquire a more detailed and rich local service, if the user equipment determines that a router advertisement packet carrying a URI indicating a local service entry is received, the URI may be parsed from the router advertisement packet.

S402: accessing a home service homepage for providing a home service based on the URI;

s403: and acquiring the target local service from the local service homepage.

In a specific implementation process, the local service homepage may include: one or more of a local Domain Name System (DNS) service, a local Network Time Protocol (NTP) service, a local network authentication service, a local network troubleshooting service, a local geographic information service, a local emergency communication service, a local business service, a local network charging service. Of course, other local services may also be provided by the local service homepage, and the embodiment of the present application is not particularly limited herein.

As an example, the home service homepage may be displayed as a browser homepage, and after the user device accesses the URI, the user device may display the home service homepage to the user, where the home service homepage may display a plurality of home services on which the user may operate, and the user device obtains a target home service from the home service homepage according to the operation of the user.

As can be seen from the above, the method for acquiring local services provided in the embodiment of the present application, by encoding the service identifier and the communication protocol as the link local address, can facilitate the user equipment to acquire local services, such as emergency communication service and alarm service, that can be realized without accessing the internet before performing internet authentication without depending on infrastructure such as DNS, DHCP, router advertisement, etc.; after the on-line authentication, further, the more detailed local service can be obtained by accessing the URI indicating the local service entry carried in the router advertisement message.

Based on the same inventive concept, the embodiment of the application provides a method for generating a link local address. Fig. 5 is a flowchart illustrating a method for generating a link local address in an embodiment of the present application, and referring to fig. 5, the method for generating a link local address may include:

s501: after the user equipment accesses an IPv6 network, acquiring an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service;

wherein the service description information includes: service identification and communication protocol.

Here, the service identification is an identification for characterizing a local service. Communication protocol refers to communication, ingress port, resolution protocol that needs to be followed to access local services.

S502: and embedding the service description information into the last 64 bits of the IPv6 address to generate a link local address.

In another embodiment of the present application, the step S502 may include the following steps 5021 to 5022:

step 5021: encoding the service description information to obtain an interface identifier of a link local address;

step 5022: and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address.

In order to better distinguish the obtained interface identifier of the link local address from the existing various interface identifiers, the first 48 bits of the last 64 bits of the link local address may be set as encoding information generated based on the service description information, and the last 16 bits of the last 64 bits of the link local address may be set as encoding information preset by a person skilled in the art according to practical experience, that is, encoding information generated according to the service description information and encoding information preset to generate the link local address. Thus, since the service description information includes: service identification and communication protocol, then, in the implementation process, the step 5021 may include: coding the service identification to obtain 24 bits of information corresponding to the service identification; coding a communication protocol to obtain 24 bits of information corresponding to the communication protocol; and sequentially splicing the 24-bit information corresponding to the service identifier, the 24-bit information corresponding to the communication protocol and the preset 16-bit information to obtain the interface identifier of the link local address.

It should be noted that the link local address in the embodiment of the present application is consistent with that in the one or more embodiments, and for technical details that are not disclosed in the embodiment of the present application, please refer to the description of the link local address in the one or more embodiments to understand that, here, too much description is not repeated in the embodiment of the present application.

As can be seen from the above, in the method for generating a link local address provided in the embodiment of the present application, after a user equipment accesses an IPv6 network, an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service are obtained, where the service description information includes: service identification and communication protocol, then embedding service description information into the last 64 bits of the IPv6 address to generate a link local address. Therefore, the description information corresponding to the target local service is coded into the link local address, so that the link local address can be obtained to the required target local service based on the access of the IPv6 network without depending on other servers such as a DNS server and a DHCP server, and the system structure is simple and convenient to deploy.

Based on the same inventive concept, as an implementation of the method, the embodiment of the application provides a device for acquiring local services. In practical applications, the apparatus for acquiring local services may be applied to user equipment. Fig. 6 is a schematic structural diagram of an apparatus for acquiring a local service in an embodiment of the present application, and referring to fig. 6, the apparatus 60 may include: a determining unit 601, configured to determine whether a router advertisement message is received after a user equipment accesses an internet protocol version 6 IPv6 network, where the router advertisement message carries a uniform resource identifier URI used for indicating a local service entry; a first obtaining unit 602, configured to obtain a link local address corresponding to a target local service if the determining unit determines that the router advertisement message is not received, where service description information corresponding to the target local service is embedded in the link local address; a second obtaining unit 603, configured to obtain the target local service based on the link local address.

In this embodiment of the present application, the first obtaining unit is configured to obtain an IPv6 address corresponding to a user equipment and service description information corresponding to a target local service, where the service description information includes: service identification and communication protocol; and embedding the service description information into the last 64 bits of the IPv6 address to generate a link local address.

In this embodiment of the present application, the first obtaining unit is configured to encode service description information to obtain an interface identifier of a link local address; and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address.

In this embodiment of the present application, the first obtaining unit is configured to encode a service identifier, and obtain 24-bit encoded information corresponding to the service identifier; coding a communication protocol to obtain 24 bits of coding information corresponding to the communication protocol; and splicing the 24-bit coding information corresponding to the service identifier, the 24-bit coding information corresponding to the communication protocol and the preset 16-bit coding information to obtain the interface identifier of the link local address.

In this embodiment of the application, the second obtaining unit is configured to access the link local address through the communication protocol, and obtain the target local service corresponding to the service identifier.

In other embodiments of the present application, the apparatus for acquiring a local service may further include: the analyzing unit is used for analyzing the router notification message to obtain the URI if the determining unit confirms to receive the router notification message; an accessing unit for accessing a home service homepage for providing a home service based on the URI; and a third acquiring unit for acquiring the target local service from the local service homepage.

In an embodiment of the present application, the local service homepage may include: one or more of a local Domain Name System (DNS) service, a local Network Time Protocol (NTP) service, a local network authentication service, a local network troubleshooting service, a local geographic information service, a local emergency communication service, a local business service, a local network charging service.

Based on the same inventive concept, as an implementation of the method, the embodiment of the present application provides an apparatus for generating a link local address. In practical application, the device for generating the link local address can be applied to user equipment. Fig. 7 is a schematic structural diagram of an apparatus for generating a link local address in an embodiment of the present application, and referring to fig. 7, the apparatus 70 may include: an obtaining unit 701, configured to obtain, after a user equipment accesses an internet protocol version 6 IPv6 network, an IPv6 address corresponding to the user equipment and service description information corresponding to a target local service, where the service description information includes: service identification and communication protocol; a generating unit 702, configured to embed the service description information into the last 64 bits of the IPv6 address, and generate the link local address in one or more embodiments described above.

In the embodiment of the present application, the generating unit is configured to encode the service description information to obtain an interface identifier of a link local address; and splicing the subnet prefix in the IPv6 address with the interface identifier of the link local address to generate the link local address.

In the embodiment of the present application, the generating unit is configured to encode the service identifier to obtain 24-bit encoded information corresponding to the service identifier; coding a communication protocol to obtain 24 bits of coding information corresponding to the communication protocol; and splicing the 24-bit coding information corresponding to the service identifier, the 24-bit coding information corresponding to the communication protocol and the preset 16-bit coding information to obtain the interface identifier of the link local address.

Based on the same inventive concept, the embodiment of the application provides user equipment. Fig. 8 is a schematic structural diagram of a user equipment in an embodiment of the present application, and referring to fig. 8, the user equipment 80 includes: at least one processor 81; and at least one memory 82, a bus 83 connected to the processor 81; the processor 81 and the memory 82 complete communication with each other through the bus 83; the processor 81 is arranged to call program instructions in the memory 82 to perform the steps of the method of obtaining local services in one or more of the embodiments described above.

Accordingly, based on the same inventive concept, embodiments of the present application further provide a processor, where the processor is configured to execute a program, where the program executes the steps of the method for acquiring a local service in one or more embodiments described above.

The Processor may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like. The Memory may include volatile Memory in a computer readable medium, Random Access Memory (RAM), and/or nonvolatile Memory such as Read Only Memory (ROM) or Flash Memory (Flash RAM), and the Memory includes at least one Memory chip.

It should be noted that, in the embodiments of the present application, if the method for obtaining local services in one or more embodiments described above is implemented in the form of a software functional module, and is sold or used as a standalone product, it may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof that contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a user equipment (which may be a personal computer, a server, or a network device) to execute all or part of the methods of the embodiments of the present application.

Accordingly, based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, the user equipment where the storage medium is located is controlled to execute the steps of the method for acquiring a local service in one or more embodiments described above.

Here, it should be noted that: the above description of the apparatus, user equipment or computer readable storage medium embodiments is similar to the description of the method embodiments above with similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus, the user equipment or the computer-readable storage medium of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.

The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.

The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive concept as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented alone or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Further, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.

It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种接口配置信息切换方法、装置、设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!