Method, system, electronic device and storage medium for constructing IPv6 address library
By constructing an IPv6 address database and using the first 64 bits of the IPv6 address to generate an index and geographic location information, the problem of low efficiency in locating IPv6 address ownership information is solved, enabling fast querying and tracing of IPv6 addresses, which is suitable for multi-level application scenarios.
Patent Information
- Application Number
- CN202110006206.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-05
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-01-05
AI Technical Summary
Existing technologies cannot quickly and effectively locate the ownership information of IPv6 addresses, resulting in low efficiency in building and querying IPv6 address databases.
By receiving the input IPv6 address, the system generates the corresponding first information as an index and generates the corresponding geographical location information to build an IPv6 address database, including elements such as start IP address, end IP address, country, province, city, district, and latitude and longitude. The first 64 bits of the IPv6 address are used to segment and convert to generate an index for subsequent fast querying and tracing.
It enables fast lookup and tracing of IPv6 addresses, improves the query efficiency and universality of the IPv6 address database, and is suitable for large-scale promotion by organizations, industries, countries, and even globally.
Smart Images

Figure CN114726825B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet Protocol (IP), and in particular to a method, system, electronic device and storage medium for constructing an IPv6 address library. Background Art
[0002] IP addresses are an important basic resource for the construction of communication networks. At present, the global and Asia-Pacific IPv4 address pools have been exhausted. The IPv6 protocol, designed by the Internet Engineering Task Force (IETF) to replace the IPv4 protocol, can effectively solve the problem of insufficient IPv4 addresses by extending the address length to 128 bits.
[0003] IPv6 address allocation data and routing announcement data are updated every day, and related technologies are still unable to quickly and effectively locate the ownership information of IPv6 addresses. Summary of the invention
[0004] To solve related technical problems, the embodiments of the present application provide a method, system, electronic device and storage medium for constructing an IPv6 address library.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] The present application embodiment provides a method for constructing an IPv6 address library, including:
[0007] Receive input IPv6 address;
[0008] Based on the input IPv6 address, generate corresponding first information in the IPv6 address library; the first information represents the index of the input IPv6 address in the IPv6 address library;
[0009] Based on the input IPv6 address, corresponding second information is generated in the IPv6 address library; the second information represents the geographical location corresponding to the input IPv6 address.
[0010] In one embodiment, the generating corresponding first information in the IPv6 address library based on the input IPv6 address includes:
[0011] Extract the first 64 bits of the input IPv6 address to obtain the first address segment;
[0012] Generate corresponding first information in the IPv6 address library based on the first address segment.
[0013] In one embodiment, generating corresponding first information in the IPv6 address library based on the first address segment includes:
[0014] Convert the four sets of hexadecimal values into four decimal values;
[0015] based on Generate corresponding first information; wherein,
[0016] The first address segment is composed of the four groups of hexadecimal values in sequence; i The decimal value representing the i-th group of hexadecimal values in the first address segment corresponds to the decimal value.
[0017] In one embodiment, generating corresponding first information in the IPv6 address library based on the first address segment includes:
[0018] Dividing the first address segment into m sub-segments in sequence; each sub-segment in the m sub-segments corresponds to a set number of bits;
[0019] Convert the m sub-segments into m decimal values respectively;
[0020] based on Generate corresponding first information; wherein,
[0021] T i Represents the i-th decimal value; C i Represents the number of digits set corresponding to the subsegment corresponding to the i-th decimal value.
[0022] In one embodiment, the step of generating corresponding second information in the IPv6 address database based on the input IPv6 address includes:
[0023] Parse the input IPv6 address and obtain the corresponding administrative division information;
[0024] Based on the corresponding administrative division information, determine the latitude and longitude information corresponding to the input IPv6 address.
[0025] In one embodiment, each IPv6 address in the IPv6 address library corresponds to the following elements: starting IP address, ending IP address, country, province, city, district, longitude and latitude.
[0026] In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address library as any one of the following:
[0027] The corresponding value of the starting IP address corresponding to the IPv6 address;
[0028] The corresponding value of the end IP address corresponding to the IPv6 address;
[0029] 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;
[0030] The country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address database are determined based on the second information corresponding to the IPv6 address.
[0031] The present application also provides a system for constructing an IPv6 address library, including:
[0032] A receiving module, used for receiving an input IPv6 address;
[0033] A first generating module, configured to generate corresponding first information in an IPv6 address library based on an input IPv6 address; the first information represents an index of the input IPv6 address in the IPv6 address library;
[0034] The second generating module is used to generate corresponding second information in the IPv6 address library based on the input IPv6 address; the second information represents the geographical location corresponding to the input IPv6 address.
[0035] The embodiment of the present application also provides an electronic device, comprising: a first processor and a first communication interface; wherein,
[0036] The first communication interface is used to receive an input IPv6 address;
[0037] The first processor is used to generate corresponding first information in the IPv6 address library based on the input IPv6 address; the first information represents the index of the input IPv6 address in the IPv6 address library;
[0038] The first processor is further configured to generate corresponding second information in the IPv6 address library based on the input IPv6 address; the second information represents a geographical location corresponding to the input IPv6 address.
[0039] The embodiment of the present application also provides an electronic device, a first processor and a first memory for storing a computer program that can be run on the processor,
[0040] Wherein, the first processor is used to execute the steps of any of the above methods when running the computer program.
[0041] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0042] The method, system, electronic device and storage medium for constructing an IPv6 address library provided in the embodiments of the present application receive an input IPv6 address, generate corresponding first information in the IPv6 address library based on the input IPv6 address, obtain the index of the input IPv6 address in the IPv6 address library, and generate corresponding second information in the IPv6 address library based on the input IPv6 address to obtain the geographical location to which the input IPv6 address belongs. In this way, for the input IPv6 address, by generating geographical location information to which the IPv6 address belongs in the IPv6 address library and generating the index of the IPv6 address in the IPv6 address library, the information construction about the IPv6 address is completed in the IPv6 address library. Subsequently, the geographical location information to which the IPv6 address belongs can be quickly queried in the IPv6 address library based on the index. On this basis, the IPv6 address library constructed by the above method can realize rapid query and traceability of IPv6 addresses. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a method for constructing an IPv6 address library according to an embodiment of the present application;
[0044] Figure 2 A schematic diagram of the system structure for constructing an IPv6 address library according to an embodiment of the present application;
[0045] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0047] The present application embodiment provides a method for constructing an IPv6 address library, such as Figure 1 As shown, the method includes:
[0048] Step 101: Receive an input IPv6 address.
[0049] Here, the input IPv6 address is any 128-bit IPv6 address that needs to be entered into the IPv6 address library.
[0050] Step 102: Based on the input IPv6 address, generate corresponding first information in the IPv6 address library.
[0051] The first information represents the index of the input IPv6 address in the IPv6 address library.
[0052] In order to be able to quickly find the IPv6 address in the IPv6 address library later, the original 128-bit address of the IPv6 address is converted according to the set rules. The converted value can be used as information that can uniquely mark the corresponding IPv6 address and can be used as an index in the IPv6 address library to facilitate the subsequent search of the IPv6 address through the converted value.
[0053] Step 103: Based on the input IPv6 address, generate corresponding second information in the IPv6 address database.
[0054] The second information represents the geographical location corresponding to the input IPv6 address.
[0055] Here, the geographical location corresponding to the IPv6 address includes administrative division information, such as country, province / state, city, district, etc., and also includes latitude and longitude information.
[0056] In actual application, by parsing the 128-bit IPv6 address, in one embodiment, the corresponding second information is generated in the IPv6 address library based on the input IPv6 address, including:
[0057] Parse the input IPv6 address and obtain the corresponding administrative division information;
[0058] Based on the corresponding administrative division information, determine the latitude and longitude information corresponding to the input IPv6 address.
[0059] Here, the 128-bit IPv6 address is first segmented according to the set encoding rules corresponding to the IPv6 address, and the administrative division information corresponding to the IPv6 address is parsed based on the segmentation result. Then, the longitude and latitude information corresponding to the administrative division information is searched in the Geographic Information System (GIS) and other databases based on the obtained administrative division information, thereby obtaining the longitude and latitude information corresponding to the IPv6 address.
[0060] In actual application, when building an IPv6 address database, operators can use the following two methods to parse IPv6 addresses and obtain the corresponding administrative division information:
[0061] Category 1: For the IPv6 address of this operator, since the operator has determined the relationship between the IPv6 address and the corresponding geographical location through internal coding rules, the 128-bit IPv6 address is accurately segmented according to the coding rules formulated by the operator, and then the original value corresponding to each segment is compared with the coding rules to obtain accurate administrative division information.
[0062] Category 2: For IPv6 addresses that are not from this operator, the 128-bit IPv6 address is segmented according to the coding rules specified in the communications industry standards, and the relevant coding rules are compared to obtain rough administrative division information.
[0063] In this way, for the input IPv6 address, the geographical location information of the IPv6 address is generated in the IPv6 address library, and the index of the IPv6 address in the IPv6 address library is generated, so that the information construction about the IPv6 address is completed in the IPv6 address library. Subsequently, the geographical location information of the IPv6 address can be quickly queried in the IPv6 address library based on the index. On this basis, the IPv6 address library constructed by the above method can realize the rapid query and tracing of IPv6 addresses.
[0064] In an embodiment of the present application, the library elements of the IPv6 address library are composed of the following 7 elements: starting IP address (Start_InitIP), ending IP address (End_InitIP), country (Country), province (Provice / State), city (City), district (District) and longitude and latitude. That is to say, each IPv6 address in the IPv6 address library corresponds to the following elements: starting IP address, ending IP address, country, province, city, district, longitude and latitude, that is, each IPv6 address corresponds to a seven-tuple in the IPv6 address library: [Start_InitIP|End_InitIP|Country|Province or State|City|District|Longitude and Latitude]. Among them, country, province, city, district, longitude and latitude belong to geographical location information, therefore, the country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address library are determined based on the second information corresponding to the IPv6 address.
[0065] In addition, the starting IP address and the ending IP address in the seven-tuple are used to characterize the address segment where the IPv6 address is located. In the embodiment of the present application, the original 128-bit address of the IPv6 address is converted according to the set rules to obtain a corresponding value that can uniquely mark the IPv6 address. Therefore, here, the first information corresponding to the IPv6 address is stored in the IPv6 address library as any one of the following:
[0066] The corresponding value of the starting IP address corresponding to the IPv6 address;
[0067] The corresponding value of the end IP address corresponding to the IPv6 address;
[0068] 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.
[0069] For example, if the first IPv6 address is the starting IP address of the address segment, the first information corresponding to the first IPv6 address is stored in the IPv6 address library as the corresponding value of the starting IP address corresponding to the first IPv6 address; if the second IPv6 address is the ending IP address of the address segment, the first information corresponding to the second IPv6 address is stored in the IPv6 address library as the corresponding value of the ending IP address corresponding to the second IPv6 address; if the third IPv6 address is the middle IP address of the address segment, the first information corresponding to the third IPv6 address is stored in the IPv6 address library as the corresponding value of any IP address between the address segments. In addition, 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, the starting IP address in the seven-tuple corresponding to each of the three IPv6 addresses is consistent, that is, the first information corresponding to the generated first IPv6 address, and the ending IP address in the seven-tuple corresponding to each of the three IPv6 addresses is consistent, that is, the first information corresponding to the generated second IPv6 address.
[0070] In the embodiment of the present application, two different methods are provided to generate the first information corresponding to the IPv6 address. The common point of these two methods is that both methods segment the IPv6 address, intercept part of the address segments, and generate the corresponding first information based on the part of the address segments. Based on this, in one embodiment, the corresponding first information is generated in the IPv6 address library based on the input IPv6 address, including:
[0071] Extract the first 64 bits of the input IPv6 address to obtain the first address segment;
[0072] Generate corresponding first information in the IPv6 address library based on the first address segment.
[0073] In actual application, according to the encoding rules of IPv6 addresses, in a 128-bit IPv6 address, the last 64 bits are mainly used for host identification. Therefore, this part of the address segment does not contain the geographical location information corresponding to the IPv6 address. Based on this, only the first 64 bits of the IPv6 address are extracted here 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 will be directly truncated and not used for the first information generation. This can speed up the construction process of the IPv6 address library and the subsequent query and traceability process, improve information processing efficiency, and also reduce the spatial storage complexity of the IPv6 address library.
[0074] In one embodiment, generating corresponding first information in the IPv6 address library based on the first address segment includes:
[0075] Convert the four sets of hexadecimal values into four decimal values;
[0076] based on Generate corresponding first information; wherein,
[0077] The first address segment is composed of the four groups of hexadecimal values in sequence; i The decimal value representing the i-th group of hexadecimal values in the first address segment corresponds to the decimal value.
[0078] Assume that the first 64 bits of the original IPv6 address are composed as follows:
[0079] S1S2S3S4:S5S6S7S8:S9S 10 S 11 S 12 :S 13 S 14 S 15 S 16 , where each Si (i=1, 2, ..., 16) is a hexadecimal value converted from a 4-bit binary system. In the process of generating the first information, the hexadecimal value "S1S2S3S4" is first converted into a decimal value T1, the hexadecimal value "S5S6S7S8" is converted into a decimal value T2, and the hexadecimal value "S9S 10 S 11 S 12 " is converted to a decimal value T3, and the hexadecimal value "S 13 S 14 S 15 S 16 " is converted to a decimal value T4, and then based on Calculate T1*2 48 +T2*2 32 +T3*2 16 +T4, the calculation result is used as the first information corresponding to the original IPv6 address, that is, the index of the original IPv6 address used for addressing in the IPv6 address library. In addition, the calculation result is stored as the corresponding value of the Start_InitIP corresponding to the original IPv6 address, or is stored as the corresponding value of the End_InitIP corresponding to the original IPv6 address, or is stored as a value between the corresponding value of the Start_InitIP corresponding to the original IPv6 address and the corresponding value of the End_InitIP corresponding to the original IPv6 address.
[0080] In one embodiment, generating corresponding first information in the IPv6 address library based on the first address segment includes:
[0081] Dividing the first address segment into m sub-segments in sequence; each sub-segment in the m sub-segments corresponds to a set number of bits;
[0082] Convert the m sub-segments into m decimal values respectively;
[0083] based on Generate corresponding first information; wherein,
[0084] T i Represents the i-th decimal value; C i Represents the number of digits set corresponding to the subsegment corresponding to the i-th decimal value.
[0085] Likewise, assume that the first 64 bits of the original IPv6 address are constructed as follows:
[0086] S1S2S3S4:S5S6S7S8:S9S 10 S 11 S 12 :S 13 S 14 S 15 S 16 , where each Si (i = 1, 2, ..., 16) is a hexadecimal value converted from a 4-bit binary number. In the process of generating the first information, firstly, the 64-bit IPv6 address segment is divided into m sub-segments according to the 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: C1, C2, ..., C m , then we have C1+C2+…+C m =64. For example, the 64-bit IPv6 address segment is divided into 6 sub-segments, and the corresponding bits of each sub-segment are 20, 4, 8, 8, 4, and 20. Secondly, after obtaining m sub-segments, each sub-segment is converted into a corresponding decimal value T1, T2, ..., T m , then calculate T1*2 C1 +T2*2 C2 +…T m *2 Cm+T4, the calculation result is used as the first information corresponding to the original IPv6 address, that is, the index of the original IPv6 address used for addressing in the IPv6 address library. In addition, the calculation result is stored as the corresponding value of the Start_InitIP corresponding to the original IPv6 address, or is stored as the corresponding value of the End_InitIP corresponding to the original IPv6 address, or is stored as a value between the corresponding value of the Start_InitIP corresponding to the original IPv6 address and the corresponding value of the End_InitIP corresponding to the original IPv6 address.
[0087] The method for constructing an IPv6 address library provided in an embodiment of the present application receives an input IPv6 address, generates corresponding first information in the IPv6 address library based on the input IPv6 address, obtains an index of the input IPv6 address in the IPv6 address library, and generates corresponding second information in the IPv6 address library based on the input IPv6 address, and obtains the geographical location to which the input IPv6 address belongs. In this way, for the input IPv6 address, by generating geographical location information to which the IPv6 address belongs in the IPv6 address library and generating an index of the IPv6 address in the IPv6 address library, information construction about the IPv6 address is completed in the IPv6 address library, and subsequently the geographical location information to which the IPv6 address belongs can be quickly queried in the IPv6 address library based on the index. On this basis, the IPv6 address library constructed by the above method can realize rapid query and traceability of IPv6 addresses, and the IPv6 address library constructed by the above method has strong versatility and simple implementation, and can be applicable to a unit, an industry, a country or even the world, and is convenient for large-scale promotion.
[0088] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a system for constructing an IPv6 address library, such as Figure 2 As shown, the system includes:
[0089] Receiving module 201, used for receiving an input IPv6 address;
[0090] A first generating module 202 is used to generate corresponding first information in an IPv6 address library based on an input IPv6 address; the first information represents an index of the input IPv6 address in the IPv6 address library;
[0091] The second generating module 203 is used to generate corresponding second information in the IPv6 address database based on the input IPv6 address; the second information represents the geographical location corresponding to the input IPv6 address.
[0092] In one embodiment, the first generating module 202 is used to:
[0093] Extract the first 64 bits of the input IPv6 address to obtain the first address segment;
[0094] Generate corresponding first information in the IPv6 address library based on the first address segment.
[0095] In one embodiment, the first generating module 202 generates corresponding first information in the IPv6 address library based on the first address segment, including:
[0096] Convert the four sets of hexadecimal values into four decimal values;
[0097] based on Generate corresponding first information; wherein,
[0098] The first address segment is composed of the four groups of hexadecimal values in sequence; i The decimal value representing the i-th group of hexadecimal values in the first address segment corresponds to the decimal value.
[0099] In one embodiment, the first generating module 202 generates corresponding first information in the IPv6 address library based on the first address segment, including:
[0100] Dividing the first address segment into m sub-segments in sequence; each sub-segment in the m sub-segments corresponds to a set number of bits;
[0101] Convert the m sub-segments into m decimal values respectively;
[0102] based on Generate corresponding first information; wherein,
[0103] T i Represents the i-th decimal value; C i Represents the number of digits set corresponding to the subsegment corresponding to the i-th decimal value.
[0104] In one embodiment, the first generating module 203 is used to:
[0105] Parse the input IPv6 address and obtain the corresponding administrative division information;
[0106] Based on the corresponding administrative division information, determine the latitude and longitude information corresponding to the input IPv6 address.
[0107] In one embodiment, each IPv6 address in the IPv6 address library corresponds to the following elements: starting IP address, ending IP address, country, province, city, district, longitude and latitude.
[0108] In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address library as any one of the following:
[0109] The corresponding value of the starting IP address corresponding to the IPv6 address;
[0110] The corresponding value of the end IP address corresponding to the IPv6 address;
[0111] 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;
[0112] The country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address database are determined based on the second information corresponding to the IPv6 address.
[0113] In actual application, the receiving module 201 can be implemented by a communication interface in the construction system of the IPv6 address library; the first generation unit 202 and the second generation unit 203 can be implemented by a processor in the construction system of the IPv6 address library.
[0114] It should be noted that: the IPv6 address library construction system provided in the above embodiment only uses the division of the above program modules as an example when constructing the IPv6 address library. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the IPv6 address library construction system provided in the above embodiment and the IPv6 address library construction method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0115] Based on the hardware implementation of the above program modules, and in order to implement the method for constructing the IPv6 address library in the embodiment of the present application, the embodiment of the present application also provides an electronic device, such as Figure 3 As shown, the electronic device 300 includes:
[0116] The first communication interface 301 is capable of exchanging information with other network nodes;
[0117] The first processor 302 is connected to the first communication interface 301 to implement information exchange with other network nodes, and is used to execute the method provided by one or more of the above technical solutions when running a computer program. The computer program is stored in the first memory 303.
[0118] Specifically, the first communication interface 301 is used to receive an input IPv6 address;
[0119] The first processor 302 is configured to generate corresponding first information in an IPv6 address library based on an input IPv6 address; the first information represents an index of the input IPv6 address in the IPv6 address library;
[0120] The first processor 302 is further configured to generate corresponding second information in the IPv6 address library based on the input IPv6 address; the second information represents a geographical location corresponding to the input IPv6 address.
[0121] In one embodiment, the first processor 302 is configured to:
[0122] Extract the first 64 bits of the input IPv6 address to obtain the first address segment;
[0123] Generate corresponding first information in the IPv6 address library based on the first address segment.
[0124] In one embodiment, the first processor 302 generates corresponding first information in the IPv6 address library based on the first address segment, including:
[0125] Convert the four sets of hexadecimal values into four decimal values;
[0126] based on Generate corresponding first information; wherein,
[0127] The first address segment is composed of the four groups of hexadecimal values in sequence; i The decimal value representing the i-th group of hexadecimal values in the first address segment corresponds to the decimal value.
[0128] In one embodiment, the first processor 302 generates corresponding first information in the IPv6 address library based on the first address segment, including:
[0129] Dividing the first address segment into m sub-segments in sequence; each sub-segment in the m sub-segments corresponds to a set number of bits;
[0130] Convert the m sub-segments into m decimal values respectively;
[0131] based on Generate corresponding first information; wherein,
[0132] T i Represents the i-th decimal value; C i Represents the number of digits set corresponding to the subsegment corresponding to the i-th decimal value.
[0133] In one embodiment, the first processor 302 generates corresponding second information in the IPv6 address database based on the input IPv6 address, including:
[0134] Parse the input IPv6 address and obtain the corresponding administrative division information;
[0135] Based on the corresponding administrative division information, determine the latitude and longitude information corresponding to the input IPv6 address.
[0136] In one embodiment, each IPv6 address in the IPv6 address library corresponds to the following elements: starting IP address, ending IP address, country, province, city, district, longitude and latitude.
[0137] In one embodiment, the first information corresponding to the IPv6 address is stored in the IPv6 address library as any one of the following:
[0138] The corresponding value of the starting IP address corresponding to the IPv6 address;
[0139] The corresponding value of the end IP address corresponding to the IPv6 address;
[0140] 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;
[0141] The country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address database are determined based on the second information corresponding to the IPv6 address.
[0142] It should be noted that the specific processing process of the first processor 302 and the first communication interface 301 can be understood by referring to the above method.
[0143] Of course, in actual application, the various components in the electronic device 300 are coupled together through the bus system 304. It can be understood that the bus system 304 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 304 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 3 Various buses are labeled as bus system 304 .
[0144] 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 used to operate on the electronic device 300.
[0145] The method disclosed in the above 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 with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 302. The above-mentioned first processor 302 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The first processor 302 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is 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 above method in combination with its hardware.
[0146] In an exemplary embodiment, the electronic device 300 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0147] It can be understood that the first memory 303 of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can 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, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example 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), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0148] In an exemplary embodiment, the embodiment of the present application further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory 303 storing a computer program, and the above-mentioned computer program can be executed 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 can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0149] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0150] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0151] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for constructing an IPv6 address library, characterized in that: include: Receive input IPv6 address; Extract the first 64 bits of the input IPv6 address to obtain the first address segment; Convert the four sets of hexadecimal values into four decimal values; based on Generate corresponding first information; wherein the first address segment is composed of the four groups of hexadecimal values in sequence; T i A decimal value corresponding to the i-th group of hexadecimal values in the first address segment; the first information represents the index of the input IPv6 address in the IPv6 address library; Based on the input IPv6 address, corresponding second information is generated in the IPv6 address library; the second information represents the geographical location corresponding to the input IPv6 address.
2. The method according to claim 1, characterized in that The generating corresponding first information in the IPv6 address library based on the first address segment includes: Dividing the first address segment into m sub-segments in sequence; each sub-segment in the m sub-segments corresponds to a set number of bits; Convert the m sub-segments into m decimal values respectively; based on Generate corresponding first information; wherein, T i Represents the i-th decimal value; C i Represents the number of digits set corresponding to the subsegment corresponding to the i-th decimal value.
3. The method according to claim 1, characterized in that: The step of generating corresponding second information in the IPv6 address library based on the input IPv6 address includes: Parse the input IPv6 address and obtain the corresponding administrative division information; Based on the corresponding administrative division information, determine the latitude and longitude information corresponding to the input IPv6 address.
4. The method according to any one of claims 1 to 3, characterized in that: Each IPv6 address in the IPv6 address database corresponds to the following elements: starting IP address, ending IP address, country, province, city, district, longitude and latitude.
5. The method according to claim 4, characterized in that The first information corresponding to the IPv6 address is stored in the IPv6 address library as any one of the following: The corresponding value of the starting IP address corresponding to the IPv6 address; The corresponding value of the end IP address corresponding to the IPv6 address; 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; The country, province, city, district, longitude and latitude corresponding to the IPv6 address in the IPv6 address database are determined based on the second information corresponding to the IPv6 address.
6. A system for constructing an IPv6 address library, characterized in that: include: A receiving module, used for receiving an input IPv6 address; A first generating module is used to extract the first 64 bits of the input IPv6 address to obtain a first address segment; Convert the four sets of hexadecimal values into four decimal values; based on Generate corresponding first information; wherein the first address segment is composed of the four groups of hexadecimal values in sequence; T i A decimal value corresponding to the i-th group of hexadecimal values in the first address segment; the first information represents the index of the input IPv6 address in the IPv6 address library; The second generating module is used to generate corresponding second information in the IPv6 address library based on the input IPv6 address; the second information represents the geographical location corresponding to the input IPv6 address.
7. An electronic device, characterized in that: include: A first processor and a first communication interface; wherein, The first communication interface is used to receive an input IPv6 address; The first processor is used to extract the first 64 bits of the input IPv6 address to obtain a first address segment; convert the four groups of hexadecimal values into four decimal values; based on Generate corresponding first information; wherein the first address segment is composed of the four groups of hexadecimal values in sequence; T i A decimal value corresponding to the i-th group of hexadecimal values in the first address segment; the first information represents the index of the input IPv6 address in the IPv6 address library; The first processor is further configured to generate corresponding second information in the IPv6 address library based on the input IPv6 address; the second information represents a geographical location corresponding to the input IPv6 address.
8. An electronic device, characterized in that: a first processor and a first memory for storing a computer program executable on the processor, Wherein, when the first processor is used to run the computer program, the steps of the method described in any one of claims 1 to 5 are executed.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
