Batch network configuration method and device

By obtaining device version information and determining a subset of configuration files, batch network configuration of the equipment is solved, and the problems of high network configuration costs and complex management in the prior art are solved, and the effect of reducing costs and improving compatibility is achieved.

CN119728416APending Publication Date: 2025-03-28QINGDAO BRANCH OF CHINA CONSTRUCTION BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411763916.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, network configuration costs are high, and the mixed use of equipment of multiple brands and models doubles the complexity of network management, poor compatibility, and poor overall implementation effect.

Method used

By obtaining the version information of each device in the device collection, and determining the configuration files of each device in the configuration file collection based on the version information, a subset of configuration files is obtained, and then network configurations are carried out for each device in the device collection.

Benefits of technology

It reduces network configuration costs, simplifies network management, improves compatibility and adaptability between devices, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728416A_ABST
    Figure CN119728416A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a batch network configuration method and device. The method comprises the following steps: acquiring version information of each device in a device set; determining a configuration file of each device in a configuration file set according to the version information of each device to obtain a configuration file subset; and performing network configuration on each device in the device set through the configuration file subset. Through the method and the device, the problem of high network configuration cost in related technologies is solved, and the effect of reducing the network configuration cost is further achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the computer field, and in particular, to a method and device for batch network configuration. Background Art

[0002] In the current operation and maintenance practice of network infrastructure, the prominent problem is that the scale of network infrastructure equipment is huge, often numbering in the thousands or even tens of thousands. When dealing with large-scale network implementation, relying solely on manual maintenance consumes a lot of manpower and time costs, and the mixed use of equipment of multiple brands and models often doubles the complexity of network management.

[0003] In the traditional automation of equipment configuration, it is necessary to deploy dedicated network management systems from multiple manufacturers for network configuration of devices of different brands and models, which not only increases economic investment, but also significantly increases the cost of operation and maintenance. In addition, it is difficult to unify the operation and maintenance modes of products from different manufacturers, and the compatibility is poor, resulting in poor overall implementation results.

[0004] There is currently no effective solution to the above problems. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for batch network configuration, so as to at least solve the problem of high network configuration cost in the related art.

[0006] According to one embodiment of the present invention, a method for batch network configuration is provided, comprising: obtaining version information of each device in a device set; determining a configuration file for each device in a configuration file set based on the version information of each device to obtain a configuration file subset; and performing network configuration on each device in the device set through the configuration file subset.

[0007] In an exemplary embodiment, obtaining version information of each device in a device set includes: sending query instructions in a query instruction set to a target device in sequence, wherein the target device is any device in the device set; when the target device responds to the i-th query instruction, obtaining the version information of the target device from a response message of the target device to the i-th query instruction, wherein i is an integer greater than or equal to 1.

[0008] In an exemplary embodiment, before obtaining the version information of each device in the device set, the method also includes: receiving network information of the target device and verifying the network information; if the verification is successful, performing the login operation on the target device through the network information, wherein the target device is any device in the device set.

[0009] In an exemplary embodiment, verifying the network information includes: if the network information includes a network address and account information, and the network address and the account information are complete, determining that the verification is passed; otherwise, reacquiring the network address and the account information.

[0010] In an exemplary embodiment, according to the version information of each of the devices, a configuration file for each of the devices is determined in a configuration file set to obtain a configuration file subset, including: according to the version information of the target device, determining a target path of the target device in the target mapping relationship, wherein the target device is any device in the device set; and according to the target path, obtaining a target configuration file for the target device.

[0011] In an exemplary embodiment, before determining the target path of the target device in the target mapping relationship, the method further includes: acquiring the target configuration file and the target path; and establishing a target mapping relationship between the target configuration file, the target path and the version information of the target device.

[0012] According to another embodiment of the present invention, a device for batch network configuration is provided, including: an acquisition module, used to obtain version information of each device in a device set; a determination module, used to determine the configuration file of each device in a configuration file set according to the version information of each device, and obtain a configuration file subset; a configuration module, used to perform network configuration on each device in the device set through the configuration file subset.

[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0014] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to yet another embodiment of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0016] Through the present invention, by obtaining the version information of each device in the device set, and obtaining the corresponding configuration file according to the version information, the configuration file is used to perform network configuration on each device in the device set. Therefore, the problem of high network configuration cost in the related art can be solved, and the effect of reducing the network configuration cost can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a hardware structure block diagram of a mobile terminal according to a method for batch network configuration in an embodiment of the present invention;

