Collection method, device and equipment of switch configuration information and medium

Through the seed machine, the configuration information of cloud network switches is automatically collected using Ansiable technology, which solves the problem of high cost and low accuracy of manually collecting configuration information in the cloud network delivery process, and achieves efficient and accurate automatic collection.

CN119854126AActive Publication Date: 2025-04-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411791205.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-18
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When the cloud network is in the delivery stage, it is necessary to manually collect switch configuration information, resulting in high collection costs and low accuracy.

Method used

Through the seed machine, Ansiable technology is used to establish a communication connection with the target switch, and automatically obtain the switch configuration command list, and automatically collect the switch configuration information through these command lists.

Benefits of technology

It realizes automatic collection of switch configuration information during the cloud network delivery process, improves collection efficiency and accuracy, and reduces the cost of manual collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854126A_ABST
    Figure CN119854126A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a switch configuration information acquisition method and device, equipment and a medium. The method is applied to a seed machine, the seed machine is deployed in a cloud network, and the seed machine is configured according to a network configuration toolkit of the cloud network. The method comprises the following steps: establishing communication connection with a target switch of configuration information to be acquired by adopting an Ansiable technology; and acquiring a configuration command list corresponding to the target switch, and automatically acquiring configuration information of the target switch through the established communication connection according to the configuration command list. The technical scheme provided by the embodiment of the invention can be applied to a delivery link of a cloud network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communications, and in particular to a method, device, equipment and medium for collecting switch configuration information. Background Art

[0002] In the delivery phase of large-scale cloud network architecture, there are a large number of network devices and complex network topology structures and configuration information. Since the cloud network is in the delivery phase and has not yet been cut over to the network, the network monitoring system cannot monitor and manage the network devices. When it is necessary to collect switch configuration information, it needs to be collected manually, which wastes human resources and time costs, and the accuracy of the collected configuration information is low. Summary of the invention

[0003] The embodiments of the present application propose a method, device, equipment and medium for collecting switch configuration information to solve the problem that when the cloud network is in the delivery stage, the switch configuration information needs to be manually collected, and the collection cost is high and the accuracy is low.

[0004] In a first aspect, an embodiment of the present application provides a method for collecting switch configuration information, which is applied to a seed machine, wherein the seed machine is deployed in a cloud network, and the seed machine is configured according to a network configuration toolkit of the cloud network; the method comprises:

[0005] Use Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected;

[0006] A configuration command list corresponding to the target switch is obtained, and configuration information of the target switch is automatically obtained through the communication connection according to the configuration command list.

[0007] In a second aspect, an embodiment of the present application provides a device for collecting switch configuration information, which is applied to a seed machine, wherein the seed machine is deployed in a cloud network, and the seed machine is configured according to a network configuration toolkit of the cloud network; the device comprises:

[0008] A communication module, used to establish a communication connection with a target switch whose configuration information is to be collected by using Ansiable technology;

[0009] The automatic acquisition module is used to obtain a configuration command list corresponding to the target switch, and automatically obtain the configuration information of the target switch through the communication connection according to the configuration command list.

[0010] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the first aspect.

[0011] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the first aspect.

[0012] The switch configuration information collection method, device, equipment and medium provided in the embodiment of the present application can establish a communication connection with the target switch of the configuration information to be collected by the Ansiable technology, so that the seed machine can automatically establish a communication connection with the target switch without human intervention, and because of the use of the Ansiable technology, the technical solution provided by this embodiment does not need to install any software or agent on the remotely set target switch, and the process of establishing a communication connection is simple and easy to implement; the process of collecting the configuration information of the target switch is automatically completed by the seed machine, and the seed machine itself does not belong to the network monitoring system, and is deployed in the cloud network, so that the seed machine can also establish a communication connection with the target switch normally when the cloud network is in the delivery link, and automatically collect its configuration information, and the automatic collection of configuration information is efficient and accurate, which solves the problem that the existing technology needs to manually collect switch configuration information when the cloud network is in the delivery link, and the collection cost is high and the accuracy is low. In addition, since the seed machine is configured according to the network configuration toolkit of the cloud network, the seed machine has the same configuration as the cloud network environment, has the function of deploying and managing other network devices or services, and conveniently manages and monitors cloud network resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0014] Figure 1 It is a flow chart of an embodiment of a method for collecting switch configuration information of the present application;

