CN114726825A - IPv6 address library construction method, system, electronic equipment and storage medium - Google Patents
IPv6 address library construction method, system, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114726825A CN114726825A CN202110006206.5A CN202110006206A CN114726825A CN 114726825 A CN114726825 A CN 114726825A CN 202110006206 A CN202110006206 A CN 202110006206A CN 114726825 A CN114726825 A CN 114726825A
- Authority
- CN
- China
- Prior art keywords
- ipv6 address
- information
- address
- input
- ipv6
- 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.)
- Pending
Links
- 238000010276 construction Methods 0.000 title claims description 13
- 238000000034 method Methods 0.000 claims abstract description 46
- 230000015654 memory Effects 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 13
- 239000000126 substance Substances 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 12
- 238000006243 chemical reaction Methods 0.000 description 6
- 230000001360 synchronised effect Effects 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 4
- 230000011218 segmentation Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method, a system, electronic equipment and a storage medium for constructing an IPv6 address base, wherein the method comprises the following steps: receiving an incoming IPv6 address; generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base; generating corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
Description
Technical Field
The present application relates to the field of Internet Protocol (IP), and in particular, to a method, a system, an electronic device, and a storage medium for constructing an IPv6 address repository.
Background
IP addresses are an important fundamental resource for the construction of communication networks. At present, The IPv4 address pool of The world and The Asia-Pacific region is exhausted, The IPv6 protocol is used as The next generation IP protocol designed by The Internet Engineering Task Force (IETF) and used for replacing The IPv4 protocol, and The problem of insufficient IPv4 address quantity can be effectively solved by expanding The address length to 128 bits.
The address allocation data and the route announcement data of the IPv6 are updated every day, and the related art cannot quickly and effectively locate the home information of the IPv6 address.
Disclosure of Invention
In order to solve the related technical problems, embodiments of the present application provide a method, a system, an electronic device, and a storage medium for constructing an IPv6 address library.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a method for constructing an IPv6 address base, which comprises the following steps:
receiving an input IPv6 address;
generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
generating corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
In one embodiment, the generating corresponding first information in the IPv6 address base based on the input IPv6 address includes:
extracting the first 64 bits of the input IPv6 address to obtain a first address segment;
generating corresponding first information in the IPv6 address base based on the first address segment.
In one embodiment, the generating corresponding first information in the IPv6 address base based on the first address segment includes:
correspondingly converting the four groups of hexadecimal numerical values into four decimal numerical values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
the first address segment is composed of the four groups of hexadecimal numerical values in sequence; t isiAnd characterizing the decimal value corresponding to the ith group of hexadecimal values in the first address segment.
In one embodiment, the generating corresponding first information in the IPv6 address base based on the first address segment includes:
sequentially dividing the first address segment into m sub-segments; each sub-segment in the m sub-segments corresponds to a set bit number;
correspondingly converting the m subsections into m decimal values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
Ticharacterizing the ith decimal value; ciAnd representing the set digits corresponding to the subsections corresponding to the ith decimal value.
In one embodiment, the generating corresponding second information in the IPv6 address base based on the input IPv6 address includes:
analyzing the input IPv6 address to obtain corresponding administrative division information;
and determining longitude and latitude information corresponding to the input IPv6 address based on the corresponding administrative division information.
In one embodiment, each IPv6 address in the IPv6 address pool corresponds to the following elements: start IP address, end IP address, country, province, city, district, latitude and longitude.
In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address base as any one of the following items:
the corresponding value of the initial IP address corresponding to the IPv6 address;
a corresponding value of an end IP address corresponding to the IPv6 address;
a corresponding value of any IP address between a starting IP address corresponding to the IPv6 address and an ending IP address corresponding to the IPv6 address;
the country, province, city, region and longitude and latitude corresponding to the IPv6 address in the IPv6 address base are determined based on the second information corresponding to the IPv6 address.
The embodiment of the present application further provides a system for constructing an IPv6 address base, including:
the receiving module is used for receiving an input IPv6 address;
the first generation module is used for generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
a second generating module, configured to generate corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
An embodiment of the present application further provides an electronic device, including: a first processor and a first communication interface; wherein the content of the first and second substances,
the first communication interface is used for receiving an input IPv6 address;
the first processor is used for generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
the first processor is further used for generating corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
Embodiments of the present application also provide an electronic device, a first processor and a first memory for storing a computer program capable of running on the processor,
wherein the first processor is configured to perform the steps of any of the above methods when running the computer program.
Embodiments of the present application also provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of any one of the above methods.
The construction method, the system, the electronic device and the storage medium of the IPv6 address library provided in the embodiments of the present application receive an input IPv6 address, and based on the input IPv6 address, generating corresponding first information in an IPv6 address base, obtaining the index of the input IPv6 address in the IPv6 address base, and based on the input IPv6 address, corresponding second information is generated in the IPv6 address base, and the geographic position to which the input IPv6 address belongs is obtained, so that aiming at the input IPv6 address, by generating the geographical location information to which the IPv6 address belongs in an IPv6 address base and generating the index of the IPv6 address in an IPv6 address base, therefore, the information construction of the IPv6 address is completed in the IPv6 address base, the geographical location information of the IPv6 address home can be inquired in the IPv6 address base quickly based on the index, on the basis, the IPv6 address base constructed by the method can realize quick query and source tracing of the IPv6 address.
Drawings
Fig. 1 is a schematic flowchart of a method for constructing an IPv6 address base according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a system for constructing an IPv6 address base according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples.
The embodiment of the application provides a method for constructing an IPv6 address base, and as shown in FIG. 1, the method comprises the following steps:
step 101: an incoming IPv6 address is received.
Here, the input IPv6 address is any 128-bit IPv6 address that needs to be entered into the IPv6 address pool.
Step 102: based on the input IPv6 address, corresponding first information is generated in an IPv6 address base.
Wherein the first information characterizes an index of the input IPv6 address in the IPv6 address base.
In order to quickly find the IPv6 address in the IPv6 address base subsequently, the original 128-bit address of the IPv6 address is converted according to a set rule, the converted value is used as information capable of uniquely marking the corresponding IPv6 address, and the value obtained by conversion can be used as an index in the IPv6 address base, so that the IPv6 address can be conveniently found by the converted value subsequently.
Step 103: and generating corresponding second information in the IPv6 address base based on the input IPv6 address. Wherein the content of the first and second substances,
the second information represents the geographic position corresponding to the input IPv6 address.
Here, the geographical location corresponding to the IPv6 address includes administrative division information, such as country, province/state, city, region, and the like, and also includes latitude and longitude information.
In practical applications, by resolving a 128-bit IPv6 address, in an embodiment, the generating, based on the input IPv6 address, corresponding second information in the IPv6 address library includes:
analyzing the input IPv6 address to obtain corresponding administrative division information;
and determining longitude and latitude information corresponding to the input IPv6 address based on the corresponding administrative division information.
Here, first, a 128-bit IPv6 address is segmented according to a set encoding rule corresponding to the IPv6 address, administrative division Information corresponding to the IPv6 address is obtained through analysis based on a segmentation result, and then, longitude and latitude Information corresponding to the administrative division Information is obtained through searching in a database such as a Geographic Information System (GIS) according to the obtained administrative division Information, so that the longitude and latitude Information corresponding to the IPv6 address is obtained.
In practical application, for an operator, in the process of constructing the IPv6 address base, the IPv6 address can be analyzed through the following two methods to obtain corresponding administrative division information:
the first type: for the IPv6 address of the operator, because the operator determines the relationship between the IPv6 address and the corresponding geographic location by formulating an internal coding rule, the 128-bit IPv6 address is accurately segmented according to the coding rule formulated by the operator, and then the original value corresponding to each segment is compared with the coding rule, so as to obtain accurate administrative division information.
The second type: aiming at the IPv6 addresses of non-operators, the 128-bit IPv6 addresses are segmented according to coding rules specified in the communication industry standard, and the related coding rules are compared to obtain rough administrative division information.
Thus, for an input IPv6 address, the geographical location information to which the IPv6 address belongs is generated in the IPv6 address base, and the index of the IPv6 address in the IPv6 address base is generated, so that the information construction about the IPv6 address is completed in the IPv6 address base, the geographical location information to which the IPv6 address belongs can be quickly inquired in the IPv6 address base based on the index, and on the basis, the IPv6 address base constructed by the method can realize quick inquiry and source tracing of the IPv6 address.
In the embodiment of the present application, the library element of the IPv6 address library is composed of the following 7 elements: a Start IP address (Start _ InitIP), an End IP address (End _ InitIP), a Country (Country), a province (provision/State), a City (City), a District (partition), and a Longitude and Latitude (Longitude and lautude). That is, each IPv6 address in the IPv6 address pool corresponds to the following elements: the starting IP address, the ending IP address, the country, the province, the city, the district, the latitude and the longitude, namely, each IPv6 address corresponds to seven tuples in an IPv6 address base: [ Start _ InitiaP | End _ InitiaP | Country | Provision or State | City | District | Longitude ] and Latitude ]. The country, province, city, district, longitude and latitude belong to the geographic location information, so that the country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address base are determined based on the second information corresponding to the IPv6 address.
In addition, the start IP address and the end IP address in the seven-tuple are used to characterize the address segment where the IPv6 address is located. In the embodiment of the application, the original 128-bit address of the IPv6 address is converted according to a set rule, and the converted value is a corresponding value capable of uniquely marking the IPv6 address, so here, the first information corresponding to the IPv6 address is stored in the IPv6 address base as any one of the following items:
the corresponding value of the initial IP address corresponding to the IPv6 address;
a corresponding value of an end IP address corresponding to the IPv6 address;
and the corresponding value of any IP address between the starting IP address corresponding to the IPv6 address and the ending IP address corresponding to the IPv6 address.
For example, the first IPv6 address is the initial IP address of the address segment, and then the first information corresponding to the first IPv6 address is stored in the IPv6 address base as the corresponding value of the initial IP address corresponding to the first IPv6 address; the second IPv6 address is the ending IP address of the address segment where the second IPv6 address is located, and the first information corresponding to the second IPv 3832 address is stored in the IPv6 address base as a corresponding value of the ending IP address corresponding to the second IPv6 address; the third IPv6 address is the middle IP address of the address segment, and then the first information corresponding to the third IPv6 address is stored in the IPv6 address base as the corresponding value of any IP address between the address segments. Moreover, it should be understood that, when the first IPv6 address, the second IPv6 address and the third IPv6 address are all in the same address segment, a starting IP address in the seven-tuple corresponding to each IPv6 address in the three IPv6 addresses is consistent, that is, the first information corresponding to the generated first IPv6 address, and an ending IP address in the seven-tuple corresponding to each IPv6 address in the three IPv6 addresses is consistent, that is, the first information corresponding to the generated second IPv6 address.
In the embodiment of the application, two different methods are provided for generating the first information corresponding to the IPv6 address, and the two methods have the common point that the corresponding first information is generated based on the partial address fragment by segmenting the IPv6 address, intercepting the partial address fragment therein. Based on this, in an embodiment, the generating corresponding first information in the IPv6 address base based on the input IPv6 address includes:
extracting the first 64 bits of the input IPv6 address to obtain a first address segment;
generating corresponding first information in the IPv6 address base based on the first address segment.
In practical application, according to the encoding rule of the IPv6 address, the last 64 bits of the 128-bit IPv6 address are mainly used for identifying the host, and therefore, the address segment does not contain the home geographical location information corresponding to the IPv6 address. Based on this, only the first 64 bits of the IPv6 address are extracted as the first address segment, and the corresponding first information is generated based on the first address segment, while the last 64 bits of the IPv6 address are directly truncated and are not used for generating the first information, so that the processing speed of the IPv6 address library construction process and the subsequent query and source tracing process can be increased, the information processing efficiency is improved, and the space storage complexity of the IPv6 address library is also reduced.
In one embodiment, the generating corresponding first information in the IPv6 address base based on the first address segment includes:
correspondingly converting the four groups of hexadecimal numerical values into four decimal numerical values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
the first address segment is composed of the four groups of hexadecimal numerical values in sequence; t isiAnd characterizing the decimal value corresponding to the ith group of hexadecimal values in the first address segment.
Assume that the first 64 bits of the original IPv6 address are constructed as follows:
S1S2S3S4:S5S6S7S8:S9S10S11S12:S13S14S15S16where, each Si (i ═ 1,2, …,16) is a hexadecimal value converted from a 4-bit binary. In the process of generating the first information, the hexadecimal value "S" is first set1S2S3S4"conversion to decimal value T1The hexadecimal value "S5S6S7S8"conversion to decimal value T2The hexadecimal value "S9S10S11S12"conversion to decimal value T3The hexadecimal value "S13S14S15S16"conversion to decimal value T4Then based onCalculating T1*248+T2*232+T3*216+T4And taking the calculation result as first information corresponding to the original IPv6 address, namely an index of the original IPv6 address in an IPv6 address library for addressing. The calculation result is stored as a value corresponding to Start _ InitIP corresponding to the original IPv6 address, or stored as a value corresponding to End _ InitIP corresponding to the original IPv6 address, or stored as a value between a value corresponding to Start _ InitIP corresponding to the original IPv6 address and a value corresponding to End _ InitIP corresponding to the original IPv6 address.
In one embodiment, the generating corresponding first information in the IPv6 address base based on the first address segment includes:
sequentially dividing the first address segment into m sub-segments; each sub-segment in the m sub-segments corresponds to a set bit number;
correspondingly converting the m subsections into m decimal values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
Ticharacterizing the ith decimal value; ciAnd representing the set digit corresponding to the subsection corresponding to the ith decimal value.
Likewise, assume that the first 64 bits of the original IPv6 address are constructed as follows:
S1S2S3S4:S5S6S7S8:S9S10S11S12:S13S14S15S16where, each Si (i ═ 1,2, …,16) is a hexadecimal value into which a 4-bit binary conversion is performed. In the process of generating the first information, the 64-bit IPv6 address segment is first divided into m sub-segments according to a set segmentation rule, and each of the m sub-segments corresponds to a set number of bits according to the set segmentation rule. For example, the number of bits corresponding to each of the m sub-segments is, in order: c1,C2,…,CmThen there is C1+C2+…+Cm64. For example, the 64-bit IPv6 address segment is divided into 6 sub-segments, and the number of bits corresponding to each sub-segment is 20, 4, 8, 4, and 20 in sequence. Secondly, after m subsections are obtained, each subsection is respectively converted into a corresponding decimal value T1,T2,…,TmThen calculate T1*2C1+T2*2C2+…Tm*2Cm+T4And taking the calculation result as first information corresponding to the original IPv6 address, namely an index of the original IPv6 address in an IPv6 address library for addressing. The calculation result is stored as a value corresponding to Start _ InitIP corresponding to the original IPv6 address, or stored as a value corresponding to End _ InitIP corresponding to the original IPv6 address, or stored as a value between a value corresponding to Start _ InitIP corresponding to the original IPv6 address and a value corresponding to End _ InitIP corresponding to the original IPv6 address.
In the method for constructing the IPv6 address library, by receiving an input IPv6 address, generating corresponding first information in an IPv6 address library based on the input IPv6 address, obtaining an index of the input IPv6 address in the IPv6 address library, and generating corresponding second information in the IPv6 address library based on the input IPv6 address, and obtaining a geographic location to which the input IPv6 address belongs, in this way, for the input IPv6 address, by generating geographic location information to which the IPv6 address belongs in the IPv6 address library and generating an index of the IPv6 address in an IPv6 address library, information construction about the IPv6 address is completed in an IPv6 address library, and subsequently, by quickly querying the IPv6 address library for the geographic location information to which the IPv6 address belongs based on the index, on this basis, the IPv6 address library constructed by the above method can realize quick query and tracing of the IPv6 address, the IPv6 address library constructed by the method has strong universality and simple realization, can be suitable for one unit organization, one industry, one country and even the world, and is convenient for large-scale popularization.
In order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides a system for constructing an IPv6 address library, as shown in fig. 2, where the system includes:
a receiving module 201, configured to receive an input IPv6 address;
a first generating module 202, configured to generate corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
a second generating module 203, configured to generate corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
In an embodiment, the first generating module 202 is configured to:
extracting the first 64 bits of the input IPv6 address to obtain a first address segment;
generating corresponding first information in the IPv6 address base based on the first address segment.
In one embodiment, the first generating module 202 generates corresponding first information in the IPv6 address base based on the first address segment, including:
correspondingly converting the four groups of hexadecimal numerical values into four decimal numerical values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
the first address segment is composed of the four groups of hexadecimal numerical values in sequence; t isiAnd characterizing the decimal value corresponding to the ith group of hexadecimal values in the first address segment.
In one embodiment, the first generating module 202 generates corresponding first information in the IPv6 address base based on the first address segment, including:
sequentially dividing the first address segment into m sub-segments; each sub-segment in the m sub-segments corresponds to a set bit number;
correspondingly converting the m subsections into m decimal values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
Ticharacterizing the ith decimal value; ciAnd representing the set digits corresponding to the subsections corresponding to the ith decimal value.
In an embodiment, the first generating module 203 is configured to:
analyzing the input IPv6 address to obtain corresponding administrative division information;
and determining longitude and latitude information corresponding to the input IPv6 address based on the corresponding administrative division information.
In one embodiment, each IPv6 address in the IPv6 address pool corresponds to the following elements: start IP address, end IP address, country, province, city, district, latitude and longitude.
In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address base as any one of the following items:
the corresponding value of the initial IP address corresponding to the IPv6 address;
a corresponding value of an end IP address corresponding to the IPv6 address;
a corresponding value of any IP address between a starting IP address corresponding to the IPv6 address and an ending IP address corresponding to the IPv6 address;
the country, province, city, region, longitude and latitude corresponding to the IPv6 address in the IPv6 address base are determined based on the second information corresponding to the IPv6 address.
In practical application, the receiving module 201 can be implemented by a communication interface in a building system of an IPv6 address base; the first generating unit 202 and the second generating unit 203 may be implemented by a processor in a construction system of an IPv6 address base.
It should be noted that: in the IPv6 address library construction system provided in the above embodiment, when the IPv6 address library is constructed, only the division of the program modules is taken as an example, and in practical applications, the above processing may be distributed to different program modules as needed, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the above-described processing. In addition, the construction system of the IPv6 address base provided in the foregoing embodiment and the construction method embodiment of the IPv6 address base belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
Based on the hardware implementation of the program module, and in order to implement the method for constructing the IPv6 address base in the embodiment of the present application, an embodiment of the present application further provides an electronic device, as shown in fig. 3, where the electronic device 300 includes:
a first communication interface 301 capable of performing information interaction with other network nodes;
the first processor 302 is connected to the first communication interface 301 to implement information interaction with other network nodes, and is configured to execute the method provided by one or more of the above technical solutions when running a computer program. And the computer program is stored on the first memory 303.
Specifically, the first communication interface 301 is configured to receive an input IPv6 address;
the first processor 302 is configured to generate corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
the first processor 302, further configured to generate corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
In an embodiment, the first processor 302 is configured to:
extracting the first 64 bits of the input IPv6 address to obtain a first address segment;
generating corresponding first information in the IPv6 address base based on the first address segment.
In one embodiment, the first processor 302 generates corresponding first information in the IPv6 address base based on the first address segment, including:
correspondingly converting the four groups of hexadecimal numerical values into four decimal numerical values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
the first address segment is composed of the four groups of hexadecimal numerical values in sequence; t isiAnd characterizing the decimal value corresponding to the ith group of hexadecimal values in the first address segment.
In one embodiment, the first processor 302 generates corresponding first information in the IPv6 address base based on the first address segment, including:
sequentially dividing the first address segment into m sub-segments; each sub-segment in the m sub-segments corresponds to a set bit number;
correspondingly converting the m subsections into m decimal values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
Ticharacterize the ithDecimal numerical values; ciAnd representing the set digit corresponding to the subsection corresponding to the ith decimal value.
In an embodiment, the first processor 302 generates corresponding second information in the IPv6 address base based on the input IPv6 address, including:
analyzing the input IPv6 address to obtain corresponding administrative division information;
and determining longitude and latitude information corresponding to the input IPv6 address based on the corresponding administrative division information.
In one embodiment, each IPv6 address in the IPv6 address pool corresponds to the following elements: start IP address, end IP address, country, province, city, district, latitude and longitude.
In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address base as any one of the following items:
the corresponding value of the initial IP address corresponding to the IPv6 address;
a corresponding value of an end IP address corresponding to the IPv6 address;
a corresponding value of any IP address between a starting IP address corresponding to the IPv6 address and an ending IP address corresponding to the IPv6 address;
the country, province, city, region and longitude and latitude corresponding to the IPv6 address in the IPv6 address base are determined based on the second information corresponding to the IPv6 address.
It should be noted that: the specific processing procedures of the first processor 302 and the first communication interface 301 can be understood with reference to the above-described methods.
Of course, in practice, the various components in the electronic device 300 are coupled together by a bus system 304. It will be appreciated that the bus system 304 is used to enable communications among the components. The bus system 304 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 304 in fig. 3.
The first memory 303 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 300. Examples of such data include: any computer program for operating on the electronic device 300.
The method disclosed in the embodiment of the present application can be applied to the first processor 302, or implemented by the first processor 302. The first processor 302 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the first processor 302. The first Processor 302 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The first processor 302 may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium located in the first memory 303, and the first processor 302 reads the information in the first memory 303 and completes the steps of the foregoing method in combination with its hardware.
In an exemplary embodiment, the electronic Device 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
It is understood that the first memory 303 of the embodiments of the present application may be a volatile memory or a non-volatile memory, and may include both volatile and non-volatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memories described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.
In an exemplary embodiment, the present application further provides a storage medium, specifically a computer-readable storage medium, for example, a first memory 303 storing a computer program, where the computer program is executable by the first processor 302 of the electronic device 300 to complete the steps of the aforementioned method for constructing the IPv6 address library. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The technical means described in the embodiments of the present application may be arbitrarily combined without conflict.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.
Claims (11)
1. A method for constructing an IPv6 address base is characterized by comprising the following steps:
receiving an incoming IPv6 address;
generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address library;
generating corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
2. The method of claim 1, wherein the generating corresponding first information in an IPv6 address base based on the input IPv6 address comprises:
extracting the first 64 bits of the input IPv6 address to obtain a first address segment;
generating corresponding first information in the IPv6 address base based on the first address segment.
3. The method according to claim 2, wherein the generating corresponding first information in the IPv6 address base based on the first address segment comprises:
correspondingly converting the four groups of hexadecimal numerical values into four decimal numerical values;
based onGenerating corresponding first information(ii) a Wherein the content of the first and second substances,
the first address segment is composed of the four groups of hexadecimal numerical values in sequence; t isiAnd characterizing the decimal value corresponding to the ith group of hexadecimal values in the first address segment.
4. The method of claim 2, wherein the generating corresponding first information in the IPv6 address base based on the first address segment comprises:
sequentially dividing the first address segment into m sub-segments; each sub-segment in the m sub-segments corresponds to a set bit number;
correspondingly converting the m subsections into m decimal values;
based onGenerating corresponding first information; wherein the content of the first and second substances,
Ticharacterizing the ith decimal value; ciAnd representing the set digits corresponding to the subsections corresponding to the ith decimal value.
5. The method of claim 1, wherein the generating corresponding second information in the IPv6 address base based on the input IPv6 address comprises:
analyzing the input IPv6 address to obtain corresponding administrative division information;
and determining longitude and latitude information corresponding to the input IPv6 address based on the corresponding administrative division information.
6. The method according to any one of claims 1 to 5, wherein each IPv6 address in the IPv6 address base corresponds to the following elements: start IP address, end IP address, country, province, city, region, latitude and longitude.
7. The method of claim 6, wherein the first information corresponding to the IPv6 address is stored in the IPv6 address base as any one of the following items:
the corresponding value of the initial IP address corresponding to the IPv6 address;
a corresponding value of an end IP address corresponding to the IPv6 address;
a corresponding value of any IP address between a starting IP address corresponding to the IPv6 address and an ending IP address corresponding to the IPv6 address;
the country, province, city, region and longitude and latitude corresponding to the IPv6 address in the IPv6 address base are determined based on the second information corresponding to the IPv6 address.
8. A construction system of an IPv6 address base is characterized by comprising the following steps:
the receiving module is used for receiving an input IPv6 address;
the first generation module is used for generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
a second generating module, configured to generate corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
9. An electronic device, comprising: a first processor and a first communication interface; wherein the content of the first and second substances,
the first communication interface is used for receiving an input IPv6 address;
the first processor is used for generating corresponding first information in an IPv6 address base based on the input IPv6 address; the first information characterizes an index of an input IPv6 address in the IPv6 address base;
the first processor is further used for generating corresponding second information in the IPv6 address base based on the input IPv6 address; the second information represents the geographic position corresponding to the input IPv6 address.
10. An electronic device, characterized by a first processor and a first memory for storing a computer program capable of running on the processor,
wherein the first processor is adapted to perform the steps of the method of any one of claims 1 to 7 when running the computer program.
11. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, performing the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110006206.5A CN114726825A (en) | 2021-01-05 | 2021-01-05 | IPv6 address library construction method, system, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110006206.5A CN114726825A (en) | 2021-01-05 | 2021-01-05 | IPv6 address library construction method, system, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114726825A true CN114726825A (en) | 2022-07-08 |
Family
ID=82233845
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110006206.5A Pending CN114726825A (en) | 2021-01-05 | 2021-01-05 | IPv6 address library construction method, system, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114726825A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1964311A (en) * | 2005-11-10 | 2007-05-16 | 中国科学院计算技术研究所 | A method to quickly search and update IPv6 routing list |
CN101990003A (en) * | 2010-10-22 | 2011-03-23 | 西安交通大学 | User action monitoring system and method based on IP address attribute |
US20130346202A1 (en) * | 2012-06-20 | 2013-12-26 | Microsoft Corporation | Automated IPv6, IPv4 Address Classifier |
CN110519408A (en) * | 2019-08-23 | 2019-11-29 | 赛尔网络有限公司 | A kind of IP attribution inquiry method, device, electronic equipment and storage medium |
CN111866201A (en) * | 2019-09-30 | 2020-10-30 | 新华三技术有限公司 | IPv6 multicast address generation method and device |
-
2021
- 2021-01-05 CN CN202110006206.5A patent/CN114726825A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1964311A (en) * | 2005-11-10 | 2007-05-16 | 中国科学院计算技术研究所 | A method to quickly search and update IPv6 routing list |
CN101990003A (en) * | 2010-10-22 | 2011-03-23 | 西安交通大学 | User action monitoring system and method based on IP address attribute |
US20130346202A1 (en) * | 2012-06-20 | 2013-12-26 | Microsoft Corporation | Automated IPv6, IPv4 Address Classifier |
CN110519408A (en) * | 2019-08-23 | 2019-11-29 | 赛尔网络有限公司 | A kind of IP attribution inquiry method, device, electronic equipment and storage medium |
CN111866201A (en) * | 2019-09-30 | 2020-10-30 | 新华三技术有限公司 | IPv6 multicast address generation method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109040343B (en) | Domain name resolution method and device, computer readable storage medium and electronic equipment | |
CN111629081A (en) | Internet protocol IP address data processing method and device and electronic equipment | |
CN111416880A (en) | IP address addressing method and device, computer storage medium and electronic equipment | |
CN112347377B (en) | IP address field searching method, service scheduling method, device and electronic equipment | |
CN104572755A (en) | Method for creating data index, data searching method and related device | |
CN112671948A (en) | Method and device for determining IP address belonging area, electronic equipment and storage medium | |
CN110990520B (en) | Address coding method and device, electronic equipment and storage medium | |
CN113110944A (en) | Information searching method, device, server, readable storage medium and program product | |
CN111896016A (en) | Position information processing method and device, storage medium and terminal | |
CN111859033A (en) | IP library query method and device and IP library compression method and device | |
CN114301874B (en) | IPv6 address positioning method based on IPv4 address geographical position information and electronic equipment | |
CN112256821B (en) | Chinese address completion method, device, equipment and storage medium | |
CN112235197B (en) | Parallel route searching method and system | |
CN111125216B (en) | Method and device for importing data into Phoenix | |
CN114726825A (en) | IPv6 address library construction method, system, electronic equipment and storage medium | |
CN111538796A (en) | Address normalization processing method, device, equipment and storage medium | |
CN112817983A (en) | Handle identifier analysis caching method, query method and handle identifier analysis system | |
WO2017088690A1 (en) | Method and device for retrieving domain name | |
CN109697234B (en) | Multi-attribute information query method, device, server and medium for entity | |
CN115967604A (en) | Message transmission method and device, electronic equipment and computer readable storage medium | |
CN110737678A (en) | data searching method, device, equipment and storage medium | |
CN114844658A (en) | Method, device and storage medium for determining home source address | |
CN115391568A (en) | Entity classification method, system, terminal and storage medium based on knowledge graph | |
CN114268608A (en) | Address segment retrieval method and device, electronic equipment and storage medium | |
CN114722824A (en) | Address processing method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |