IP configuration information management method, device, and electronic device
By creating an IP information block chain based on the parent-child relationship and routing relationship of IP addresses in the router device, the problem of insufficient IP address correlation in the existing technology is solved, efficient IP configuration information management is realized, and the efficiency of configuration information management is improved. and ability.
Patent Information
- Application Number
- CN202211012899.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-08-23
AI Technical Summary
In the existing technology, IP addresses are stored separately in text or other data formats in the database, resulting in the inability to reflect the correlation between IP addresses, resulting in low efficiency of IP configuration information management, computing resource bottlenecks, and limited configuration information management capabilities.
By collecting the IP configuration information of the router device, based on the parent-child relationship and routing relationship of the IP address, an IP information block chain is created, the IP address and the IP address Hash value table are recorded, and multiple IP information blocks are connected into a chain based on the Hash value table to manage the router. IP configuration information of the device.
It improves the efficiency of IP configuration information management, provides more comprehensive configuration information management capabilities, reduces the calculation amount of finding and managing IP address configuration information, and improves the efficiency of configuration information comparison and query.
Smart Images

Figure CN115499362B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an IP configuration information management method, device, electronic device, and computer-readable storage medium. Background Art
[0002] Usually in the three-layer network communication network, the IP (Internet Protocol Address) address is stored in the database of the router device after it is released, and the routing protocol calculates and maintains the routing direction and announces the routing information. Calculating the subnet IP segment contained in the IP, IP address routing information, querying IP detailed configuration information, recording the historical details of the IP used by the user, etc., all require the CPU computing power and storage capacity of the device itself, that is, the performance of a single router device itself becomes the bottleneck of the SDN (Software Defined Network) automated, batched, and fast operation and maintenance of the data communication network. With the emergence of cloud computing and big data technologies, the computing layer and forwarding layer of the communication network are stripped away, and the computing layer is realized through an independent computer system, which can provide powerful computing power and sufficient storage for SDN in an upgraded dimension, and no longer rely on the capabilities of the central processing unit of the router itself.
[0003] However, in the computer system of the prior art, IP addresses are stored individually in the database in text or other data formats, and the association between each IP address or IP address segment cannot be reflected. It still needs to be operated and maintained according to the routing algorithm in the router device, which is not only inefficient, but also has a computing resource bottleneck, and the configuration information management capability is limited.
[0004] It can be seen that the IP configuration information management method in the prior art is in urgent need of improvement. Summary of the invention
[0005] The embodiments of the present application provide an IP configuration information management method and device, which can improve the efficiency of IP configuration information management and output more comprehensive configuration information management capabilities.
[0006] In a first aspect, an embodiment of the present application provides an IP configuration information management method, including:
[0007] Collecting IP configuration information of a router device in a target communication network, wherein the IP configuration information includes: an IP address of the router device;
[0008] For each of the router devices, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, wherein the IP information block chain includes multiple IP information blocks, and the data recorded in the IP information block includes: an IP address and an IP address Hash value (a value obtained by performing a hash operation) table, the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address Hash value table;
[0009] Based on the data recorded in each IP information block in the IP information block chain, the IP configuration information of the corresponding router device is managed.
[0010] In a second aspect, an embodiment of the present application provides an IP configuration information management device, including:
[0011] An IP configuration information collection module is used to collect IP configuration information of a router device in a target communication network, wherein the IP configuration information includes: an IP address of the router device;
[0012] An IP information block chain creation module is used to create an IP information block chain corresponding to the IP address of the corresponding router device for each of the router devices according to the IP configuration information of the router device and based on the parent-child relationship and / or routing relationship of the IP address, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address Hash value table, the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address Hash value table;
[0013] The IP configuration information management module is used to manage the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain.
[0014] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the IP configuration information management method described in the embodiment of the present application when executing the computer program.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the IP configuration information management method disclosed in the embodiment of the present application are performed.
[0016] The IP configuration information management method disclosed in the embodiment of the present application collects IP configuration information of router devices in the target communication network, wherein the IP configuration information includes: the IP address of the router device; for each of the router devices, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address hash value table, the IP address hash value table records the hash value of the IP address in the next IP information block of the corresponding IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address hash value table; based on the data recorded by each of the IP information blocks in the IP information block chain, the IP configuration information of the corresponding router device is managed, which can improve the efficiency of IP configuration information management and provide more comprehensive configuration information management capabilities.
[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] Figure 1 is a flow chart of the IP configuration information management method in an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of the IP information block field structure in the IP configuration information management method in the embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of the IP configuration information management data structure in an embodiment of the present application;
[0022] Figure 4 It is one of the structural diagrams of the IP configuration information management device in the embodiment of the present application;
[0023] Figure 51 is a schematic diagram of the structure of the IP configuration information management device in the embodiment of the present application;
[0024] Figure 6 A block diagram schematically shows an electronic device for executing the method according to the present application; and
[0025] Figure 7 A storage unit for holding or carrying a program code for implementing the method according to the present application is schematically shown. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] like Figure 1 As shown, an IP configuration information management method disclosed in an embodiment of the present application includes: steps 110 to 130.
[0028] Step 110: Collect IP configuration information of a router device in the target communication network, wherein the IP configuration information includes: an IP address of the router device.
[0029] The target communication network described in the embodiment of the present application can be an IP metropolitan area network, an IP backbone network, etc. In the target communication network, there are several router devices that publish IP address configuration information, such as an IP metropolitan area network aggregation router, a three-layer core aggregation router, etc.
[0030] In some embodiments of the present application, the IP configuration information of router devices such as the core router of the data core network and the IP metropolitan area network aggregation router in the target communication network can be collected through the SSH network management interface by the network management collection module in the RPC (remote procedure call) server mode. For example, the Web page service module and the scheduled push service module call and execute the network management information collection task through the RPC protocol to collect the IP configuration information on the three-layer core aggregation router of the entire IP metropolitan area network.
[0031] In some embodiments of the present application, the IP configuration information of the router device includes but is not limited to the following information: the IP address of the router device, the IP address segment published by the router device, the static IP routes published by the router device, the IP addresses allocated for use within the specified IP address segment, and the configuration details of the IP address and other IP configuration information that needs to be maintained.
[0032] Step 120: for each of the router devices, according to the IP configuration information of the router device and based on the parent-child relationship and / or routing relationship of the IP addresses, create an IP information block chain corresponding to the IP address of the corresponding router device.
[0033] Among them, the IP information block chain includes multiple IP information blocks, and the data recorded in the IP information block includes: IP address and IP address Hash value table, the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address Hash value table.
[0034] After obtaining the IP configuration information of each router device, an IP information block chain describing the IP configuration information of the router device can be created for each router device. The IP information block chain is usually composed of multiple IP information blocks, each of which corresponds to an IP address or IP address segment issued by the router device. In addition, for the allocated IP address, the corresponding IP information block further records the configuration details of the IP address.
[0035] In some embodiments of the present application, Figure 2 As shown, the IP information block includes two parts of data: a block header and a block body. The block body is used to store the configuration details of the IP address (i.e., detailed configuration information), and the block header is used to store information for searching or comparing IP information blocks, as well as determining the association between IP addresses corresponding to IP information blocks.
[0036] like Figure 2 As shown, the block header includes but is not limited to the following five fields: IP address hash value table, IP address, hash value, IP information block type identifier, and creation timestamp. The meaning of each field is explained below.
[0037] The IP address is used to record the IP address corresponding to the IP information block.
[0038] The creation timestamp is used to record the modification time of the IP information block.
[0039] The type identifier of the IP information block is used to record the chain type of the IP node corresponding to the IP information block (i.e., the IP node corresponding to the IP address recorded by the IP information block). The type identifier is generally used for static routing marking to distinguish the chains of parent-child IP address segments. In the entire IP information block chain, the chain between the parent IP address segment and the child IP address has different attributes from the chain generated by static IP routing, and the value of this field is required as a mark.
[0040] In some embodiments of the present application, the Hash value can be used to record the Hash value obtained after the block body data of the IP information block is hashed according to a preset method. For example, the hash value of the block body data (i.e., the configuration details information) is calculated by using a hash value tree to calculate the root node value of the hash value. The hash value tree is a way to hash a large number of aggregated data "blocks". It relies on splitting these data "blocks" into smaller units of data blocks, each of which contains only a few data "blocks", and then taking each bucket (bucket, a data unit) unit data block and hashing it again, repeating the same process until the total number of remaining hashes is only 1.
[0041] In other embodiments of the present application, other methods may be used to perform hash operations on block data, which are not listed here one by one.
[0042] The IP address hash value table is used to record the hash value table of the IP addresses corresponding to each sub-IP node (for example, the IP node corresponding to the IP address segment corresponding to the IP information block has been assigned the IP address) of the IP node corresponding to the IP information block (that is, the IP node corresponding to the IP address recorded by the IP information block). For example, according to the structural characteristics of the IP address, the IP address of 192.168.4.1 / 24 can be divided into two IP addresses: 192.168.4.1 / 25 and 192.168.4.128 / 25. Correspondingly, for a certain IP information block in the IP address information chain (for example, the IP information block corresponding to the IP address 192.168.4.1 / 24), the IP address hash value table in the IP information block records the IP information block (that is, the IP address The hash value of the IP addresses (i.e., IP address 192.168.4.1 / 25 and IP address 192.168.4.128 / 25) recorded in the IP information block corresponding to the IP node corresponding to the IP information block corresponding to the IP address 192.168.4.1 / 24 (i.e., the IP node corresponding to the IP address 192.168.4.1 / 25, and the IP node corresponding to the IP address segment 192.168.4.128 / 25).
[0043] The IP address hash value table can be stored in a Map table format, for example, as: Map<Integer,Hash> Format. Still taking the aforementioned IP address of 192.168.4.1 / 24 as an example, the IP address hash value table recorded in the IP information block corresponding to the IP node corresponding to the IP address 192.168.4.1 / 24 can be expressed as Map<0, Hash1; 1, Hash2>, where Hash1 and Hash2 represent the hash values of the IP address segment 192.168.4.1 / 25 and the IP address 192.168.4.128 / 25, respectively. From the above analysis, it can be seen that according to the IP address hash value table in the IP information block, an association between an IP information block and two IP information blocks can be established, that is, an association between an IP address and the two IP addresses included in the IP address segment (in the embodiment of the present application, they can be recorded as the parent IP address and the child IP address) can be established. In this way, the association between the IP addresses recorded in multiple IP address hash value tables constructs a binary tree-like parent-child relationship of the IP addresses.
[0044] For a router device, it can publish multiple IP address segments and multiple static IP routes. Therefore, the block header of the IP information block is of non-fixed length and is suitable for recording hash value tables of different numbers of IP addresses.
[0045] As mentioned above, the IP configuration information includes: the IP address of the router device, the static IP route and IP address segment published by the router device, and the assigned IP address in the specified IP address segment, the configuration details of the IP address, etc. In some embodiments of the present application, the IP information block corresponding to each IP address can be first constructed, and the configuration details of the IP address, as well as the IP address value, the creation timestamp, the Hash value, the type identifier of the IP information block, etc. can be recorded in the IP information block. After that, according to the parent-child relationship and the routing relationship of the IP address, the IP address Hash value table in each IP information block is generated, so as to record the association of each IP address through the IP address Hash value table, thereby recording more comprehensive IP configuration information of the router device through the IP information block chain.
[0046] Correspondingly, in some embodiments of the present application, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, including the following sub-steps 1201 to 1204.
[0047] Sub-step 1201: Create an IP information block corresponding to the ancestor IP node according to the IP address of the router device.
[0048] In an embodiment of the present application, an IP information block chain can be generated based on the IP configuration information of each router device, that is, the IP address of each router device corresponds to an IP information block chain. In an embodiment of the present application, it is defined that each IP address corresponds to an IP node. The IP node corresponding to the IP address of the router device is recorded as the ancestor IP node. Based on the routing relationship and parent-child relationship of the IP address, the IP nodes corresponding to each IP address also have a parent-child relationship. For example, the IP node corresponding to the IP address of the static IP route published by the router device is the child IP node of the ancestor IP node corresponding to the IP address of the router device. For another example, the IP node corresponding to the IP address segment (such as IP address 192.168.4.1 / 24) published by the router device is the child IP node of the ancestor IP node corresponding to the IP address of the router device.
[0049] When creating an IP information block corresponding to the IP address of the router device, the IP address field in the created IP information block records the IP address of the router device, the hash value field can record the hash value obtained by performing a hash operation on the detailed configuration information of the IP address of the router device according to a preset method, and the value of the type identifier field of the IP information block can be set to 0, for example, to indicate that the IP information block is located in a parent-child relationship chain.
[0050] Sub-step 1202: creating IP information blocks corresponding to the child IP nodes of the ancestor IP node respectively according to the IP address segment published by the router device.
[0051] In the embodiment of the present application, the IP node corresponding to the IP address segment published by the router device is a child IP node of the ancestor node corresponding to the IP address of the router device.
[0052] For each IP address segment published by the router device, an IP information block corresponding to each IP address segment is created. In the created IP information block, the IP address field records the corresponding IP address, the hash value field can record the hash value obtained by performing a hash operation on the detailed configuration information of the IP address segment according to a preset method, and the value of the type identifier field of the IP information block can be set to 0, for example, to indicate that the IP information block is in a parent-child relationship chain.
[0053] Sub-step 1203, creating an IP information block corresponding to the sub-IP node of the corresponding sub-IP node according to the static IP route published by the router device and / or the allocated IP address in the specified IP address segment.
[0054] When a certain IP address segment published by a router device contains a single IP address that has been allocated to a user, the IP node corresponding to the allocated IP address is the child node of the IP node corresponding to the IP address segment. When the static IP route published by the router device includes the next-hop IP address pointed to by the IP address segment, the IP node corresponding to the next-hop IP address is also the child node of the IP node corresponding to the IP address segment. That is, in this case, the IP node corresponding to the IP address segment is the child node of the ancestor IP node, the IP node corresponding to the allocated IP address, and the parent node of the IP node corresponding to the next-hop IP address pointed to by the static IP route.
[0055] In some embodiments of the present application, an IP information block corresponding to a sub-IP node of a corresponding sub-IP node is created based on the static IP route published by the router device and / or the allocated IP address within the designated IP address segment, including: creating an IP information block corresponding to a sub-IP node of a corresponding sub-IP node based on the static IP route published by the router device, and / or creating an IP information block corresponding to a sub-IP node of a corresponding sub-IP node based on the allocated IP address within the designated IP address segment published by the router device.
[0056] Among them, according to the static IP route published by the router device, an IP information block corresponding to the sub-IP node of the corresponding sub-IP node is created, including: according to the static IP route published by the router device, based on the routing relationship of the IP address, IP information blocks corresponding to the sub-IP nodes of each level of the sub-IP node corresponding to the corresponding IP address segment are created, until the IP information block corresponding to the next-hop IP address pointed to by the static IP route is created.
[0057] For each static IP route published by the router device, an IP information block can be created according to the next-hop IP address pointed to by each static IP route. In the created IP information block, the IP address field records the next-hop IP address pointed to by the static IP route, the hash value field can record the hash value obtained by performing a hash operation on the IP detailed configuration information of the next-hop IP address according to a preset method, and the value of the type identifier field of the IP information block can be set to 1, for example, to indicate that the IP information block is located in the chain of the static IP route. The next IP information block of the IP information block with the type identifier field of the IP information block set to 1 can only be empty or 1.
[0058] When creating an IP information block based on static IP routing, due to the characteristics of router usage, the IP address segment pointed to by the static route is used as the IP address, and no binary subdivision will be performed. This will not cause the problem of too many next chains and being unable to distinguish whether it is a parent-child IP segment relationship chain or a static routing chain. For example, when a router device configures a certain IP address segment (such as 192.168.4.1 / 25) as a static IP route, when creating an IP information block based on the static IP route, the IP information block corresponding to the next-hop IP address pointed to by the static IP route is directly created, and the IP node corresponding to the IP information block is used as the child node of the IP node corresponding to the IP address segment (such as 192.168.4.1 / 25), and the IP address segment (such as 192.168.4.1 / 25) is no longer binary subdivided. The type identifier field of the IP information block can effectively mark the static routing relationship.
[0059] Among them, according to the allocated IP address in the specified IP address segment published by the router device, an IP information block corresponding to the sub-IP node of the corresponding sub-IP node is created, including: according to the allocated IP address in the IP address segment published by the router device, based on the parent-child relationship of the IP address, IP information blocks corresponding to the sub-IP nodes of each level of the sub-IP node corresponding to the corresponding IP address segment are created in sequence until the IP information block corresponding to the allocated IP address is created.
[0060] For an IP address in a certain IP address segment assigned by a router device to a user, an IP information block can be created according to the IP address. In the created IP information block, the IP address field records the IP address, the hash value field can record the hash value obtained by performing a hash operation on the IP detailed configuration information of the IP address according to a preset method, and the value of the type identifier field of the IP information block can be set to 0, for example, to indicate that the IP information block is in a parent-child relationship chain.
[0061] In some embodiments of the present application, in the process of creating the IP information block corresponding to the next-hop IP address pointed to by the static IP route, and creating the IP information block corresponding to the allocated IP address, the IP information blocks corresponding to the child nodes (i.e., child IP nodes) of the IP node corresponding to the parent IP address segment are sequentially generated according to the binary pattern until the IP information block corresponding to the single IP address is finally obtained. For an unallocated IP address, an IP information block is not created. In this way, an IP address that is not allocated for use does not correspond to any IP node.
[0062] Specifically, for example, the IP address segment published by the router device includes 192.168.4.1 / 24. The child node of the ancestor IP node corresponding to the IP address of the router device includes a child IP node corresponding to the IP address segment 192.168.4.1 / 24. The IP information block corresponding to the child IP node is used to record the IP address of the IP address segment 192.168.4.1 / 24, the type identifier of the IP information block, the creation timestamp, the IP address hash value table, and detailed configuration information. If the router device allocates an IP address under the IP address segment 192.168.4.1 / 24 to the user, due to the structural characteristics of the IP address, the allocated IP address will be located in the IP address segment 192.168.4.1 / 25, or in the IP address segment 192.168.4.128 / 25. Therefore, when constructing the allocated IP address, you first need to create the IP information blocks corresponding to the IP address segments 192.168.4.1 / 25 and 192.168.4.128 / 25, that is, create the IP node corresponding to the IP address segment 192.168.4.1 / 25, or the IP information block corresponding to the IP node corresponding to 192.168.4.128 / 25. According to this binary rule, the IP information blocks corresponding to the IP address segments are created layer by layer until the IP information blocks corresponding to the IP addresses allocated to the user are created. Nodes are created according to this binary rule until the child nodes of a single IP address are finally obtained. No corresponding IP nodes are created for the IP addresses that are not allocated for use.
[0063] Sub-step 1204, for each IP information block corresponding to the child IP node, add the hash value of the IP address recorded in the IP information block to the IP address hash value table of the first target IP information block, wherein the first target IP information block is: the IP information block corresponding to the parent IP node of the IP node corresponding to the corresponding IP information block.
[0064] In the embodiment of the present application, for each constructed IP information block, the Hash value of the IP address recorded in the IP information block is used as an index to store the IP information block in the database. Afterwards, in the IP information block search phase, the Hash value of the IP address can be used as an index key to search for the IP information block of the IP address stored in the database.
[0065] In the process of creating an IP information block, all fields in the IP information block except the IP address Hash value table field have been assigned values. Next, the IP address Hash value table field needs to be assigned values.
[0066] In the embodiment of the present application, the IP address Hash value table field of the IP information block is used to record the Hash value of the IP address recorded in each IP information block connected after the IP information block. That is, the IP address Hash value table field of the IP information block records the IP information block corresponding to the child IP node of the IP node corresponding to the IP information block. Therefore, according to the parent-child relationship of the IP node corresponding to the IP information block, it is possible to determine the IP address (i.e., the IP address corresponding to each child IP node of the father IP node) that needs to record the Hash value in the IP address Hash value table in the IP information block corresponding to the father IP node. Afterwards, the Hash value of each IP address determined is calculated according to the preset algorithm, and the calculated Hash value is added to the IP address Hash value table in the IP information block corresponding to the father IP node for storage.
[0067] by Figure 3 Taking the IP configuration information management structure diagram shown as an example, assuming that IP information block Block1 corresponds to the IP address of a router device, and IP information blocks Block2, Block3 and Block4 correspond to the three IP address segments published by the router device, when the IP information block chain corresponding to the IP address of the router device is established by the method disclosed in the embodiment of the present application, the IP address field of IP information block Block1 records the IP address of the router device, and the IP address fields of IP information blocks Block2, Block3 and Block4 respectively record the IP addresses of each IP address segment published by the router device, and the IP address hash value table of IP information block Block1 records: the hash value table of IP addresses recorded by the IP address fields of IP information blocks Block2, Block3 and Block4 respectively. For example, the IP address hash value table of IP information block Block1 records 3 hash values, namely: the hash value of the IP address in IP information block Block2, the hash value of the IP address in IP information block Block3, and the hash value of the IP address in IP information block Block4. In this way, through the IP address Hash value table of IP information block Block1, the association between IP information block Block1 and IP information blocks Block2, Block3 and Block4 is established. Further, according to the correspondence between IP addresses and Hash values (such as using Hash values as index keys to retrieve the aforementioned record IP information block database), through the IP address Hash value table of IP information block Block1, the association between the IP addresses published by the router device can be established.
[0068] The parent-child relationship between IP nodes is as described above and will not be repeated here.
[0069] Due to the characteristics of the Hash algorithm, different IP addresses have different Hash values. Therefore, an IP address can be uniquely determined by the Hash value. Each IP information block can accurately search for the IP information block based on the IP address Hash value recorded in the IP address Hash value table, and further determine the IP address recorded in each IP information block. That is, the IP address that has a parent-child relationship or a routing relationship with the IP address recorded in the IP information block can be accurately determined, and the database can be retrieved.
[0070] At this point, the creation of the IP information block chain corresponding to the IP address of the specified router device has been completed. From the above creation process, it can be seen that the created IP information block chain is equivalent to a multi-branch tree composed of ancestor IP nodes and IP nodes at all levels, and the nodes are connected by the IP address Hash value. Therefore, the multi-branch tree search method can be used to search the IP information block chain.
[0071] Step 130: manage the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain.
[0072] After creating an IP information block chain based on the IP configuration information of the router device, according to the connection relationship of the IP information block chain, that is, the parent-child relationship between the IP nodes corresponding to each IP information block, not only can the topological relationship between the IP address segments, IP addresses, and static IP routes published by the router device be determined, but also operations such as IP address search, IP configuration information search, and IP address allocation can be quickly performed. Furthermore, during the IP address transfer process, the IP address can also be encrypted to improve the confidentiality of the information.
[0073] The following are examples of IP configuration information management operations performed based on IP information block chaining.
[0074] (I) Consistency comparison
[0075] In some embodiments of the present application, the data recorded in the IP information block includes: configuration details information of the IP address, and a hash value of the configuration details information, and the managing the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain includes: based on a request for consistency comparison of the configuration details information of the first IP address, obtaining the hash value of the configuration details information to be compared; obtaining the hash value of the IP information block record corresponding to the first IP address from the IP information block chain corresponding to the first IP address; performing a consistency comparison between the hash value of the configuration details information to be compared and the hash value of the IP information block record to obtain a comparison result; and determining the consistency comparison result of the configuration details information of the first IP address based on the comparison result.
[0076] The method for calculating the Hash value of the configuration details information of the first IP address is the same as the method for calculating the Hash value in the IP information block.
[0077] For example, when collecting IP configuration information of a router device at different times, for a certain IP address segment or IP address, the Hash value of the configuration details information of the latest collected IP address segment or IP address can be compared with the Hash value of the configuration details information of the IP address segment or IP address recorded in the IP information block chain to determine whether the configuration details information of the IP address segment or IP address has been updated, without having to compare a large amount of configuration details information. This improves the efficiency of configuration information comparison.
[0078] In some embodiments of the present application, the IP information blocks corresponding to each hash value in the IP address hash value table in the current IP information block can be determined by looking up the correspondence between the pre-established hash value of the IP address and the IP information block that records the corresponding IP address (such as using the hash value as the index key to retrieve the aforementioned database that records the IP information block), thereby obtaining the data of each IP information block connected after the current IP information block to implement the search of the IP information block chain.
[0079] Among them, based on the comparison result, the consistency comparison result of the configuration details information of the first IP address is determined, for example, it can be: based on the comparison result indicating that the Hash value of the configuration details information to be compared is consistent with the Hash value recorded in the IP information block, it is determined that the configuration details information of the first IP address has not been updated; or, based on the comparison result indicating that the Hash value of the configuration details information to be compared is inconsistent with the Hash value recorded in the IP information block, it is determined that the configuration details information of the first IP address has been updated.
[0080] On the other hand, when obtaining the hash value of the IP information block record corresponding to the first IP address, when searching for the IP information block corresponding to the first IP address, a binary tree-like search method can be used to search for the IP information block based on the connection relationship between the IP information blocks recorded in each IP information block chain. There is no need to traverse all IP information blocks, which effectively improves the efficiency of obtaining the configuration details of the IP address.
[0081] (II) Query configuration information
[0082] In some other embodiments of the present application, the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: based on a request to obtain the IP configuration information of the second IP address, using a multi-tree-like search method to search for the IP information block that records the second IP address in the first IP information block chain; and obtaining the IP configuration information of the second IP address based on the data recorded in the searched IP information block.
[0083] When you need to query the detailed configuration information of a certain IP address, you can get the configuration information of the IP address by searching the IP information block chain.
[0084] Among them, the first IP information block chain is the IP information block chain corresponding to the second IP address.
[0085] Taking the search for the IP configuration information of the second IP address as an example, first, the second IP address can be matched with the IP addresses corresponding to each IP information block chain to determine the router device that assigns the second IP address. It can be concluded from the method of creating an IP information block chain in the previous article that the second IP address is recorded in the IP information block chain corresponding to the router device that assigns it. Therefore, the second IP address can be compared with the IP address corresponding to each IP information block chain for inclusion. When the IP address segment corresponding to a certain IP information block chain contains the second IP address, it can be determined that the IP information block chain is the IP information block chain corresponding to the second IP address, that is, the first IP information block chain.
[0086] Afterwards, based on the structural characteristics of the IP information block chain, that is, a multi-tree-like structure, a multi-tree-like search method can be used to search the IP information block recording the second IP address in the first IP information block chain.
[0087] In some embodiments of the present application, a multi-tree-like search method is used to search the first IP information block chain for the IP information block recording the second IP address, including: using the ancestor IP node corresponding to the IP information block recorded in the first IP information block chain as the current layer IP node, performing a matching sub-step, a first output sub-step, and one or more sub-steps in the jump sub-step. The specific implementation scheme of each sub-step is introduced below.
[0088] In the matching sub-step, the longest matching method is used to match the second IP address with the IP address recorded in the IP information block corresponding to the current layer IP node, and the current layer IP node with the highest matching degree with the second IP address is obtained as the target IP node.
[0089] It can be known from the generation method of the IP information block chain described above that the IP information blocks included in the IP information block chain are connected into a chain based on the IP address hash value table. Each IP information block corresponds to an IP node, and corresponding to the connection relationship of the IP information block, there is a parent-child hierarchical relationship between the IP nodes. Matching the situation that two IP address segments can be allocated to a certain IP address segment, the two child IP nodes of the IP node corresponding to a certain IP information block are located at the same layer. When searching for IP information blocks, a method similar to a multi-branch tree search can be used. First, the second IP address is compared with the IP address recorded in the IP information block corresponding to each IP node of the current layer, and the IP node corresponding to the IP address with the highest matching degree is determined as the target IP node.
[0090] The IP address with the highest matching degree may completely match the second IP address, or may be an IP address segment containing the second IP address. When the IP address with the highest matching degree completely matches the second IP address, the first output sub-step is executed to end the search; otherwise, the jump sub-step is executed.
[0091] In the first output sub-step, in response to the IP address recorded in the IP information block corresponding to the target IP node completely matching the second IP address, the IP configuration information of the second IP address is obtained according to the data recorded in the IP information block corresponding to the target IP node. For example, when the IP address with the highest matching degree completely matches the second IP address, it is considered that the target IP node corresponds to the second IP address, and the configuration details information in the target IP node can be used as the IP configuration information of the second IP address.
[0092] In the jump sub-step, in response to the IP address recorded in the IP information block corresponding to the target IP node not completely matching the second IP address, and the target IP node has a child IP node, the child IP node of the target IP node is used as the current layer IP node to jump to the matching sub-step. For example, when the IP address with the highest matching degree does not completely match the second IP address, it is considered that the IP address with the highest matching degree is an IP address segment containing the second IP address, and it is necessary to further search for the second IP address in the IP address corresponding to the child IP node of the target IP node until the second IP address is found.
[0093] In specific implementation, if the second IP address is an unassigned IP address, then no IP information block matching the second IP address will be found in the IP information block chain. That is, the matching sub-step further includes: a second output sub-step.
[0094] The second output sub-step is to determine that the acquisition of IP configuration information fails in response to the IP address recorded in the IP information block of the target node not completely matching the second IP address, and the target node is a bottom-level sub-IP node. For example, when an IP address that completely matches the second IP address is not found in the IP information block in the IP information block linked list corresponding to the IP address segment containing the second IP address, it can be considered that the acquisition of IP configuration information fails.
[0095] Among them, each IP information block in the IP information block chain corresponds to an IP node. When determining the IP information block corresponding to the child node of a certain IP node (that is, determining the IP information block connected after a certain IP information block), the corresponding relationship between the pre-established IP information block and the Hash value of the IP address recorded in the IP information block (such as using the Hash value as the index key to retrieve the aforementioned IP information block database) can be used. The Hash value recorded in the IP address Hash value table in the block header of the current IP information block is used as the index key to query the corresponding IP information block.
[0096] In the prior art, when it is necessary to locate the detailed configuration information of a certain IP address segment or a certain IP address in the original database or router device, it is necessary to traverse all the configuration information in the database or router device. After the method disclosed in the embodiment of the present application is used to manage IP configuration information, when querying the IP information block linked list, only one IP information block on a branch chain needs to be matched, which reduces the space complexity to nearly O(logn), greatly improving the search efficiency.
[0097] (III) Allocating free IP addresses
[0098] In some embodiments of the present application, the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: based on a request to allocate an IP address, determining an IP address to be allocated and a second IP information block chain that matches the request; in the second IP information block chain, using a multi-tree-like search method to find a second target IP information block whose recorded IP address contains the IP address to be allocated; when the IP address recorded in the second target IP information block is different from the IP address to be allocated, creating an IP information block corresponding to the IP address to be allocated, and connecting the created IP information block to the second IP information block chain.
[0099] The second IP information block chain is an IP information block chain corresponding to the IP address of the router device that needs to publish the IP address; the second target IP information block is: the IP information block with the largest IP address mask bit in the IP information block whose recorded IP address contains the IP address to be allocated. For example, when the IP address to be allocated is contained in the IP address segment represented by the 192.168.4.1 / 24 bit and the 192.168.4.1 / 25 bit of the IP address, the IP information block with the IP address 192.168.4.1 / 25 bit recorded in the second IP information block chain is used as the second target IP information block.
[0100] When a router device needs to allocate an IP address to a user, the request will carry the IP address to be allocated. After receiving the request, the IP address to be allocated needs to be determined first. Then, the IP information block recording the IP address is searched in the IP information block chain corresponding to the IP address of the router device. If it is found, it means that the IP address has been occupied; if the IP information block recording the IP address is not found, it means that the IP address is free and can be allocated.
[0101] In the embodiment of the present application, when allocating an IP address, first search the second IP information block chain for an IP information block whose recorded IP address contains the IP address to be allocated, that is, the second target IP information block. The IP information block whose recorded IP address contains the IP address to be allocated may be: an IP information block whose recorded IP address is the same as the IP address to be allocated, or: an IP address to be allocated is a portion of the recorded IP address but not all of it.
[0102] When searching for the second target IP information block, a multi-tree-like search method can be used. In the second IP information block chain, starting from the ancestor IP node, the IP address recorded in the IP information block corresponding to the current IP node (hereinafter referred to as "current IP address") is matched with the IP address to be allocated to determine whether the current IP address contains the IP address to be allocated. If the IP address to be allocated is within the IP address segment corresponding to the current IP address, it is considered that the current IP address contains the IP address to be allocated.
[0103] The method of searching the IP information block in the second IP information block chain by using a multi-tree-like search method is described above and will not be repeated here.
[0104] Since the IP address corresponding to the second IP information block chain includes the IP address to be allocated, the IP information block corresponding to the ancestor IP node must include the IP address to be allocated. As the router device continues to publish IP address segments and allocate IP addresses under the IP address segments, the ancestor IP node will correspondingly hang down the child IP node corresponding to the published IP address, and the IP address to be allocated may be continuously divided into IP addresses containing smaller IP address segments, and thus be included in the IP address recorded in the newly created IP information block. Therefore, it is necessary to determine whether the IP address corresponding to each child IP node contains the IP address to be allocated, until the IP information block with the smallest IP address segment range in the IP information block including the IP address to be allocated is found, and it is used as the second target IP information block.
[0105] For example, starting from the ancestor IP node, for the child IP nodes of the current IP node, a method similar to a multi-branch tree search is used to determine that the corresponding IP address contains the child IP node of the IP node to be allocated by judging the parent-child inclusion relationship (i.e., the inclusion relationship within the IP address segment) between the IP address corresponding to each child IP node and the IP address to be allocated, and the IP information block corresponding to the child IP node is used as a candidate second target IP information block. If there are no more child IP nodes under the IP node corresponding to the candidate second target IP information block, the candidate second target IP information block is used as the second target IP information block; if there are child IP nodes under the IP node corresponding to the candidate second target IP information block, the same method is used to search layer by layer until the second target IP information block is found.
[0106] After finding the second target IP information block, further determine whether the IP address recorded in the second target IP information block is the same as the IP address to be allocated. If they are the same, it means that the IP address has been allocated to other users and this allocation has failed. If they are different, it means that the IP address is idle and can be allocated.
[0107] In some embodiments of the present application, an IP information block corresponding to the IP address to be assigned is created, and the created IP information block is connected to the second IP information block chain, including: creating an IP information block corresponding to the IP address to be assigned, and adding the hash of the IP address to be assigned to the IP address hash value table of the second target IP information block to connect the created IP information block to the second IP information block chain.
[0108] In some other embodiments of the present application, an IP information block corresponding to the IP address to be assigned is created, and the created IP information block is connected to the second IP information block chain, including: based on the binary rule, creating IP information blocks corresponding to the child IP nodes of each level of the IP node corresponding to the second target IP information block layer by layer until the IP information block corresponding to the IP address to be assigned is created; adding the hash of the IP address corresponding to each created IP information block to the IP address hash value table of the IP information block corresponding to the parent IP node of the IP node corresponding to the IP information block, so as to connect the created IP information block to the second IP information block chain.
[0109] For example, when it is determined that the IP address to be allocated is idle, based on the binary rule, IP information blocks corresponding to the sub-IP nodes of each level of the IP node corresponding to the second target IP information block are created layer by layer until the IP information block corresponding to the IP address to be allocated is created. After the IP information block corresponding to each sub-IP node is created, the Hash value of the IP address corresponding to the sub-IP node is added to the IP address Hash value table of the IP information block corresponding to the IP node of the upper layer, so as to connect the created IP information blocks to the second IP information block chain, and complete the allocation operation of the IP address to be allocated.
[0110] In the prior art, when allocating free IP addresses, it is necessary to traverse all allocated IP addresses in a database or router device to determine the free IP addresses. However, when allocating free IP addresses using the IP configuration information management method disclosed in the embodiments of the present application, it is only necessary to search for an IP information block on a branch chain in the IP information block chain corresponding to the specified IP address, so that the free IP address can be quickly found, effectively improving the efficiency of allocating free IP addresses.
[0111] (IV) IP address transfer
[0112] In some embodiments of the present application, the data recorded in the IP information block also includes: a hash value of the IP address recorded in the corresponding IP information block, and the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: determining a third IP information block chain corresponding to the third IP address based on an IP address transfer operation performed on a third IP address; searching the third IP information block chain for the IP information block recording the third IP address using a multi-tree-like search method; and performing the IP address transfer operation by representing the third IP address by the hash value recorded in the searched IP information block.
[0113] The third IP information block chain is an IP information block chain corresponding to the IP address of the router device that publishes the third IP address.
[0114] In some embodiments of the present application, for example, when an IP address needs to be filed, the IP address needs to be transferred between a router device or an IP address management system and an IP address filing system. In the prior art, the IP address is transferred in plain text.
[0115] For the specific implementation of searching the IP information block recording the third IP address in the third IP information block chain, reference may be made to the specific implementation of searching for the configuration information of the specified IP address in the foregoing text, which will not be repeated here.
[0116] After searching and obtaining the IP information block recording the third IP address, the Hash value recorded in the searched IP information block, representing the third IP address, can be sent to the filing system for IP address filing to complete the IP address transfer operation.
[0117] By using the hash value of the IP address to represent the IP address, the plain text flow of the IP address is converted into encrypted flow, which can prevent the behavior of obtaining related flow data based on the flowing IP address, so as to improve the privacy protection of related data during the circulation of IP addresses.
[0118] (V) Output IP network topology
[0119] In some embodiments of the present application, the data recorded in the IP information block includes: configuration details of the IP address, and the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: based on a request to obtain the IP address topology relationship of the target router device, determining a fourth IP information block chain corresponding to the IP address of the target router; generating an IP address topology relationship based on the connection relationship of the IP information blocks recorded in the IP address hash value table in each IP information block in the fourth IP information block chain, and the IP information block recording the configuration details information.
[0120] By adopting the IP configuration information management method disclosed in the embodiment of the present application, the IP topology relationship of the router device can be output. For example, for the target router device, first determine the IP information block chain that records the IP configuration information of the target router device, that is, the IP information block chain corresponding to the IP address of the target router device, which can be recorded as the "fourth IP information block chain" in this embodiment. After that, starting from the first IP information block of the fourth IP information block chain (the IP information block that records the IP address of the target router device), according to the connection relationship of the IP information blocks recorded in the IP address hash value table in each IP information block, a multi-tree search method is used to traverse each IP information block in the fourth IP information block chain layer by layer. When traversing each layer of IP information blocks, establish the IP node corresponding to each IP information block of the layer, mark the IP address corresponding to each IP node, and whether the configuration details information of the IP information block corresponding to the IP node is empty. When traversing the next layer of information blocks of each IP information block, the IP node corresponding to the next layer of information blocks is used as the child node of the IP node corresponding to the IP information block. According to this method, after traversing all IP information blocks of the fourth IP information block chain, an IP node multi-branch tree is obtained.
[0121] The method for searching for each IP information block connected to a certain IP information block in the fourth IP information block chain is described above and will not be repeated here.
[0122] Next, the nodes in the IP node multitree are pruned. The IP nodes whose configuration details of the corresponding IP information blocks are marked as empty are deleted from the IP node multitree as nodes without information, and the child IP nodes of the nodes without information are moved up to become the child IP nodes of the parent IP node of the nodes without information. This process is repeated until all the nodes without information in the IP node multitree are deleted, and the topological relationship of the IP addresses that have been published by the target router device can be obtained.
[0123] In the prior art, since each IP address is stored separately, the association between the IP addresses is not recorded in the router device and the database. If the IP address topology relationship is to be output, a large number of IP address matching operations need to be performed, which is extremely inefficient. By adopting the IP configuration information management method disclosed in the embodiment of the present application, after storing the IP addresses issued by the router device in the structure of the IP information block chain, it is only necessary to traverse the IP information block chain once to obtain the topological relationship between the IP addresses issued by the router device, which has a small amount of calculation and high efficiency.
[0124] The IP configuration information management method disclosed in the embodiment of the present application collects IP configuration information of router devices in the target communication network, wherein the IP configuration information includes: the IP address of the router device; for each of the router devices, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address hash value table, the IP address hash value table records the hash value of the IP address in the next IP information block of the corresponding IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address hash value table; based on the data recorded by each of the IP information blocks in the IP information block chain, the IP configuration information of the corresponding router device is managed, which can improve the efficiency of IP configuration information management and provide more comprehensive configuration information management capabilities.
[0125] The IP configuration information management method disclosed in the embodiment of the present application can not only store IP addresses and configuration information, but also store the configuration information and IP addresses of the published IP addresses in the IP information blocks, and based on the IP address hash value table stored in the IP information blocks, connect the IP information blocks into an IP information block chain according to the parent-child relationship or routing relationship between the IP addresses, thereby realizing the recording of the configuration information of the IP addresses and the association between the IP addresses based on a multi-tree-like structure.
[0126] Furthermore, based on the structural characteristics of the IP information block chain, the amount of calculation is significantly reduced when searching for IP address configuration information, allocating idle IP addresses, and outputting IP address topological relationships, greatly improving the efficiency of IP configuration information management.
[0127] The present application discloses an IP configuration information management device, such as Figure 4 As shown, the device comprises:
[0128] The IP configuration information collection module 410 is used to collect IP configuration information of a router device in a target communication network, wherein the IP configuration information includes: an IP address of the router device;
[0129] The IP information block chain creation module 420 is used to create an IP information block chain corresponding to the IP address of the corresponding router device according to the IP configuration information of the router device and based on the parent-child relationship and / or routing relationship of the IP address, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address Hash value table, the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address Hash value table;
[0130] The IP configuration information management module 430 is used to manage the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain.
[0131] In some embodiments of the present application, the IP configuration information further includes: static IP routing, IP address segments, and IP addresses allocated within the specified IP address segments issued by the router device. The IP information block chain creation module 420 is further used to:
[0132] According to the IP address of the router device, create an IP information block corresponding to the ancestor IP node;
[0133] According to the IP address segment issued by the router device, IP information blocks corresponding to the child IP nodes of the ancestor IP node are respectively created;
[0134] Creating an IP information block corresponding to a sub-IP node of the corresponding sub-IP node according to the static IP route published by the router device and / or the allocated IP address in the specified IP address segment;
[0135] For the IP information block corresponding to each of the child IP nodes, the hash value of the IP address recorded in the IP information block is added to the IP address hash value table of the first target IP information block, wherein the first target IP information block is: the IP information block corresponding to the parent IP node of the IP node corresponding to the corresponding IP information block.
[0136] In some embodiments of the present application, the data recorded in the IP information block includes: configuration details of the IP address, and a hash value of the configuration details, such as Figure 5As shown, the IP configuration information management module 430 further includes: a consistency comparison submodule 4301,
[0137] The consistency comparison submodule 4301 is used to obtain the Hash value of the configuration detail information to be compared based on the request for consistency comparison of the configuration detail information of the first IP address; and
[0138] Obtaining the hash value of the IP information block record corresponding to the first IP address from the IP information block chain corresponding to the first IP address;
[0139] The consistency comparison submodule 4301 is also used to perform a consistency comparison between the Hash value of the configuration detail information to be compared and the Hash value of the IP information block record to obtain a comparison result; then, based on the comparison result, determine the consistency comparison result of the configuration detail information of the first IP address.
[0140] In some embodiments of the present application, Figure 5 As shown, the IP configuration information management module 430 further includes: an IP configuration information query submodule 4302;
[0141] The IP configuration information query submodule 4302 is used to search the IP information block recording the second IP address in the first IP information block chain by using a multi-tree-like search method based on a request to obtain the IP configuration information of the second IP address; and
[0142] The IP configuration information of the second IP address is obtained according to the data recorded in the searched IP information block.
[0143] In some embodiments of the present application, Figure 5 As shown, the IP configuration information management module 430 further includes: an idle IP address allocation submodule 4303;
[0144] The idle IP address allocation submodule 4303 is used to determine the to-be-allocated IP address and the second IP information block chain matching the request for allocating an IP address based on the request for allocating an IP address; and
[0145] In the second IP information block chain, a multi-tree-like search method is used to search for a second target IP information block whose recorded IP address includes the IP address to be assigned;
[0146] The idle IP address allocation submodule 4303 is also used to create an IP information block corresponding to the IP address to be allocated when the IP address recorded in the second target IP information block is different from the IP address to be allocated, and connect the created IP information block to the second IP information block chain.
[0147] In some embodiments of the present application, the data recorded in the IP information block also includes: a hash value of the IP address recorded in the corresponding IP information block, such as Figure 5 As shown, the IP configuration information management module 430 further includes: an IP address flow submodule 4304;
[0148] The IP address flow submodule 4304 is used to determine a third IP information block chain corresponding to the third IP address based on the IP address flow operation performed on the third IP address; and to search the third IP information block chain for the IP information block recording the third IP address using a multi-tree-like search method;
[0149] The IP address flow submodule 4304 is further used to perform the IP address flow operation by using the Hash value recorded in the searched IP information block to represent the third IP address.
[0150] In some embodiments of the present application, the data recorded in the IP information block includes: configuration details of the IP address, such as Figure 5 As shown, the IP configuration information management module 430 further includes: a topology relationship generation submodule 4305;
[0151] The topology relationship generation submodule 4305 is used to determine the fourth IP information block chain corresponding to the IP address of the target router based on a request for obtaining the IP address topology relationship of the target router device; and generate an IP address topology relationship according to the connection relationship of the IP information blocks recorded in the IP address hash value table in each IP information block in the fourth IP information block chain, and the IP information block recording the configuration detail information.
[0152] The IP configuration information management device disclosed in the embodiment of the present application is used to implement the IP configuration information management method described in the embodiment of the present application. The specific implementation methods of each module of the device will not be repeated here, and reference can be made to the specific implementation methods of the corresponding steps in the method embodiment.
[0153] The IP configuration information management device disclosed in the embodiment of the present application collects IP configuration information of router devices in the target communication network, wherein the IP configuration information includes: the IP address of the router device; for each of the router devices, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address hash value table, the IP address hash value table records the hash value of the IP address in the next IP information block of the corresponding IP information block, and the multiple IP information blocks are connected into the IP information block chain based on the IP address hash value table; based on the data recorded by each IP information block in the IP information block chain, the IP configuration information of the corresponding router device is managed, which can improve the efficiency of IP configuration information management and provide more comprehensive configuration information management capabilities.
[0154] The IP configuration information management device disclosed in the embodiment of the present application can not only store IP addresses and configuration information, but also store the configuration information and IP addresses of the published IP addresses in the IP information blocks, and based on the IP address hash value table stored in the IP information blocks, connect the IP information blocks into an IP information block chain according to the parent-child relationship or routing relationship between the IP addresses, thereby realizing the recording of the configuration information of the IP addresses and the association between the IP addresses based on a multi-tree-like structure.
[0155] Furthermore, based on the structural characteristics of the IP information block chain, the amount of calculation is significantly reduced when searching for IP address configuration information, allocating idle IP addresses, and outputting IP address topological relationships, greatly improving the efficiency of IP configuration information management.
[0156] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0157] The above is a detailed introduction to an IP configuration information management method and device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and a core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0159] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the electronic device according to the embodiment of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0160] For example, Figure 6An electronic device that can implement the method according to the present application is shown. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device traditionally includes a processor 610 and a memory 620 and a program code 630 stored on the memory 620 and can be run on the processor 610, and the processor 610 implements the method described in the above embodiment when executing the program code 630. The memory 620 can be a computer program product or a computer-readable medium. The memory 620 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 620 has a storage space 6201 for the program code 630 of a computer program for executing any method step in the above method. For example, the storage space 6201 for the program code 630 can include various computer programs for implementing the various steps in the above method respectively. The program code 630 is a computer-readable code. These computer programs can be read from one or more computer program products or written into the one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. The computer program includes a computer readable code, and when the computer readable code is executed on an electronic device, the electronic device is caused to execute the method according to the above embodiment.
[0161] The embodiment of the present application also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the IP configuration information management method as described in the first embodiment of the present application are implemented.
[0162] Such a computer program product may be a computer-readable storage medium, which may have a computer-readable storage medium having a Figure 6 The memory 620 in the electronic device shown in the figure is similar to the storage segment, storage space, etc. The program code can be compressed and stored in the computer-readable storage medium in an appropriate form. The computer-readable storage medium is generally as shown in the reference Figure 7 The portable or fixed storage unit. Generally, the storage unit includes computer readable code 630', which is a code read by a processor. When the code is executed by the processor, each step in the method described above is implemented.
[0163] The term "one embodiment", "embodiment" or "one or more embodiments" herein means that a particular feature, structure or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. In addition, please note that the examples of the term "in one embodiment" here do not necessarily all refer to the same embodiment.
[0164] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0165] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for managing IP configuration information, characterized in that: include: Collecting IP configuration information of a router device in a target communication network, wherein the IP configuration information includes: an IP address of the router device; For each of the router devices, according to the IP configuration information of the router device, based on the parent-child relationship and / or routing relationship of the IP address, an IP information block chain corresponding to the IP address of the corresponding router device is created, wherein the IP information block chain includes multiple IP information blocks, and the data recorded by the IP information block includes: an IP address and an IP address Hash value table, and the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, so that the multiple IP information blocks are connected into the IP information block chain based on the IP address Hash value table; Based on the data recorded in each IP information block in the IP information block chain, managing the IP configuration information of the corresponding router device; The IP configuration information also includes: static IP routes, IP address segments, and IP addresses allocated within the specified IP address segments issued by the router device. The IP information block chain corresponding to the IP address of the corresponding router device is created based on the parent-child relationship and / or routing relationship of the IP address according to the IP configuration information of the router device, including: According to the IP address of the router device, create an IP information block corresponding to the ancestor IP node; According to the IP address segment issued by the router device, IP information blocks corresponding to the child IP nodes of the ancestor IP node are respectively created; According to the static IP route published by the router device, and / or the allocated IP address in the specified IP address segment, create an IP information block corresponding to the sub-IP node of the corresponding sub-IP node; For the IP information block corresponding to each of the child IP nodes, the hash value of the IP address recorded in the IP information block is added to the IP address hash value table of the first target IP information block, wherein the first target IP information block is: the IP information block corresponding to the parent IP node of the IP node corresponding to the corresponding IP information block.
2. The method according to claim 1, characterized in that The data recorded in the IP information block includes: configuration details information of the IP address, and a hash value of the configuration details information. The data recorded in each IP information block in the IP information block chain is used to manage the IP configuration information of the corresponding router device, including: Based on the request for consistency comparison of the configuration details information of the first IP address, a hash value of the configuration details information to be compared is obtained; Obtaining the hash value of the IP information block record corresponding to the first IP address from the IP information block chain corresponding to the first IP address; Perform consistency comparison between the Hash value of the configuration details information to be compared and the Hash value of the IP information block record to obtain a comparison result; Based on the comparison result, a consistency comparison result of the configuration detail information of the first IP address is determined.
3. The method according to claim 1, characterized in that The managing the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain includes: Based on a request for obtaining IP configuration information of a second IP address, searching the first IP information block chain for an IP information block recording the second IP address using a multi-tree-like search method; The IP configuration information of the second IP address is obtained according to the data recorded in the searched IP information block.
4. The method according to claim 1, characterized in that: The managing the IP configuration information of the corresponding router device based on the data recorded in each IP information block in the IP information block chain includes: Based on the request for allocating an IP address, determining an IP address to be allocated and a second IP information block chain matching the request; In the second IP information block chain, a multi-tree-like search method is used to search for a second target IP information block whose recorded IP address includes the IP address to be assigned; In the case that the IP address recorded in the second target IP information block is different from the IP address to be allocated, an IP information block corresponding to the IP address to be allocated is created, and the created IP information block is connected to the second IP information block chain.
5. The method according to claim 1, characterized in that The data recorded in the IP information block also includes: a hash value of the IP address recorded in the corresponding IP information block, and the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: Determine, based on the IP address transfer operation performed on the third IP address, a third IP information block chain corresponding to the third IP address; Using a multi-tree-like search method to search the third IP information block chain for an IP information block that records the third IP address; The Hash value recorded in the searched IP information block represents the third IP address, and the IP address transfer operation is performed.
6. The method according to claim 1, characterized in that The data recorded in the IP information block includes: detailed configuration information of the IP address, and the IP configuration information of the corresponding router device is managed based on the data recorded in each IP information block in the IP information block chain, including: Based on the request for obtaining the IP address topology relationship of the target router device, determining a fourth IP information block chain corresponding to the IP address of the target router; An IP address topology relationship is generated based on the connection relationship of the IP information blocks recorded in the IP address hash value table in each IP information block in the fourth IP information block chain, and the IP information block recording the configuration detail information.
7. An IP configuration information management device, characterized in that: include: An IP configuration information collection module is used to collect IP configuration information of a router device in a target communication network, wherein the IP configuration information includes: an IP address of the router device; An IP information block chain creation module is used to create an IP information block chain corresponding to the IP address of the corresponding router device for each of the router devices according to the IP configuration information of the router device and based on the parent-child relationship and / or routing relationship of the IP address, wherein the IP information block chain includes a plurality of IP information blocks, and the data recorded in the IP information block includes: an IP address and an IP address Hash value table, and the IP address Hash value table records the Hash value of the IP address in the next IP information block corresponding to the IP information block, so that the plurality of IP information blocks are connected into the IP information block chain based on the IP address Hash value table; An IP configuration information management module, used for managing the IP configuration information of a corresponding router device based on the data recorded in each IP information block in the IP information block chain; The IP configuration information also includes: static IP routing, IP address segments, and assigned IP addresses within the specified IP address segments issued by the router device. The IP information block chain creation module is further used to: According to the IP address of the router device, create an IP information block corresponding to the ancestor IP node; According to the IP address segment issued by the router device, IP information blocks corresponding to the child IP nodes of the ancestor IP node are respectively created; According to the static IP route published by the router device, and / or the allocated IP address in the specified IP address segment, create an IP information block corresponding to the sub-IP node of the corresponding sub-IP node; For the IP information block corresponding to each of the child IP nodes, the hash value of the IP address recorded in the IP information block is added to the IP address hash value table of the first target IP information block, wherein the first target IP information block is: the IP information block corresponding to the parent IP node of the IP node corresponding to the corresponding IP information block.
8. An electronic device comprising a memory, a processor, and a program code stored in the memory and executable on the processor, wherein: When the processor executes the program code, the IP configuration information management method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a program code stored thereon, characterized in that: When the program code is executed by a processor, the steps of the IP configuration information management method described in any one of claims 1 to 6 are implemented.