[0015] Figure 2 yes Figure 1 The flowchart of step 101 in the method for collecting switch configuration information of the present application is shown;

[0016] Figure 3 yes Figure 1 The flowchart of the method for generating the configuration command list in step 102 of the switch configuration information collection method of the present application is shown;

[0017] Figure 4 yes Figure 1 The flowchart of step 102 in the switch configuration information collection method of the present application automatically obtains the configuration information of the target switch according to the configuration command list;

[0018] Figure 5 It is a structural diagram of an embodiment of a device for collecting switch configuration information of the present application;

[0019] Figure 6 It is a schematic diagram of the structure of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION

[0020] All actions to obtain signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located, and with the authorization given by the owner of the corresponding device.

[0021] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] Please refer to Figure 1 , which shows a process 100 of an embodiment of a method for collecting switch configuration information according to the present application. The method for collecting switch configuration information can be applied to various electronic devices with data processing functions. For example, the above electronic devices may include but are not limited to cloud servers, physical servers, etc. The execution subject of the method for collecting switch configuration information may be a processor in the above electronic devices.

[0024] In this embodiment, the method for collecting switch configuration information can be applied to a seed machine, which can be deployed in a cloud network. Specifically, it can be deployed on a management node of a cloud network. In this embodiment and the following embodiments, the management node is a cloud computing management node as an example. When the seed machine is deployed on a cloud computing management node, the network convenience of the cloud computing management node can be used to enable the seed machine to be unimpededly connected to all switches in the cloud network.

[0025] Exemplarily, the seed machine may be created by a Kernel-based Virtual Machine (KVM) module.

[0026] In this embodiment, the KVM module allows users to create and run multiple isolated virtual machine environments on the same physical machine (such as a cloud computing management node). Each virtual machine can run its own operating system and application programs without interfering with each other.

[0027] According to the functions of the KVM module described above, in this embodiment, the seed machine is specifically a virtual machine created and deployed on the cloud computing management node, which has the ability to communicate with any switch in the cloud network and automatically collect its configuration information.

[0028] In this embodiment, the network configuration toolkit can be obtained by the system from the delivery platform, wherein the system can be an operating system of a cloud computing management node, and the delivery platform can be an intensively deployed project delivery management platform.

[0029] Exemplarily, the system can obtain cloud network configuration information and device information from the delivery platform, and then process the cloud network configuration information and device information to generate data files such as device hardware information, server network planning, and switch network planning. Finally, the data files are packaged into a customized image of the seed machine to form a network configuration toolkit.

[0030] In this embodiment, the network toolkit includes relevant information of each switch, such as: a device name for identifying the switch, a login IP for remotely logging into the switch, a login account and password for identity authentication, the manufacturer of the switch, and the software version running on the switch.

[0031] like Figure 1 As shown, the method for collecting switch configuration information includes the following steps:

[0032] Step 101: Use Ansiable technology to establish a communication connection with a target switch whose configuration information is to be collected.

[0033] In this embodiment, the triggering mode of step 101 may include two types:

[0034] One is to use Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected when a preset collection cycle arrives.

[0035] The other is to use Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected when a preset event is triggered.

[0036] Through the above two triggering methods, the seed machine can periodically or event-triggeredly automatically start the switch configuration information collection process, thereby improving the degree of automation and meeting the switch configuration information collection needs in different scenarios.

[0037] Of course, the above two triggering methods are only specific examples. In actual use, step 101 can also be triggered to execute in other ways, and each case will not be described here one by one.

[0038] In this embodiment, if Figure 2 As shown, step 101 may include:

[0039] Step 201: decompress the network configuration toolkit to obtain configuration information and device information.

[0040] In this embodiment, step 201 can export a network configuration toolkit from the customized image of the seed machine, and decompress it to obtain configuration information and device information.

