Summary of the invention
In view of this, the IP address that the invention provides a kind of off-grid terminal generates method and device automatically, makes the off-grid terminal need not send the uniqueness that detection messages can be guaranteed the IP address that self generates.
For reaching above-mentioned purpose, technical scheme of the present invention specifically is achieved in that
The IP address at a kind of off-grid terminal generates method automatically, and this method comprises:
Obtain the off-grid terminal from the unique identification in network;
Said unique identification is extracted as the digital form intermediate code of preset figure place;
Through binary-coded decimal system binary-coded decimal method or fetch bit method, convert said intermediate code into the IP address.
Preferably, this method further comprises:
Obtain the unique identification of opposite equip. in network;
Convert unique identification the method for IP address into according to said, convert the unique identification of said opposite equip. in network into the IP address;
IP address and said opposite equip. according to said opposite equip. carry out end to end communication.
Preferably, said IP address is the IPv4 address.
Preferably, the said digital form intermediate code that said unique identification is extracted as preset figure place comprises:
Through cover or guarantee the hash algorithm of uniqueness, said unique identification is extracted as the intermediate code of 8 or 4 ten's digit forms.
Preferably, said binary-coded decimal method comprises:
Convert the IPv4 address of binary system 4 portion-forms into through 8421 yards intermediate codes with 8 or 4 ten's digit forms, the binary digit with each part converts ten's digit into again, obtains the decimal system, the IPv4 address of 4 portion-forms.
Preferably, said fetch bit method comprises:
Through getting suitable figure place, the intermediate code of 8 or 4 ten's digit forms is directly changed into the IPv4 address of the decimal system 4 portion-forms.
Preferably, said IP address is the IPv6 address.
Preferably, the said digital form intermediate code that said unique identification is extracted as preset figure place comprises:
Through cover or guarantee the hash algorithm of uniqueness, said unique identification is extracted as the intermediate code of 16 or 8 ten's digit forms.
Preferably, said binary-coded decimal method comprises:
Convert the IPv6 address host number of binary system 8 portion-forms into through 8421 yards intermediate codes with said 16 or 8 ten's digit forms; Binary digit with each part converts ten's digit into again; Obtain the decimal system, the IPv6 address host number of 8 portion-forms;
Said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
Preferably, said fetch bit method comprises:
Through getting suitable figure place, the intermediate code of said 16 or 8 ten's digit forms is directly changed into the IPv6 address host number of the decimal system 8 portion-forms;
Said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
The IP address automatically generating device at a kind of off-grid terminal, this device comprises:
Identifier acquisition module is used to obtain the off-grid terminal from the unique identification in network;
Modular converter links to each other with said identifier acquisition module, is used for said unique identification is extracted as the digital form intermediate code of preset figure place, and converts said intermediate code into the IP address through binary-coded decimal system binary-coded decimal method or fetch bit method.
Preferably, this device further comprises:
The opposite end acquisition module is used to obtain the unique identification of opposite equip. in network;
Said modular converter further links to each other with said opposite end acquisition module, is used for the unique identification of said opposite equip. is extracted as the digital form intermediate code of preset figure place, and converts the intermediate code of said opposite equip. into the IP address;
Communication module links to each other with said modular converter, is used for carrying out end to end communication according to the IP address and the said opposite equip. of said opposite equip..
Preferably, said modular converter comprises:
Extraction unit is used for through cover or guarantees that the hash algorithm of uniqueness is extracted as said unique identification the intermediate code of 8 or 4 ten's digit forms;
Converting unit links to each other with said extraction unit, is used for converting the intermediate code of said 8 or 4 bit digital forms into the IPv4 address through binary-coded decimal method or fetch bit method.
Preferably; Said converting unit converts the IPv4 address of binary system 4 portion-forms into through 8421 yards intermediate codes with 8 or 4 ten's digit forms; Binary digit with each part converts ten's digit into again, obtains the decimal system, the IPv4 address of 4 portion-forms.
Preferably, said converting unit is directly changed into the intermediate code of 8 or 4 ten's digit forms the IPv4 address of the decimal system 4 portion-forms through getting suitable figure place.
Preferably, said modular converter comprises:
Extraction unit is used for through cover or guarantees that the hash algorithm of uniqueness is extracted as said unique identification the intermediate code of 16 or 8 ten's digit forms;
Converting unit links to each other with said extraction unit, is used for converting the intermediate code of said 16 or 8 ten's digit forms into the IPv6 address through binary-coded decimal method or fetch bit method.
Preferably; Said converting unit converts the IPv6 address host number of binary system 8 portion-forms into through 8421 yards intermediate codes with 16 or 8 ten's digit forms; Binary digit with each part converts ten's digit into again, obtains the decimal system, the IPv6 address host number of 8 portion-forms;
Said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
Preferably, said converting unit is through getting suitable figure place, the intermediate code of 16 or 8 bit digital forms is directly changed into the IPv6 address of the decimal system 8 portion-forms;
Said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
Visible by technique scheme; The IP address at this off-grid of the present invention terminal generates method and device automatically; Utilize this certain unique identification in network of off-grid terminal; Make it to convert into the IP address through special algorithm, the uniqueness of the IP address after guaranteeing to change with the uniquely identified uniqueness, thereby need not to send the uniqueness detection messages.In addition, the off-grid terminal uses identical algorithm can obtain the IP address of opposite end through the said unique identification of opposite end, thereby need not the support of DNS system, can realize end to end communication.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, to further explain of the present invention.
The present invention utilizes this certain unique identification in network of off-grid terminal, makes it to convert into the IP address through special algorithm, the uniqueness of the IP address after guaranteeing to change with the uniquely identified uniqueness, thereby need not to send the uniqueness detection messages.In addition, the off-grid terminal uses identical algorithm can obtain the IP address of opposite end through the said unique identification of opposite end, thereby need not the support of DNS system, can realize end to end communication.
Fig. 1 generates method flow diagram automatically for the IP address of the embodiment of the invention, and as shown in Figure 1, this method comprises the steps:
Step 101 is obtained the off-grid terminal from the unique identification in network;
Require the off-grid terminal must possess the sign that is used for unique identification off-grid terminal except that the IP address in network among the present invention; For example phone number, fixed line number etc.; If certainly multiple unique identification is arranged, can select one of which, also can preferentially select the unique identification of digital form.
Step 102 is extracted said unique identification the digital form intermediate code of presetting figure place;
In this step,, before converting the IP address into, need earlier it to be extracted as unified digital form intermediate code because the concrete unique identification that obtains is different; And the figure place of concrete intermediate code, also needing the IP address according to final conversion is that IPv4 address or IPv6 address are confirmed.
For the IPv4 address, can be extracted as the intermediate code of 8 or 4 metric digital forms, during extraction; If unique identification is a pure digi-tal form and less than 8, then can adopt the mode of cover, be 8 with its benefit; If less than 4, then can mend 4 or mend 8 and all can; Certainly if 4 or 8 then need not cover, perhaps mend 8 to 4.During cover, benefit is after former numeral or before, perhaps front and back are all mended and all are fine.
If unique identification is numeral and monogram, perhaps, then can adopt self-defining hash algorithm earlier greater than 8 ten's digit; Unique identification is extracted as 8 or 4 bit digital forms; This hash algorithm will guarantee the uniqueness changed, and specific algorithm the present invention do not limit, customized justice.
For the IPv6 address, owing to forming by 64 bit address prefixs and 64 host number two parts the IPv6 address, in general; Address prefix is manual being arranged on the terminal; Or terminal equipment obtains the router period announcement message in the network segment automatically, so no matter off-grid whether, the address prefix part at terminal all can get access in advance; So for the IPv6 address; As long as generate IPv6 address host number partly, the host number with prefix part and generation partly combines at last, can obtain complete IPv6 address.
So in this step, if what generate is the IPv6 address, then be the ten's digit form intermediate code that unique identification is extracted as 16 or 8, concrete method for distilling is similar with the IPv4 address, only figure place is had any different, here detailed description no longer.
Step 103 through binary-coded decimal method or fetch bit method, converts said intermediate code into the IP address.
Identical with step 102, also needing the IP address according to final conversion when converting the IP address into is that concrete grammar is confirmed in IPv4 address or IPv6 address;
For the IPv4 address, after unique identification is extracted as the intermediate code of 8 or 4 ten's digit forms, can be converted into the IPv4 address through binary-coded decimal method or fetch bit method.With unique identification is that the typical fixed line number of 8 bit digital is an example; As 12345678; Adopt the binary-coded decimal method; Earlier convert numeral 12345678 into binary coding, with 8421 yards be example, 12345678 will convert 0001 (1) 0010 (2) 0011 (3) 0100 (4) 0101 (5) 0110 (6) 0111 (7) 1000 (8) into is divided into 4 parts according to the form of IPv4 address with it again and promptly is expressed as 00010010.00110100.01010110.01111000; Convert the binary number of every part into the decimal system, obtaining the IPv4 address is 18.52.86.120; If adopt the fetch bit method; Then directly get suitable figure place; With 12345678 convert the IPv4 address into 4 portion-forms, " suitable figure place " here is meant 4 portion-forms that satisfy the IPv4 address after the fetch bit, and each part all meets the address realm of IPv4 address; For example every part is got two in 4 parts, and obtaining the IPv4 address is 12.34.56.78, and perhaps first gets 3, and second portion is got 1, and back two parts are got 2, and obtaining the IPv4 address is 123.4.56.78.In addition, will consider the address realm of IPv4 address during fetch bit, each part can not surpass 255, if fetch bit is 12.345.6.78, so wherein a part 345 has surpassed 255, and so such fetch bit is inappropriate.4 bit digital are identical with the method that the fetch bit method converts the IPv4 address into through the binary-coded decimal method, and for example 1234, adopt binary-coded decimal and fetch bit method, the IPv4 address after the conversion is 1.2.3.4.
For the IPv6 address, also can use binary-coded decimal method and fetch bit method to change, conversion method is similar with the IPv4 address; Only need convert the IPv6 address host number of 8 part ten's digit forms into, no longer detail here, in addition; It should be noted that; What obtain after the conversion is IPv6 address host number, and IPv6 address host number after also needing to change and the IPv6 address prefix combination that obtains in advance just can obtain complete IPv6 address.Similar with the IPv4 address, for the IPv6 address, " suitable figure place " is meant 8 portion-forms that satisfy the IPv6 address after the fetch bit, and each part all meets the address realm of IPv6 address.
In addition; After obtaining the IPv4 or IPv6 address of self; If carry out follow-up end to end communication, then can continue to obtain the unique identification of opposite equip., for example the unique identification tabulation through the opposite equip. preserved in the off-grid terminal; Typical in the phone number in the address list, fixed line list of numbers etc., the perhaps manual opposite end number of importing of user; Adopt above-mentioned identical conversion method afterwards, can obtain the IPv4 or the IPv6 address of opposite end, thereby can directly carry out follow-up end to end communication, and need not DNS system analysis opposite end number.
In addition, the present invention also provides the IP address automatically generating device at a kind of off-grid terminal, and this device is as shown in Figure 2, comprising:
Identifier acquisition module 201 is used to obtain the off-grid terminal from the unique identification in network;
Modular converter 202 links to each other with said identifier acquisition module 201, is used for said unique identification is extracted as the digital form intermediate code of preset figure place, and converts said intermediate code into the IP address through binary-coded decimal system binary-coded decimal method or fetch bit method.
In order to realize end to end communication, this device can further include:
Opposite end acquisition module 203 is used to obtain the unique identification of opposite equip. in network;
Said modular converter 202 further links to each other with said opposite end acquisition module 203, is used for the unique identification of said opposite equip. is extracted as the digital form intermediate code of preset figure place, and converts the intermediate code of said opposite equip. into the IP address;
Communication module 204 links to each other with said modular converter 202, is used for carrying out end to end communication according to the IP address and the said opposite equip. of said opposite equip..
According to the difference (IPv4 or IPv6 address) of the IP address of final needs conversion, in the said apparatus, the concrete structure of said modular converter 202 also can be different.
For the IPv4 address, 202 as shown in Figure 3 comprising of said modular converter:
Extraction unit 301 is used for through cover or hash algorithm said unique identification being converted into the intermediate code of 8 or 4 ten's digit forms;
Converting unit 302 links to each other with said digital translation unit 301, is used for converting the intermediate code of said 8 or 4 ten's digit forms into the IPv4 address through binary-coded decimal method or fetch bit method.
Wherein, Said converting unit 302 specifically can convert the IPv4 address of binary system 4 portion-forms through 8421 yards intermediate codes with 8 or 4 ten's digit forms into; Binary digit with each part converts ten's digit into again, obtains the decimal system, the IPv4 address of 4 portion-forms.
Perhaps, said converting unit 302 specifically can be through getting suitable figure place, the intermediate code of 8 or 4 bit digital forms is directly changed into the IPv4 address of the decimal system 4 portion-forms.
For the IPv6 address, the structural similarity of modular converter 202 also comprises extraction unit 301 and converting unit 302, and different is,
Extraction unit 301 will be used for through cover or hash algorithm said unique identification being converted into the intermediate code of 16 or 8 ten's digit forms;
Converting unit 302 links to each other with said digital translation unit 301, will be used for converting the intermediate code of said 16 or 8 ten's digit forms into the IPv6 address through binary-coded decimal method or fetch bit method.
Wherein, Said converting unit 302 specifically can convert the IPv6 address of binary system 8 portion-forms through 8421 yards intermediate codes with 16 or 8 ten's digit forms into; Binary digit with each part converts ten's digit into again; Obtain the decimal system, the IPv6 address host number of 8 portion-forms; Again said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
Perhaps, said converting unit 302 specifically can be through getting suitable figure place, the intermediate code of 16 or 8 bit digital forms is directly changed into the IPv6 address host number of the decimal system 8 portion-forms; Again said IPv6 address host number and the IPv6 address prefix of obtaining in advance are combined as complete IPv6 address.
In the foregoing description, the concrete operations that each module, unit are carried out can be repeated no more with reference to the conversion portion of said method embodiment here.
Visible by the above embodiments; The IP address at this off-grid of the present invention terminal generates method and device automatically; Utilize this certain unique identification in network of off-grid terminal; Make it to convert into IPv4 or IPv6 address through special algorithm, the IPv4 after guaranteeing to change with the uniquely identified uniqueness or the uniqueness of IPv6 address, thereby need not to send the uniqueness detection messages.In addition, the off-grid terminal uses identical algorithm can obtain the IPv4 or the IPv6 address of opposite end through the said unique identification of opposite end, thereby need not the support of DNS system, can realize end to end communication.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.