Method, apparatus and computer program product for processing network profiles
By obtaining and applying address translation rules in the cluster system to convert the IP addresses in the network configuration file, the IP address conflict problem during backup and recovery in the cluster system is solved, and automated and efficient network configuration adjustment is achieved.
Patent Information
- Application Number
- CN202311276859.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
When backing up and restoring system configuration or replicating system configuration in a cluster system, there is a problem of IP address conflict in network configuration files. Traditional methods require manual search and replacement of IP addresses or pre-constructing address mappings. The process is cumbersome and inconvenient for reuse.
A method is provided to convert the original Internet protocol address based on these rules by obtaining the network configuration file of the first cluster system and the address conversion rules set by the user, generate a target Internet protocol address, and store it in the second cluster system.
Customized and automated network configuration adjustments are realized, avoiding the tedious process of manual modification, improving processing efficiency, and improving user experience.
Smart Images

Figure CN119728754A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to the field of data processing, and in particular to a method, a device, and a computer program product for processing a network configuration file. Background Art
[0002] With the development of computer technology, in order to meet the needs of processing large amounts of data and high-performance computing, people will connect multiple computers or servers together to form a cluster system that shares resources and works together. The cluster system can improve computing power, reliability, scalability, and fault tolerance.
[0003] The development of cluster systems has gone through several stages, including high-performance computing clusters, high-performance computing clusters, distributed computing clusters, and container orchestration clusters. With the development of cluster systems, they have begun to be widely used in cloud computing, big data processing, artificial intelligence, and machine learning. In cluster systems, backing up and restoring system configurations is a common operation used to protect the system from data loss or to replicate the system for high availability. However, there are still many problems that need to be solved when backing up and restoring system configurations or replicating system configurations in cluster systems. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, a device, and a computer program product for processing a network configuration file.
[0005] According to a first aspect of the present disclosure, a method for processing a network configuration file is provided. The method includes obtaining a network configuration file of a first cluster system, the network configuration file including an original Internet Protocol address. The method also includes obtaining an address conversion rule set by a user, the address conversion rule including a rule for converting an original network address and an original host address that form the original Internet Protocol address. The method also includes obtaining a target Internet Protocol address by converting one of the original Internet Protocol addresses based on the address conversion rule. The method also includes storing the network configuration file including the target Internet Protocol address in a second cluster system.
[0006] According to a second aspect of the present disclosure, an electronic device is provided. The electronic device includes at least one processor; and a memory coupled to the at least one processor and having instructions stored thereon, the instructions causing the device to perform actions when executed by the at least one processor, the actions comprising: obtaining a network configuration file of a first cluster system, the network configuration file including an original Internet Protocol address; obtaining an address conversion rule set by a user, the address conversion rule including a rule for converting one of an original network address and an original host address that form the original Internet Protocol address; based on the address conversion rule, obtaining a target Internet Protocol address by converting one of the original Internet Protocol addresses; and storing the network configuration file including the target Internet Protocol address in a second cluster system.
[0007] According to a third aspect of the present disclosure, there is provided a computer program product, which is tangibly stored on a non-volatile computer-readable medium and comprises machine-executable instructions, which when executed cause a machine to perform the steps of the method in the first aspect of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.
[0009] Figure 1 A schematic diagram illustrating an example environment in which devices and / or methods according to embodiments of the present disclosure may be implemented;
[0010] Figure 2 A schematic diagram illustrating an example of processing a network configuration file according to an embodiment of the present disclosure;
[0011] Figure 3 A flowchart of a method for processing a network configuration file according to an embodiment of the present disclosure is illustrated;
[0012] Figure 4 A schematic diagram illustrating an example of an address translation rule according to an embodiment of the present disclosure;
[0013] Figure 5 A schematic diagram illustrating an example of network address translation according to an embodiment of the present disclosure;
[0014] Figure 6 A schematic diagram illustrating another example of network address translation according to an embodiment of the present disclosure;
[0015] Figure 7A schematic diagram illustrating an example of an address translation rule for an interface according to an embodiment of the present disclosure;
[0016] Figure 8 A schematic diagram illustrating an example of a host address translation rule according to an embodiment of the present disclosure;
[0017] Fig. 9 A schematic block diagram of an example device suitable for implementing embodiments of the present disclosure is illustrated.
[0018] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0021] As described above, there are still many problems that need to be solved when backing up and restoring system configurations or replicating system configurations in a cluster system. For example, among the various configurations of a cluster system, the network configuration of the system may be the most complex, especially for a large cluster system. If the Internet Protocol (IP) addresses are managed by the cluster system itself rather than assigned by the environment, the network configuration may contain a large number of IP addresses. In this case, backing up and restoring the network configuration or replicating the network configuration across two cluster systems usually requires some modifications to the configuration on different systems to avoid IP address conflicts between the two systems in the environment.
[0022] However, the backup and recovery process or the copy process of the network configuration file is usually performed automatically by a program. In addition, the network configuration is usually complex and has a hierarchical structure. The network configuration may include multiple subnets, pools, and interfaces, in which there may be hundreds of IP addresses, such as the IP address range of each pool and the gateway of each subnet. In view of this situation, there are mainly two methods for restoring the network configuration in the traditional scheme. One is to manually search and replace all IP addresses in the configuration data before recovery. The other is to prepare a fixed address mapping, pass it to the recovery tool, and run it during recovery. It is time-consuming and laborious to pre-build such a large address mapping and modify them all before or after recovery. Therefore, the traditional (e.g., manual) modification during the recovery process is a difficult task and is not convenient to implement. In addition, different source or target systems may have different network configurations and IP address ranges, so the fixed address mapping or manual modification cannot be saved and reused to restore another set of configurations or restore on another different system. Therefore, the above method is only applicable to small configuration data and is not reusable.
[0023] At least to solve the above and other potential problems, an embodiment of the present disclosure provides a method for processing a network configuration file. In this method, a computing device first obtains a network configuration file of a first cluster system. Then, the computing device further obtains an address conversion rule set by a user. According to the conversion rule, the computing device converts one of the original network address and the original host address that form the original Internet Protocol address in the network configuration file to generate an adjusted target Internet Protocol address, and then stores it in the second cluster system for use by the second cluster system. Through this method, a simple Internet Protocol address conversion rule can be used to convert an address part of the original network address, and the network configuration can be flexibly adjusted in a customized and automated manner, and the adjustment process is performed by the computing device without the need for human intervention, thereby improving processing efficiency and user experience.
[0024] The embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. Figure 1 An example environment is shown in which the apparatus and / or method of embodiments of the present disclosure may be implemented.
[0025] like Figure 1As shown, the example environment 100 includes a cluster system 102. The cluster system 102 includes a plurality of nodes, each of which is assigned an IP address. Additionally, the IP addresses of the nodes within the cluster are managed by the cluster system 102. For the cluster system 102, a corresponding network configuration file 108 is generated. In one example, the network configuration file 108 is located on a node within the cluster. In another example, the configuration file 108 is distributed on a plurality of nodes within the cluster. The cluster system 102 is connected to a network 104 to interact with the network 104. For ease of description, the cluster system 102 may also be referred to as a first cluster system.
[0026] Figure 1 Also shown is a cluster system 106, which also includes multiple nodes. For the convenience of description, the cluster system 106 may also be referred to as a second cluster system. In some embodiments, after the cluster system 102 fails, the cluster system 106 may be used to replace the cluster system 102. At this time, the network configuration file 108 in the cluster system 102 needs to be restored to the cluster system 106 for application. In this process, it is necessary to compare the IP address in the network configuration file 108 according to certain address conversion rules and make adjustments to generate a network configuration file that can be used in the cluster system 106. In some embodiments, if the user wants to configure the cluster system 106 in the same configuration mode after configuring the cluster system 102, the IP address in the network configuration file 108 may also be compared according to certain address conversion rules and made adjustments to generate a network configuration file that can be used in the cluster system 106. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure.
[0027] In some embodiments, when adjusting the IP address in the network configuration file in the cluster system 102, it is necessary to receive the address conversion rules set by the user. In some embodiments, the address conversion rules may include rules for converting the network address that forms the original Internet Protocol address. In some embodiments, the address conversion rules may include rules for converting the host address that forms the original Internet Protocol address. Then, the computing device can use the address conversion rules to convert the Internet Protocol address in the network configuration file, thereby adjusting the Internet Protocol address in the network configuration file. Finally, the adjusted network configuration file is stored in the cluster system 106. The adjustment process of the above network configuration file can be performed on any suitable computing device. In one example, the adjustment of the network configuration file is performed on a node in the cluster system 106. In another example, the adjustment of the network configuration file is performed on a node in the cluster system 102. In another example, the adjustment of the network configuration file is performed on a computing device or a node in a network outside the cluster systems 102 and 106. The above examples are only used to describe the present disclosure, and are not specifically limited to the present disclosure. Through this method, it is possible to use simple Internet Protocol address conversion rules to flexibly adjust the network configuration in a customized and automated manner, thereby improving processing efficiency and user experience.
[0028] Combined with the above Figure 1 Describes an example environment in which the devices and / or methods of the embodiments of the present disclosure may be implemented. Figure 2 A schematic diagram describing an example of processing a network configuration file according to an embodiment of the present disclosure.
[0029] like Figure 2 As shown, the computing device 204 performs the adjustment of the configuration file. Example computing devices 204 include, but are not limited to, personal computers, server computers (e.g. Figure 1 The invention may include a node in a cluster system 102, 106 or a node in a network 104), a handheld or laptop device, a mobile device, a multi-processor system, a consumer electronics product, a minicomputer, a mainframe computer, a distributed computing environment including any one of the above systems or devices, etc.
[0030] The computing device 204 includes a rule engine 206 and a recovery engine 208, which are used to implement the adjustment process of the network configuration file of the network cluster. The rule engine 206 is used to obtain the network configuration file 202 of the first network cluster, such as Figure 1 The network configuration file 108 of the cluster system 102 in the. The rule engine 206 applies the rules to the configuration data and processes or converts the network configuration file 202 into a pattern that can be stored by the recovery engine 208 to the second system cluster.
[0031] In some embodiments, the rule used in the rule engine 206 is a JavaScript Object Notation (JSON) data. The rule engine 206 has predefined codes to interpret the rule data and apply it to the network configuration file. There are two kinds of rules in the process of restoring the network configuration file or copying the network configuration file: custom rules 210 and static rules 212. Static rules 212 are some general rules. Each component in the system can have its own static rules to convert its backed-up configuration data into a structure that can be restored or copied to another cluster system. For example, static rules include converting certain fields from names to numbers or which fields are no longer needed. Static rules are published with the system in the form of JSON documents and cannot be adjusted dynamically. Custom rules 210 are provided by users 216 when starting the operation of restoring network configuration files or copying network configuration files. Therefore, custom rules 210 are temporary and are usually based on actual configuration data, which makes the recovery process very flexible. In order to simplify the use of custom rules, the command line interface of the recovery process does not require users to enter custom rules in JSON structure. The command line interface provides users with simple options to help users convert rule parameters into actual rules.
[0032] After the network configuration file is adjusted by the rule engine 206, it is stored in the configuration repository 214 by the recovery engine 208 for use by the second cluster system, for example Figure 1 The cluster system 106 in.
[0033] Through this method, simple Internet Protocol address translation rules can be used to flexibly adjust network configuration in a customized and automated manner, thereby improving processing efficiency and user experience.
[0034] Combined with the above Figure 2 A schematic diagram of an example of processing a network configuration file according to an embodiment of the present disclosure is described. Figure 3 A flowchart describing a method for processing a network configuration file according to an embodiment of the present disclosure is provided. The method may be used in a network configuration file such as Figure 1 A computing device of a node in a cluster system 102, 106, or a network 104, Figure 2 The system is executed on computing device 204 or any suitable computing device or server.
[0035] At block 302, the computing device obtains a network configuration file of the first cluster system, wherein the network configuration file includes the original Internet Protocol address. For example, the computing device may obtain the network configuration file 108 of the cluster system 102. The network configuration file stores all network configuration information related to the cluster system, including a large number of IP addresses related to subnets, pools, and / or interfaces.
[0036] At box 304, the computing device obtains the address conversion rule set by the user, wherein the address conversion rule includes a rule for converting one of the original network address and the original host address that form the original Internet Protocol address. For example, the computing device obtains the custom rule 210 defined by the user for adjusting the original Internet Protocol address in the network configuration file. For an Internet Protocol address, it consists of two parts: a network address and a host address, wherein the network address refers to the part of the IP address used to identify the network, and the host address is the part used to identify the host. In IPv4, the IP address is represented by a 32-bit binary number, usually expressed in dotted decimal form. Among them, the front part is used to represent the network address, and the rear part is used to represent the host address. In IPv6, the IP address is represented by a 128-bit binary number, usually expressed in the form of a hexadecimal number separated by a colon, and it is also the front part that is used to represent the network address, and the rear part is used to represent the host address. Alternatively or additionally, the IP address may be in Classless Inter-Domain Routing (CIDR) notation, which is a method for representing IP addresses and subnet masks, which can more flexibly divide the IP address space, making the allocation of network addresses more efficient. CIDR notation uses the " / " symbol to indicate the division of network addresses and host addresses. For example, an address with a CIDR notation of 192.168.1.0 / 24 indicates that the first 24 bits are the network address and the last 8 bits are the host address.
[0037] In some embodiments, when obtaining the address conversion rules set by the user, the computing device obtains the Internet Protocol address conversion information input by the user. The computing device then converts the Internet Protocol address conversion information input by the user into an address conversion rule in a predetermined format. For example, in order to simplify the use of custom rules, the command line interface of the recovery process does not require the user to enter the custom rules in a JSON structure. The command line interface provides the user with a simple option to help convert the rule parameters into an actual rule in a JSON structure.
[0038] At block 306, the computing device obtains the target Internet Protocol address by converting one of the original Internet Protocol addresses based on the address conversion rule. For example, the computing device adjusts one of the original network address or the original host address in the original Internet Protocol address in the network configuration file according to the received custom rule 210.
[0039] In some embodiments, the computing device needs to adjust the original network address. The computing device first obtains the address conversion rule, and the address conversion rule may indicate that the original network address is converted to the target network address. Next, the computing device needs to determine whether the network address conversion can be successfully performed. In this process, the computing device first determines the first length of the original network address and the second length of the target network address to be converted. The computing device then compares the first length and the second length. If the first length is greater than or equal to the second length, it indicates that the target network address is greater than the original network address. At this time, address conversion will not cause the problem that the host address cannot be applied to the target network address, so the computing device replaces the part of the original Internet Protocol address corresponding to the second length with the target network address.
[0040] If the first length is less than the second length, the computing device needs to further determine whether there is a predetermined value in any bit of the portion corresponding to the first length and the second length in the original Internet Protocol address to determine whether there is an overflow problem, for example, the predetermined value is 1. If there is no predetermined value 1 in any bit of the portion corresponding to the first length and the second length in the original Internet Protocol address, it indicates that the conversion of the network address portion will not cause the problem that the host address cannot be applied to the target network address. Therefore, the computing device replaces the portion of the original Internet Protocol address corresponding to the second length with the target network address. If there is a predetermined value 1 in any bit of the portion corresponding to the first length and the second length in the Internet Protocol address, it indicates that the host address in the original Internet Protocol address cannot be applied to the target network address, and the application of the address conversion rule is blocked at this time.
[0041] In some embodiments, the original network address and the target network address are represented by a classless inter-domain routing annotation. In some embodiments, for a large cluster system, the network configuration may contain multiple different levels of items with a hierarchical structure, such as networks, subnets, pools, and interfaces. Among them, the subnet is a hub that contains the overall information of the subnet and may be composed of multiple network pools. Network address translation rules are generally applicable to subnets. Once the network address of the subnet is determined, all IP addresses in the subnet can be automatically converted. At this time, only its network address needs to be replaced and the remaining bits remain unchanged. Therefore, the original network address and the target network address can be subnet addresses. In some embodiments, the original network address and the target network address are the network addresses of the upper-level network or the lower-level network of the subnet. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. The original network address and the target network address can refer to any suitable network address part other than the host address.
[0042] In some embodiments, the computing device converts the original host address in the network configuration file. When obtaining the target Internet Protocol address, the computing device determines that the address conversion rule indicates that the original host address is moved by a predetermined value. The computing device then determines whether a host address overflow will occur based on the predetermined value to be drifted, which can be achieved by determining whether the original network address of the original Internet Protocol address has been changed. If the original network address of the original Internet Protocol address has not been changed, the computing device can move the original host address of the original Internet Protocol address by a predetermined value to generate the target Internet Protocol address. If the original network address of the original Internet Protocol address has been changed, it indicates that the host address has overflowed, and the application of the address conversion rule is blocked at this time.
[0043] At block 308, the computing device stores the network configuration file including the target Internet Protocol address in the second cluster system. After generating the adjusted network configuration file, the computing device stores the adjusted network configuration file in the second cluster system for use by the second cluster system.
[0044] Through this method, simple Internet Protocol address translation rules can be used to flexibly adjust network configuration in a customized and automated manner, thereby improving processing efficiency and user experience.
[0045] Combined with the above Figure 3 A flowchart of a method for processing a network configuration file according to an embodiment of the present disclosure is described. Figure 4-Figure 8 A number of rule examples and examples of applying the rules to make adjustments are described to further describe the present disclosure in detail. Figure 4 A schematic diagram illustrating an example of an address conversion rule according to an embodiment of the present disclosure is illustrated.
[0046] like Figure 4 As shown, in example 400, the network address translation rule shown is to set the subnet address named "groupnet0.subnet0" to "10.205.24.0 / 22", or if the current address is "10.205.31.0 / 24", then set the subnet address to "10.205.28.0 / 22".
[0047] Alternatively or additionally, the address of the subnet can be replaced by name or value, but both are usually not used in the rules to avoid conflicts. In addition, the subnet address uses CIDR notation. In large cluster systems with a hierarchical structure, the number of IP addresses may be overwhelming. By specifying the network address in CIDR notation, the conversion rule can automatically handle all IP addresses within the network without using other complex syntax to handle each individual address. Therefore, this approach is simple and clever. Additionally, the prefix lengths of the new and old network addresses can be different, as long as the IP addresses actually used during the conversion process do not overflow. In addition, once the rules are set, the IP address ranges and gateway addresses of all network pools within the subnet will be converted accordingly by the rule engine during the recovery or replication process. Users no longer need to specify individual pool addresses or gateway addresses in the rules.
[0048] Combine the following Figure 5 An example 500 of network address translation according to an embodiment of the present disclosure is described. In this example column, it is assumed that the rule is to translate the subnet address from the address "10.42.175.1 / 24" to the address "10.205.28.0 / 22". The new subnet address space is larger than the old subnet address space because the network prefix length becomes smaller. This will not overflow during the translation process. Assuming that there is an address pool in the subnet with a starting address of 10.42.175.1, the translation will replace its leftmost 22 bits with the leftmost 22 bits of 10.205.28.0 / 22, and the remaining rightmost 10 bits remain unchanged as host address bits, so the new translated address is 10.205.31.1, which belongs to the address space of the subnet 10.205.28.0 / 22.
[0049] But if the rule is to convert IP addresses from a large subnet to a small subnet, there is a risk that the host address is too large to fit in the small network and the conversion will fail. Figure 6 , which shows another example 600 of network address translation according to an embodiment of the present disclosure. In this example, for the rule of translating the subnet from address "10.42.160.0 / 20" to address "10.205.28.0 / 22", the IP address 10.42.175.1 / 20 will not be translated because the leftmost 2 bits of its host address conflict with the rightmost 2 bits of the 10.205.28.0 / 22 network address. Typically, in most practical use cases, the old and new subnets of the backup and recovery system have the same size (prefix length), so the translation result is very simple.
[0050] In some embodiments, the network address translation rules can also be applied to the interface addresses of simple non-cluster systems without subnets. Figure 7, which shows a schematic diagram of an example 700 of network address translation of an interface according to an embodiment of the present disclosure. In this example, the rule shown is to change the network address of the IP address on the interface "eth0" to "10.205.24.0 / 22" or to change the network address of all interface addresses from "10.205.31.0 / 24" to "10.205.28.0 / 22".
[0051] In some embodiments, if one wants to drift the host address of an IP address by an interval without changing its network address, a host address translation rule may be used. Figure 8 A schematic diagram of an example 800 of host address translation according to an embodiment of the present disclosure is illustrated. Figure 8 The rule shown in indicates that the host address on the interface "eth0" is to drift by 100, or all host addresses of the network address "192.168.4.0 / 22" are to drift by 256, so 192.168.4.10 will be converted to 192.168.5.10. Of course, overflow is not allowed during the drift conversion process, so the new IP address after drifting will still fall into the subnet.
[0052] Although the above examples all use IPv4 addresses, IP address conversion rules also support IPv6 addresses. IPv6 addresses have network identifiers, subnet identifiers, and interface identifiers in their 128-bit address space. Network identifiers and / or subnet identifiers can be used as network addresses, and interface identifiers can be used as host addresses. IPv6 addresses can use prefix lengths to define the network portion of the address, which also conforms to CIDR notation. For example, 2001:0db8:4860:0012:: / 64 is a valid IPv6 subnet address, and its conversion method is the same as IPv4.
[0053] Fig. 9 A schematic block diagram of an example device 900 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The nodes in the computing clusters 102, 106 and the network 104 and Figure 2 The computing device 204 can be implemented using the device 900. As shown, the device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or loaded from a storage unit 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0054] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage page 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0055] The various processes and processing described above, such as method 300, may be performed by processing unit 901. For example, in some embodiments, method 300 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by CPU 901, one or more actions of the process or method 300 described above may be performed.
[0056] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0057] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0058] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0059] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0060] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0061] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0062] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0063] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0064] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing a network configuration file, comprising: Obtaining a network configuration file of the first cluster system, wherein the network configuration file includes an original Internet Protocol address; Acquire an address conversion rule set by a user, the address conversion rule comprising a rule for converting one of an original network address and an original host address forming an original Internet Protocol address; Based on the address translation rule, obtaining a target Internet Protocol address by translating the one of the original Internet Protocol addresses; as well as A network configuration file including the target Internet Protocol address is stored in the second cluster system.
2. The method according to claim 1, wherein the one address is an original network address, wherein obtaining the target Internet Protocol address comprises: Determining that the address translation rule indicates that the original network address is translated into a target network address; Determining a first length of the original network address and a second length of the target network address; comparing the first length and the second length; as well as In response to the first length being greater than or equal to the second length, a portion of the original Internet Protocol address corresponding to the second length is replaced with the target network address.
3. The method according to claim 2, wherein obtaining the target Internet Protocol address comprises: In response to the first length being less than the second length, determining whether a predetermined value exists in any one of the bits in the original Internet Protocol address corresponding to a portion between the first length and the second length; as well as In response to the absence of the predetermined value in any bit of the portion of the original Internet Protocol address corresponding to the first length and the second length, the portion of the original Internet Protocol address corresponding to the second length is replaced with the target network address.
4. The method according to claim 3, wherein obtaining the target Internet Protocol address further comprises: In response to the presence of the predetermined value in any bit of the Internet Protocol address corresponding to the portion between the first length and the second length, application of the address translation rule is prevented.
5. The method of claim 2, wherein the original network address and the target network address are represented by a Classless Inter-Domain Routing annotation. The method of claim 2 , wherein the original network address and the target network address are subnet addresses.
7. The method of claim 1, wherein the one address is an original host address, wherein obtaining the target Internet Protocol address comprises: determining that the address translation rule indicates that the original host address is moved by a predetermined value; Based on the predetermined value, determining whether an original network address of the original Internet Protocol address has been changed; as well as In response to an original network address of the original Internet Protocol address not being changed, the original host address of the original Internet Protocol address is shifted by a predetermined value to generate the target Internet Protocol address.
8. The method according to claim 7, wherein obtaining the target Internet Protocol address further comprises: In response to an original network address of the original Internet Protocol address being changed, application of the address translation rule is prevented.
9. The method according to claim 1, wherein obtaining the address translation rule set by the user comprises: Obtain Internet Protocol address translation information input by the user; as well as The Internet Protocol address translation information is converted into an address translation rule in a predetermined format.
10. The method according to claim 1, wherein the original Internet Protocol address can be one of the following: an Internet Protocol version 4 address or an Internet Protocol version 6 address.
11. An electronic device, comprising: at least one processor; as well as a memory coupled to the at least one processor and having instructions stored thereon, the instructions, when executed by the at least one processor, causing the device to perform actions, the actions comprising: Obtaining a network configuration file of the first cluster system, wherein the network configuration file includes an original Internet Protocol address; Acquire an address conversion rule set by a user, the address conversion rule comprising a rule for converting one of an original network address and an original host address forming an original Internet Protocol address; Based on the address translation rule, obtaining a target Internet Protocol address by translating the one of the original Internet Protocol addresses; and A network configuration file including the target Internet Protocol address is stored in the second cluster system.
12. The electronic device according to claim 11, wherein the one address is an original network address, wherein obtaining the target Internet Protocol address comprises: Determining that the address translation rule indicates that the original network address is translated into a target network address; Determining a first length of the original network address and a second length of the target network address; comparing the first length and the second length; as well as In response to the first length being greater than or equal to the second length, a portion of the original Internet Protocol address corresponding to the second length is replaced with the target network address.
13. The electronic device according to claim 12, wherein obtaining the target Internet Protocol address comprises: In response to the first length being less than the second length, determining whether a predetermined value exists in any one of the bits in the original Internet Protocol address corresponding to a portion between the first length and the second length; as well as In response to the absence of the predetermined value in any bit of the portion of the original Internet Protocol address corresponding to the first length and the second length, the portion of the original Internet Protocol address corresponding to the second length is replaced with the target network address.
14. The electronic device according to claim 13, wherein obtaining the target Internet Protocol address further comprises: In response to the presence of the predetermined value in any bit of the Internet Protocol address corresponding to the portion between the first length and the second length, application of the address translation rule is prevented.
15. The electronic device of claim 12, wherein the original network address and the target network address are represented by a Classless Inter-Domain Routing Notation.
16. The electronic device of claim 12, wherein the original network address portion and the target network address are subnet addresses.
17. The electronic device of claim 11, wherein the one address is an original host address, wherein obtaining the target Internet Protocol address comprises: determining that the address translation rule indicates that the original host address is moved by a predetermined value; Based on the predetermined value, determining whether an original network address of the original Internet Protocol address has been changed; as well as In response to an original network address of the original Internet Protocol address not being changed, the original host address of the original Internet Protocol address is shifted by a predetermined value to generate the target Internet Protocol address.
18. The electronic device according to claim 17, wherein obtaining the target Internet Protocol address further comprises: In response to an original network address of the original Internet Protocol address being changed, application of the address translation rule is prevented.
19. The electronic device according to claim 11, wherein acquiring the address conversion rule set by the user comprises: Obtain Internet Protocol address translation information input by the user; as well as The Internet Protocol address translation information is converted into an address translation rule in a predetermined format.
20. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions which, when executed, cause a machine to: Obtaining a network configuration file of the first cluster system, wherein the network configuration file includes an original Internet Protocol address; Acquire an address conversion rule set by a user, the address conversion rule comprising a rule for converting one of an original network address and an original host address forming an original Internet Protocol address; Based on the address translation rule, obtaining a target Internet Protocol address by translating the one of the original Internet Protocol addresses; and A network configuration file including the target Internet Protocol address is stored in the second cluster system.