[0041] Step 202: Using the Secure Shell (SSH) and / or Telecommunication Network Protocol (Telnet) in Ansiable technology, remotely log in to the target switch for which configuration information is to be collected according to the configuration information and device information.

[0042] In this embodiment, Ansiable technology is a configuration management, application deployment, task execution and multi-node orchestration tool that can communicate with a remote host through the SSH protocol without installing any software or agent on the remote host. Exemplarily, the remote host is a switch.

[0043] In this embodiment, SSH is an encrypted protocol that can provide secure data transmission. It uses technologies such as public key encryption and key exchange to ensure that data is encrypted during transmission, thereby protecting user privacy and data security.

[0044] In this embodiment, Telnet is a plain text protocol, and all data is transmitted in plain text. It only supports identity authentication based on user name and password, and the data transmitted is plain text.

[0045] In summary, when remotely logging into the target switch in step 202, either SSH or Telnet can be used.

[0046] Exemplarily, step 202 may use the above-mentioned login IP for remote login to the switch and the login account password for identity authentication to perform remote login.

[0047] Step 203: When the remote login is successful, the interactive environment of the target switch is activated, and a communication connection with the target switch is established.

[0048] Optionally, in this embodiment, step 203 may also include a step of recording relevant information of the target switch and the reason for the login failure when the remote login fails, so as to facilitate subsequent analysis and processing.

[0049] Step 102: Obtain a configuration command list corresponding to the target switch, and automatically obtain configuration information of the target switch through the communication connection established in step 101 according to the configuration command list.

[0050] In this embodiment, if Figure 3 As shown, the method for generating a configuration command list may include:

[0051] Step 301: Encapsulate the command line interface (CLI) command and the network configuration protocol (Netconf) command of the target switch into an atomic script using a jinja2 template.

[0052] In this embodiment, the seed machine may have built-in CLI commands and Netconf commands of switches of various brands and models. Step 302 may obtain corresponding CLI commands and Netconf commands according to device information of the target switch.

[0053] In this embodiment, the CLI command is a text-based user interface, and the user operates the system by inputting instructions through the keyboard.

[0054] In this embodiment, the Netconf command is a network configuration tool that can help users manage and configure network connections and interfaces in a Linux system. Through the netconf command, users can easily view and modify network configurations to meet the needs of different network environments.

[0055] Step 302: According to the configuration information collection requirements of the target switch, use the atomic command orchestration engine to orchestrate the atomic script into a configuration acquisition template to generate a configuration command list.

[0056] In this embodiment, an atomic command orchestration engine can be written in advance for the atomic script above. Step 302 can use the atomic command orchestration engine to generate a configuration command list on the seed machine according to the different quantities, types, and sequences of the required configurations, thereby achieving automation and flexibility in on-site configuration collection.

[0057] For example, if only the interface description configuration, VLAN name configuration, ISIS neighbor status, and ISIS routing status configuration need to be collected, the atomic command arrangement engine can be used to arrange the above four atomic commands in a specific order to generate a configuration command list in step 302. When the seed machine performs the configuration information collection operation later, it will follow the arrangement principle to obtain the corresponding configuration or status information.

[0058] For example, Figure 4 As shown, step 102 of automatically acquiring configuration information of the target switch according to the configuration command list may include:

[0059] Step 401: Send the configuration commands in the configuration command list to the target switch one by one.

[0060] Step 402: Receive the echo information returned by the target switch.

[0061] Step 403: parse the echo information to obtain the echo content.

[0062] In this embodiment, step 403 may parse the echoed content according to the character encoding predefined by the target switch manufacturer.

[0063] Step 404: Use regular expressions to match the echo content and collect information of each configuration item.

[0064] In this embodiment, the information of the configuration item includes but is not limited to:

[0065] 1. Interface configuration information

[0066] The interface configuration information may include, but is not limited to: aggregate interface information, physical interface information, routing aggregate interface information, and tunnel interface information.

[0067] 2. Open Shortest Path First (OSPF) configuration information OSPF configuration information may include but is not limited to: router ID and silent interface, etc. OSPF configuration information can implement routing selection and forwarding within an autonomous system (such as a cloud network).