[0018] Figure 2 is a flow chart of a method for batch network configuration according to an embodiment of the present invention;

[0019] Figure 3 is a flow chart of a device network configuration according to an embodiment of the present invention;

[0020] Figure 4 4 is a structural block diagram of a device for batch network configuration according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0023] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for batch network configuration according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method of batch network configuration in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0025] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0026] In this embodiment, a method running on the above mobile terminal or network architecture is provided. Figure 2 is a flow chart of a method for batch network configuration according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0027] Step S202, obtaining version information of each device in the device set;

[0028] The above version information can be the fingerprint feature of the device, which is used to identify the model and manufacturer of the device, etc., to help users and technical support personnel better understand the configuration and performance of the device; the version information can be used to obtain the model, manufacturer, brand name, manufacturer identification code and other information of the device, so as to determine the configuration file of the device based on this information and better manage and maintain the device.

[0029] Optionally, obtaining version information of each device in a device set includes: sending query instructions in a query instruction set to a target device in sequence, wherein the target device is any device in the device set; when the target device responds to the i-th query instruction, obtaining the version information of the target device from a response message of the target device to the i-th query instruction, wherein i is an integer greater than or equal to 1.

[0030] The above-mentioned device set can be a set of devices that need to be network configured, and the device set can include one device or multiple devices, wherein the target device can be any device in the device set; the above-mentioned query instruction can be an instruction for querying device version information, and the query instruction can be a version query instruction such as show version and display version; based on the query instructions in the preset query instruction set, the system sends different query instructions to the target device in sequence, such as query instruction 1, query instruction 2, query instruction 3, etc., and obtains the version information of the target device when the target device responds to the query instruction. For example, if query instruction 1 is sent to the target device and the target device does not respond, query instruction 2 is continued to be sent to the target device. At this time, the target device responds to query instruction 2, and the version information of the target device is obtained from the information returned by the target device in response to query instruction 2.

[0031] Through the built-in query instruction set, the version information of the target device is obtained using the instructions in the query instruction set. There is no need for the user to pre-embed a large amount of initialization data in advance, such as device manufacturer, product type, model, version number and other data. This minimizes the workload of information initialization and reduces manual intervention. It changes the logic of traditional automation tools that rely on pre-embedded data for device adaptation, greatly reduces the workload of data initialization and continuous data maintenance, and realizes a broader automation.

[0032] Step S204, determining the configuration file of each device in the configuration file set according to the version information of each device, and obtaining a configuration file subset;

[0033] The above configuration file can be a text file used to specify the parameters and settings of the device to ensure that the device can run correctly and perform specific functions. The configuration file can be used to set and update the parameters of the device; based on the version information, the brand or manufacturer of the target device can be determined, so that according to the brand or manufacturer of the target device, the configuration file of the target device can be determined from multiple preset configuration files, and the selected configuration file can be used to configure the network of the target device. This eliminates the need to deploy different network platform products for devices from different manufacturers, and solves the problem of deploying multiple platform products for a single function due to the difficulty in unifying the brands and models of medium and large network devices. It has low resource usage, low deployment costs, no additional operation and maintenance costs, and good compatibility with products from the same manufacturer, and high adaptability to products from different manufacturers. At the same time, there are no special requirements for the basic operating environment, and general terminal hardware can meet the deployment requirements, further reducing operation and maintenance costs.

[0034] Specifically, according to the version information of the target device, a target path of the target device is determined in the target mapping relationship, wherein the target device is any device in the device set; and according to the target path, a target configuration file of the target device is obtained.

[0035] The target mapping relationship may be a text recording the relationship between the target device, the configuration file and the storage path of the configuration file. The target mapping relationship may be as shown in Table 1 below. Through the target mapping relationship, the configuration file corresponding to the target device may be determined and obtained.

[0036] Table 1

[0037] brand Version Query Fingerprint characteristics Script Files Storage path AA show version aa aa_cmd D1 BB show version bb bb_cmd D2 CC display version cc cc_cmd D3 DD display version dd dd_cmd D4 EE show version ee ee_cmd D5

[0038] Optionally, before determining the target path of the target device in the target mapping relationship, the method further includes: acquiring the target configuration file and the target path; and establishing a target mapping relationship between the target configuration file, the target path and the version information of the target device.