[0068] 3. Virtual Routing and Forwarding (VRF) configuration information

[0069] The configuration information of VRF may include but is not limited to: the name of VRF and the description of VRF, etc. The configuration information of VRF may realize the function of network isolation.

[0070] 4. Border Gateway Protocol (BGP) configuration information

[0071] The configuration information of BGP may include, but is not limited to, the autonomous system (AS) number of BGP, the instance number, and some basic attribute configurations. The configuration information of BGP can ensure that BGP routers correctly exchange routing information.

[0072] 5. VLAN configuration information

[0073] The configuration information of the VLAN may include but is not limited to: VLAN ID, etc. The configuration information of the VLAN has the function of making the communication transmission between different VLANs independent of each other.

[0074] Step 405: Organize and classify the configuration items according to the configuration blocks they are in.

[0075] Step 406: Use regular expressions to match the content of the configuration block and collect parameters of the configuration block.

[0076] Step 407: Record the configuration block and the parameters of the configuration block corresponding to each configuration item to obtain the configuration information of the target switch.

[0077] In this embodiment, after the seed machine completes the configuration information collection of a target switch, it will record the configuration block and configuration parameter json file corresponding to each configuration item of the target switch to facilitate subsequent data processing and storage.

[0078] In this embodiment, the seed machine can traverse all switches in the cloud network and use the above Figure 1-4 The steps shown collect configuration information. After all switches in the cloud network that need to collect configuration information are completed, the switch configuration information collection method provided in the embodiment of the present application may also include a step of resetting the configuration of the seed machine.

[0079] By resetting the configuration of the seed machine, the seed machine can be reconfigured according to the latest network configuration toolkit each time configuration information is collected, thereby increasing the applicability and reliability of the switch configuration information collection method provided in the embodiment of the present application.

[0080] The switch configuration information collection method provided in the embodiment of the present application can establish a communication connection with the target switch of the configuration information to be collected by the Ansiable technology, so that the seed machine can automatically establish a communication connection with the target switch without human intervention, and because of the use of the Ansiable technology, the technical solution provided by this embodiment does not need to install any software or agent on the remotely set target switch, and the process of establishing a communication connection is simple and easy to implement; the process of collecting the configuration information of the target switch is automatically completed by the seed machine, and the seed machine itself does not belong to the network monitoring system, and is deployed in the cloud network, so that the seed machine can also establish a communication connection with the target switch normally when the cloud network is in the delivery link, and automatically collect its configuration information, and the automatic collection of configuration information has high efficiency and accuracy, which solves the problem that the existing technology needs to manually collect switch configuration information when the cloud network is in the delivery link, and the collection cost is high and the accuracy is low. In addition, since the seed machine is configured according to the network configuration toolkit of the cloud network, the seed machine has the same configuration as the cloud network environment, has the function of deploying and managing other network devices or services, and conveniently manages and monitors cloud network resources.

[0081] Please refer to Figure 5 As an implementation of the methods shown in the figures, the present application provides an embodiment of a device for collecting switch configuration information. The device embodiment corresponds to the method shown in the above embodiments, and the device can be specifically applied to various electronic devices.

[0082] In this embodiment, the method for collecting switch configuration information can be applied to a seed machine, which can be deployed in a cloud network. Specifically, it can be deployed on a management node of a cloud network. In this embodiment and the following embodiments, the management node is a cloud computing management node as an example. When the seed machine is deployed on a cloud computing management node, the network convenience of the cloud computing management node can be used to enable the seed machine to be unimpededly connected to all switches in the cloud network.

[0083] Exemplarily, the seed machine may be created by a Kernel-based Virtual Machine (KVM) module.

[0084] In this embodiment, the KVM module allows users to create and run multiple isolated virtual machine environments on the same physical machine (such as a cloud computing management node). Each virtual machine can run its own operating system and application programs without interfering with each other.

[0085] According to the functions of the KVM module described above, in this embodiment, the seed machine is specifically a virtual machine created and deployed on the cloud computing management node, which has the ability to communicate with any switch in the cloud network and automatically collect its configuration information.

[0086] In this embodiment, the network configuration toolkit can be obtained by the system from the delivery platform, wherein the system can be an operating system of a cloud computing management node, and the delivery platform can be an intensively deployed project delivery management platform.

[0087] Exemplarily, the system can obtain cloud network configuration information and device information from the delivery platform, and then process the cloud network configuration information and device information to generate data files such as device hardware information, server network planning, and switch network planning. Finally, the data files are packaged into a customized image of the seed machine to form a network configuration toolkit.

[0088] In this embodiment, the network toolkit includes relevant information of each switch, such as: a device name for identifying the switch, a login IP for remotely logging into the switch, a login account and password for identity authentication, the manufacturer of the switch, and the software version running on the switch.

[0089] like Figure 5 As shown, the switch configuration information collection device 500 of this embodiment includes:

[0090] The communication module 501 is used to establish a communication connection with a target switch whose configuration information is to be collected by using Ansiable technology;

[0091] The automatic acquisition module 502 is used to obtain a configuration command list corresponding to the target switch, and automatically obtain the configuration information of the target switch through the communication connection according to the configuration command list.

[0092] Optionally, the communication module 501 is further used to establish a communication connection with a target switch for configuration information to be collected using Ansiable technology when a preset collection period arrives; and / or, when a preset event is triggered, establish a communication connection with a target switch for configuration information to be collected using Ansiable technology.

[0093] Optionally, the communication module 501 is further used to decompress the network configuration toolkit to obtain configuration information and device information; use the secure shell protocol SSH and / or the remote terminal protocol Telnet in Ansiable technology to remotely log in to the target switch for collecting configuration information according to the configuration information and device information; if the remote login is successful, activate the interactive environment of the target switch and establish a communication connection with the target switch.

[0094] Optionally, the automatic collection module 502 is further used to send the configuration commands in the configuration command list to the target switch one by one; receive the echo information returned by the target switch; parse the echo information to obtain the echo content; match the echo content using a regular expression, and collect information of each configuration item respectively; organize and classify the configuration items according to the configuration blocks they are in; match the content of the configuration block using the regular expression, and collect parameters of the configuration block; record the configuration block and the parameters of the configuration block corresponding to each configuration item, and obtain the configuration information of the target switch.

[0095] Optionally, the automatic collection module 502 is further used to encapsulate the command line interface CLI commands and network configuration protocol Netconf commands of the target switch into atomic scripts using jinja2 templates; according to the configuration information collection requirements of the target switch, an atomic command orchestration engine is used to orchestrate the atomic scripts into configuration acquisition templates to generate a configuration command list.

[0096] Optionally, the automatic acquisition module 502 is also used to reset the configuration of the seed machine.

[0097] Optionally, the seed machine is created by a KVM module and deployed on a cloud computing management node of the cloud network.

[0098] The specific implementation method of the switch configuration information collection device provided in the embodiment of the present application can refer to the switch configuration information collection method provided in the above embodiment, which will not be repeated here.

[0099] The switch configuration information collection device provided in the embodiment of the present application can establish a communication connection with the target switch of the configuration information to be collected by the seed machine using the Ansiable technology, so that the seed machine can automatically establish a communication connection with the target switch without human intervention, and because the Ansiable technology is adopted, the technical solution provided by the present embodiment does not need to install any software or agent on the remotely set target switch, and the process of establishing a communication connection is simple and easy to implement; the process of collecting the configuration information of the target switch is automatically completed by the seed machine, and the seed machine itself does not belong to the network monitoring system, and is deployed in the cloud network, so that the seed machine can also establish a communication connection with the target switch normally when the cloud network is in the delivery link, and automatically collect its configuration information, and the automatic collection of configuration information has high efficiency and accuracy, which solves the problem that the existing technology needs to manually collect switch configuration information when the cloud network is in the delivery link, and the collection cost is high and the accuracy is low. In addition, since the seed machine is configured according to the network configuration toolkit of the cloud network, the seed machine has the same configuration as the cloud network environment, has the function of deploying and managing other network devices or services, and conveniently manages and monitors cloud network resources.