[0039] Step S206: Perform network configuration on each of the devices in the device set by using the configuration file subset.

[0040] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.

[0041] Through the above steps, the version information of each device in the device set is obtained; according to the version information of each device, the configuration file of each device is determined in the configuration file set to obtain a configuration file subset; and the network configuration is performed on each device in the device set through the configuration file subset. The problem of high network configuration cost in the related art is solved and the network configuration cost is reduced.

[0042] As an optional implementation, before obtaining the version information of each device in the device set, the method also includes: receiving network information of the target device and verifying the network information; if the verification passes, performing the login operation on the target device through the network information, wherein the target device is any device in the device set.

[0043] The above-mentioned device set can be a set of devices that need to be network configured, which can include one device or multiple devices, wherein the target device can be any device in the device set; the above-mentioned network information can be information for logging into the target device, such as the IP address of the device, the account number of the device, the login password, etc.

[0044] The system collects the IP address, login account and password of each device in the device set, and verifies the collected information. If the verification is passed, the system performs batch login operations on multiple devices (i.e., multi-threaded login) based on the collected IP addresses, login accounts, passwords, etc. of the devices. The thread scheduling logic can divide the number of login device IPs into equal parts according to the number of threads and round them up for execution. The specific number of threads can be set according to actual conditions to improve the efficiency of device login. After the thread task is determined, the device login is automatically executed through the SSH remote login protocol. In case of login access exceptions, unsupported device types, etc., the interface will feedback error information and record log files to facilitate result backtracking, and jump to execute login tasks for subsequent devices.

[0045] As an optional implementation, verifying the network information includes: if the network information includes a network address and account information, and the network address and the account information are complete, determining that the verification is successful; otherwise, reacquiring the network address and the account information.

[0046] It should be noted that, in the case where the login user password for each device is different, it is necessary to enter the device's IP address, login account and password. The specific entry format can be "IP address, user name (login account), password", so as to fully consider the actual situation of the user's network, reuse existing accounts, and achieve "zero intrusion" of device configuration; in the case where all devices use a unified user password, you only need to enter the login IP address (omit the account), thereby minimizing the workload of information initialization and unifying users for operation and maintenance audits; if the above two situations are used at the same time, you can give priority to entering the device's IP address, login account and password. For devices whose login account and password are not entered during the entry process, the default account is used to perform login.

[0047] As an optional implementation, the system can also record the full amount of log information output by the device and automatically archive it to a specified directory after the configuration file is sent to the corresponding device, thereby achieving effective supervision and behavior backtracking of the execution behavior.

[0048] As an optional implementation, Figure 3 is a flow chart of a device network configuration according to an embodiment of the present invention. Figure 3 As shown, the specific process is as follows:

[0049] Step S301, enter the device IP address, device login account, login password and device configuration file according to the prompts through the human-computer interaction interface, and distinguish the path of the configuration file according to the device type (i.e. version information). In the case where the login user password of each device is different, it is necessary to enter the device IP address, login account and password. The specific entry format can be "IP address, user name (login account), password"; for the case where all devices use a unified user password, only the login IP address can be entered (default account); if the above two situations are used at the same time, the method of entering the device IP address, login account and password can be used first. For devices where the device login account and password are not entered during the entry process, the default account is used to perform login.

[0050] Step S302, identify and judge the input conditions (ie, network information and configuration files), such as whether the IP address and configuration files exist or are empty; if they do not exist, complete the relevant information and initialize the entry.

[0051] Step S303, determine the thread task, wherein the number of threads can be specified by oneself to improve the execution efficiency. The thread arrangement logic is to divide the number of login device IPs into equal parts according to the number of threads and execute them in integers. After the thread task is determined, the device login is automatically executed through the SSH remote login protocol. In case of login access exceptions, unsupported device types, etc., the interface will feedback error information and record log files for easy result backtracking, and jump to execute the login tasks of subsequent devices.

[0052] Step S304, after completing the device login, enter the device type (i.e. version information) identification link. By adopting anthropomorphic logic for identification, that is, simulating the judgment and operation logic performed by an experienced network administrator when logging into an unknown device, try to cyclically send known different version query instructions (and query instructions) to each device in the device set, and call the corresponding configuration file to send it to the device for execution according to the returned version information; if the response information does not match the version information of the current device, then cyclically send the subsequent query instructions until the matching version information is found. In principle, all adapted products can obtain the correct fingerprint return value. For example, query instruction 1, query instruction 2, query instruction 3, etc., and obtain the version information of the target device when the target device responds to the query instruction. For example, if query instruction 1 is sent to the target device and the target device does not respond, query instruction 2 is continued to be sent to the target device. At this time, the target device responds to query instruction 2, then the version information of the target device is obtained from the information returned by the target device in response to query instruction 2, and the corresponding configuration file is called and sent to the target device.

[0053] Step S305: After the configuration file is sent to the device, the device outputs the full log information and automatically archives it to the specified directory, thereby achieving effective supervision and behavior backtracking of the execution behavior.

[0054] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0055] In this embodiment, a device for batch network configuration is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0056] Figure 4 is a structural block diagram of a device for batch network configuration according to an embodiment of the present invention, such as Figure 4 As shown, the apparatus includes: an acquisition module 402, used to acquire version information of each device in a device set; a determination module 404, used to determine the configuration file of each device in a configuration file set according to the version information of each device, and obtain a configuration file subset; a configuration module 406, used to perform network configuration on each device in the device set through the configuration file subset.

[0057] In an exemplary embodiment, the apparatus is also used to send query instructions in a query instruction set to a target device in sequence, wherein the target device is any device in the device set; when the target device responds to the i-th query instruction, obtain the version information of the target device from the response message of the target device to the i-th query instruction, wherein i is an integer greater than or equal to 1.

[0058] In an exemplary embodiment, the apparatus is also used to receive network information of a target device and verify the network information; if the verification is successful, the login operation is performed on the target device through the network information, wherein the target device is any device in the device set.

[0059] In an exemplary embodiment, the device is also used to determine that the verification is successful if the network information includes a network address and account information and the network address and account information are complete; otherwise, re-acquire the network address and account information.

[0060] In an exemplary embodiment, the apparatus is further used to determine a target path of the target device in the target mapping relationship based on the version information of the target device, wherein the target device is any device in the device set; and obtain a target configuration file of the target device based on the target path.

[0061] In an exemplary embodiment, the apparatus is further configured to obtain the target configuration file and the target path; and establish a target mapping relationship between the target configuration file, the target path, and the version information of the target device.

[0062] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0063] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0064] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0065] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0066] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0067] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.

[0068] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0069] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0070] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for batch network configuration, characterized in that: include: Get the version information of each device in the device collection; Determine, according to the version information of each of the devices, a configuration file of each of the devices in a configuration file set to obtain a configuration file subset; The network configuration is performed on each of the devices in the device set by using the configuration file subset.

2. The method according to claim 1, characterized in that Get the version information of each device in the device collection, including: Sending query instructions in the query instruction set to a target device in sequence, wherein the target device is any device in the device set; In a case where the target device responds to the i-th query instruction, the version information of the target device is obtained from a response message of the target device to the i-th query instruction, where i is an integer greater than or equal to 1.

3. The method according to claim 1, characterized in that: Before obtaining the version information of each device in the device set, the method further includes: Receiving network information of a target device and verifying the network information; When the verification is successful, a login operation is performed on the target device through the network information, wherein the target device is any device in the device set.

4. The method according to claim 3, characterized in that Verifying the network information includes: If the network information includes a network address and account information, and both the network address and the account information are complete, determining that the verification is successful; Otherwise, re-acquire the network address and the account information.

5. The method according to claim 1, characterized in that According to the version information of each of the devices, a configuration file of each of the devices is determined in the configuration file set to obtain a configuration file subset, including: Determining a target path of the target device in a target mapping relationship according to the version information of the target device, wherein the target device is any device in the device set; According to the target path, a target configuration file of the target device is obtained.

6. The method according to claim 5, characterized in that Before determining the target path of the target device in the target mapping relationship, the method further includes: Obtain the target configuration file and the target path; A target mapping relationship is established between the target configuration file, the target path and the version information of the target device.

7. A device for batch network configuration, characterized in that: include: The acquisition module is used to obtain the version information of each device in the device set; a determination module, configured to determine, according to the version information of each of the devices, a configuration file of each of the devices in a configuration file set, to obtain a configuration file subset; A configuration module is used to perform network configuration on each of the devices in the device set through the configuration file subset.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 6 when executed by a processor.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.