[0100] Reference below Figure 6 , which shows a schematic structural diagram of an electronic device for implementing some embodiments of the present application. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0101] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0102] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a disk, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0103] In particular, according to some embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present application are executed.

[0104] It should be noted that the computer-readable medium described in some embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0105] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0106] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: uses Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected; obtains a configuration command list corresponding to the target switch, and automatically obtains the configuration information of the target switch through the communication connection according to the configuration command list.

[0107] Computer program code for performing the operations of some embodiments of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++; and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, or may be connected to an external computer (e.g., through the Internet using an Internet service provider), including a local area network (LAN) or a wide area network (WAN).

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite 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 a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The units described in some embodiments of the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a first determination unit, a second determination unit, a selection unit, and a third determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0110] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0111] The above description is only some preferred embodiments of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with (but not limited to) the technical features with similar functions disclosed in the embodiments of the present application to form a technical solution.

Claims

1. A method for collecting switch configuration information, characterized in that: Applied to a seed machine, the seed machine is deployed in a cloud network, and the seed machine is configured according to a network configuration toolkit of the cloud network; the method comprises: Use Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected; A configuration command list corresponding to the target switch is obtained, and configuration information of the target switch is automatically obtained through the communication connection according to the configuration command list.

2. The method according to claim 1, characterized in that The method of using the Ansiable technology to establish a communication connection with a target switch for collecting configuration information includes: When the preset collection period arrives, using Ansiable technology to establish a communication connection with the target switch whose configuration information is to be collected; and / or, When a preset event is triggered, Ansiable technology is used to establish a communication connection with the target switch whose configuration information is to be collected.

3. The method according to claim 1, characterized in that The method of using the Ansiable technology to establish a communication connection with a target switch for collecting configuration information includes: Decompress the network configuration toolkit to obtain configuration information and device information; Using the secure shell protocol SSH and / or the remote terminal protocol Telnet in the Ansiable technology, remotely log in to the target switch for which the configuration information is to be collected according to the configuration information and device information; When the remote login is successful, the interactive environment of the target switch is activated and a communication connection with the target switch is established.

4. The method according to claim 1, characterized in that: The automatically acquiring the configuration information of the target switch according to the configuration command list includes: Sending the configuration commands in the configuration command list to the target switch one by one; Receiving the echo information returned by the target switch; Parsing the echo information to obtain the echo content; A regular expression is used to match the echo content, and information of each configuration item is collected respectively; Organizing and classifying the configuration items according to the configuration blocks they are in; Using the regular expression to match the content of the configuration block, and collecting parameters of the configuration block; The configuration block and the parameters of the configuration block corresponding to each configuration item are recorded to obtain the configuration information of the target switch.

5. The method according to claim 1, characterized in that: The method for generating the configuration command list includes: Encapsulate the command line interface CLI command and the network configuration protocol Netconf command of the target switch into an atomic script using a jinja2 template; According to the configuration information collection requirements of the target switch, an atomic command orchestration engine is used to orchestrate the atomic script into a configuration acquisition template to generate a configuration command list.

6. The method according to claim 1, characterized in that The method further comprises: The configuration of the seed machine is reset to zero.

7. The method according to any one of claims 1 to 6, characterized in that: The seed machine is created by a kernel basic virtual machine KVM module and deployed on a cloud computing management node of the cloud network.

8. A device for collecting switch configuration information, characterized in that: Applied to a seed machine, the seed machine is deployed in a cloud network, and the seed machine is configured according to a network configuration toolkit of the cloud network; the device comprises: A communication module, used to establish a communication connection with a target switch whose configuration information is to be collected by using Ansiable technology; The automatic acquisition module is used to obtain a configuration command list corresponding to the target switch, and automatically obtain the configuration information of the target switch through the communication connection according to the configuration command list.

9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Heterogeneous server automatic migration method and system

    CN116302315A

  • Application deployment method and device, server and storage medium

    CN117234530A

  • Method and device for automatic acceptance of cloud server equipment

    CN117873793A

  • Jinja2 template-based cloud network automatic configuration method and system

    CN117938640A

  • Automatic pushing method and device for cloud network configuration

    CN118784475A