CN111901159B - Method and device for replacing equipment configuration ports in batches - Google Patents

Method and device for replacing equipment configuration ports in batches Download PDF

Info

Publication number
CN111901159B
CN111901159B CN202010678918.7A CN202010678918A CN111901159B CN 111901159 B CN111901159 B CN 111901159B CN 202010678918 A CN202010678918 A CN 202010678918A CN 111901159 B CN111901159 B CN 111901159B
Authority
CN
China
Prior art keywords
data
content
port
line
excel table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010678918.7A
Other languages
Chinese (zh)
Other versions
CN111901159A (en
Inventor
王洪涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unihub China Information Technology Co Ltd
Original Assignee
Unihub China Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unihub China Information Technology Co Ltd filed Critical Unihub China Information Technology Co Ltd
Priority to CN202010678918.7A priority Critical patent/CN111901159B/en
Publication of CN111901159A publication Critical patent/CN111901159A/en
Application granted granted Critical
Publication of CN111901159B publication Critical patent/CN111901159B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method and a device for replacing equipment configuration ports in batches, wherein the method comprises the following steps: acquiring original configuration data of equipment needing to replace ports, and storing the original configuration data as a text file; manually storing the planned replacement port data into an excel table; reading the excel table content, and processing the read data; comparing the processed data with the content of the text file line by line; and modifying the matched data in the original configuration data of the equipment until all matching and modification are completed. The method and the device can save a large amount of time, thereby improving the working efficiency and reducing the personnel cost and the error probability of companies.

Description

Method and device for replacing equipment configuration ports in batches
Technical Field
The invention relates to the field of network equipment replacement or migration cutover, in particular to a method and a device for replacing equipment configuration ports in batches.
Background
In the process of network device replacement or migration cutover, a large number of physical port replacement operations are often involved, the port configuration of the device before and after cutover is changed when the internal of the device is reflected to be replaced or migrated, the changed port names are basically not consistent (for example, G1/0/1 is changed into G3/0/8), and the situations of partial port change or all port change also occur, but in any case, the manual port configuration change needs to be searched once and replaced once, so the manual change efficiency is very low.
The general process of manually changing the configuration port of the equipment is as follows: the method comprises the steps of collecting original equipment configuration of equipment to be replaced or transferred, locating newport in the original configuration after locating oldport in the original configuration through a searching function according to a port (designated oldport) in a certain row in a design file port change table and a port number (located newport) after corresponding change in the row, using newport for replacement, repeatedly searching the design file port change table and the original configuration of the equipment line by line, and finally completing the change of all port configurations. Therefore, it takes long time to find the object by hand, and the efficiency is low and the problem is easy to occur.
Disclosure of Invention
In order to overcome the problem of low efficiency caused by manual operation, the invention provides a method and a device for replacing equipment configuration ports in batches, which help engineers to change the mode of replacing the equipment configuration port numbers according to a design file port change table from manual mode to automatic mode (manual mode refers to that one port (time) is searched for and replaced by one port (time) based on the design file port change table, and multiple times of completion are needed, automatic mode refers to that one batch query, one batch replacement and one time of completion), and the method and the device are quick and accurate, so that a large amount of working time is saved for the engineers to manufacture scripts, the efficiency is improved, and the error rate is reduced.
In order to achieve the purpose, the invention adopts the following technical scheme:
in an embodiment of the present invention, a method for replacing device configuration ports in batch is provided, where the method includes:
acquiring original configuration data of equipment needing port replacement and storing the original configuration data as a text file;
manually storing the planned replacement port data into an excel table;
reading excel table content, and processing the read data;
comparing the processed data with the content of the text file line by line;
and modifying the matched data in the original configuration data of the equipment until all matching and modification are completed.
Further, the planned replacement port data is manually stored in an excel table, and the method comprises the following steps:
and placing the old port in the design file port change table into a first column in the excel table, and placing the new port in the design file port change table into a second column in the excel table.
Further, reading the excel table content, and processing the read data, wherein the method comprises the following steps:
reading the excel table content, splicing the read first column content and the second column content according to a standard configuration template configured by the port, and storing the spliced first column content and the second column content into a list col 2.
Further, the first column and the second column contents are connected by a character string '|'.
Further, comparing the processed data with the content of the text file line by line, comprising:
reading the content of the text file line by line, storing the content into a list1, and copying one copy into a list 2;
and reading the content in list1, comparing the contents in the list col2 with the content in the list col, and outputting a matching item.
Further, modifying the matched data in the original configuration data of the equipment until all matching and modification are completed, including:
removing the content at the corresponding position in the list2 according to the matching item of the list1 in the previous step, and inserting the content matched in the list col2 at the corresponding position in the list2 until all matching is completed;
and outputting the content in list2, namely the replaced device configuration file.
Further, the text file is a txt format file.
In an embodiment of the present invention, an apparatus for replacing device configuration ports in batch is further provided, where the apparatus includes:
the data acquisition module is used for acquiring original configuration data of equipment needing to replace the port and storing the original configuration data as S1.Txt;
the data storage module is used for manually storing the planned replacement port data into the excel table;
the data processing module is used for reading the excel table content and processing the read data;
the data comparison module is used for comparing the processed data with the file content of the S1.Txt line by line;
and the data modification module is used for modifying the matched data in the original configuration data of the equipment until all matching and modification are completed.
In an embodiment of the present invention, a computer device is further provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the method for replacing the device configuration ports in batches.
In an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program for executing the method for replacing device configuration ports in batches is stored.
Has the advantages that:
the method and the device for replacing the equipment configuration ports in batches can rapidly finish the replacement of the port information in the replacement or migration equipment configuration information according to the collected network configuration information and the design file port change table, and provide a basis for rapidly replacing or migrating the network equipment.
Drawings
FIG. 1 is a flow chart illustrating a method for replacing device configuration ports in batches according to an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus for configuring ports of a batch replacement device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described below with reference to several exemplary embodiments, which should be understood to be presented only to enable those skilled in the art to better understand and implement the present invention, and not to limit the scope of the present invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, on the basis of acquiring original configuration data of equipment needing port replacement and storing the data in S1.TXT, an engineer acquiring the data gives a standard configuration template (in a form such as an interface port number) of the equipment port configuration, an old port in a design file port change table is firstly put into an excel table, content data in the read excel table is processed, then the processed data and the S1.TXT file content are compared line by line, and the matched data is modified in the original configuration data of the equipment until all matching and modification are completed.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Fig. 1 is a flowchart illustrating a method for configuring a port of a batch replacement device according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S101, collecting original configuration data of the equipment needing to replace the port, and storing the data as a text file S1.Txt.
And step S102, manually storing the planned replacement port data into an excel table.
Specifically, an old port in the design file port change table is placed in a first column in the excel table, and a new port in the design file port change table is placed in a second column in the excel table.
And step S103, reading the excel table content, and processing the read data.
Specifically, the excel table content is read, and the read first column content and second column content are spliced (for example, interface100GE9/0/0 is intactum 100ge2/10/0/0, where 100GE9/0/0 is a new port and 100GE2/10/0/0 is an old port) according to a standard configuration template (form interface port number) configured by a port and are stored in the list col 2.
Step S104 and step S105 compare the processed data with the content of the text file S1.Txt line by line.
Specifically, reading the content of the text file S1.Txt line by line, storing the content into a list1, and copying the content into a list 2; and reading the content in list1, comparing the contents in the list col2 with the content in the list col, and outputting a matching item.
And step S106 and step S107, modifying the matched data in the original configuration data of the equipment until all matching and modification are completed.
Specifically, the content at the corresponding position in list2 is removed according to the matching item of list1 in step S105, and the content matched in list col2 is inserted at the corresponding position in list2 until all matching is completed; and outputting the content in list2, namely the replaced device configuration file.
It should be noted that although the operations of the method of the present invention have been described in the above embodiments and the accompanying drawings in a particular order, this does not require or imply that these operations must be performed in this particular order or that all of the illustrated operations must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
For a clearer explanation of the method for configuring the ports of the batch replacement device, a specific embodiment is described below, however, it should be noted that the embodiment is only for better explaining the present invention and is not to be construed as an undue limitation to the present invention.
Taking a metropolitan area network as an example, the following specific process is that the device configuration ports need to be replaced in batch:
step S101: the configuration storage of the acquisition equipment is S1.Txt, and the information stored in the acquired equipment configuration file is assumed as follows:
Figure BDA0002585066930000071
/>
Figure BDA0002585066930000081
/>
Figure BDA0002585066930000091
/>
Figure BDA0002585066930000101
/>
Figure BDA0002585066930000111
the design file port change table is as follows:
Figure BDA0002585066930000112
step S102: manually copying and storing the planned and replaced port data into excel, wherein the first column is an old port, and the second column is a new port, and the method specifically comprises the following steps:
Figure BDA0002585066930000113
/>
Figure BDA0002585066930000121
step S103: reading the excel table content in step S102, and processing the read data, wherein the first column and the second column are connected by the character string '|' and stored in the list col 2:
['interface GigabitEthernet1/1/0|interface Ethernet1/3/0/0','interface GigabitEthernet1/1/1|interface Ethernet1/3/0/1','interface GigabitEthernet3/0/10|interface Ethernet2/13/0/0','interface GigabitEthernet3/0/11|interface Ethernet2/13/0/1','interface Pos4/0/0|interface Pos2/1/0/0']
step S104: reading the contents of the S1.TXT file line by line, storing the contents into a list1, and copying the contents into a list 2:
list1 stores the following:
['sysname SN-BJ-DS-CR-1.MAN.NE5KE','#','....','#','interface Eth-Trunk10','description dT:Zhuan-Xian-user-Manager','set flow-stat interval 10','ip address 172.31.255.1 255.255.255.252','mac-address 9ce3-852c-5907','#','#','interface Ethernet1/3/0/0','description***','undo shutdown','ipv6 enable','ipaddress 10.XX.15.25 255.255.255.252','ipv6 address XXXX:F:2001:1500::2/127','pimsm','ospfv3 1 area 0.0.0.0','ospfv3 network-type p2p','ospf network-type p2p','ip netstream inbound','ip netstream sampler fix-packets 1000inbound','mpls','mpls ldp','trust upstream SN-QOS-1','traffic-policy tpFromBAS/SR inbound','#','interface Ethernet1/3/0/1','description dT:***','undo shutdown','ipv6 enable','ip address 10.XX.15.37255.255.255.252','ipv6 address XXXX:F:2001:1600::2/127','pim sm','ospfv3 1 area 0.0.0.0','ospfv3 network-type p2p','ospf network-type p2p','ip netstream inbound','ip netstream sampler fix-packets 1000 inbound','mpls','mpls ldp','trust upstream SN-QOS-1','traffic-policy tpFromBAS/SR inbound','#','interface Ethernet2/13/0/0','description dT:***','undo shutdown','eth-trunk 10','#','interface Ethernet2/13/0/1','description dT:***','undo shutdown','eth-trunk 10','#','interface Ethernet1/14/0/1','description dT:**:10GE5/0/0','undo shutdown','ipv6 enable','ip address 10.XX.13.9 255.255.255.252','ipv6 address XXXX:F:2001:400::2/127','pim sm','ospfv3 1 area 0.0.0.0','ospfv3 network-type p2p','ospf network-type p2p','ip netstream inbound','ip netstream sampler fix-packets 1000 inbound','mpls','mpls ldp','trust upstream SN-QOS-1','traffic-policy tpForDPI inbound','#','interface Pos2/1/0/0','mtu 9178','description uT:SN-**-C-1.163:Pos3/11/0/0 40G(40G0001IPM)','undo shutdown','ipv6 enable','ip address 21.14.131.2 255.255.255.252','ipv6 address XXXX:F:2001:1::3/127','link-protocol ppp','ip netstream inbound','ip netstream sampler fix-packets 1000 inbound','statistic mode forward','traffic-policy 163-To-BaoJi inbound','traffic-policy BAOJI-To-163 outbound','#','....']
step S105: reading the content in list1, combining the content in col2, comparing the contents of the two, and outputting a matching item (only one item is output in each loop statement):
matching item in interface Ethernet1/3/0/0// list1
Matching terms in interface gigabit Ethernet1/1/0 dense interface Ethernet1/3/0/0// col2
Or
Matching terms in interface Ethernet1/3/0/1// list1
Matching terms in interface gigabit Ethernet1/1 silica fume interface Ethernet1/3/0/1// col2
Or
Matching item in interface Ethernet2/13/0/0// list1
Matching terms in interface gigabit Ethernet3/0/10 shunts interface Ethernet2/13/0/0// col2
Or
Matching terms in interface Ethernet2/13/0/1// list1
Matching terms in interface gigabit Ethernet3/0/11 fume interconnect Ethernet2/13/0/1// col2
Or
Matching items in interface Pos2/1/0/0// list1
interface Pos4/0/0 intaglia matching item in interface Pos2/1/0/0// col2
And S106, removing the content at the corresponding position in the list2 according to the matching item of the list1 in the step S105, inserting the matched content in the col2, and replacing the list2 information as follows: <xnotran> [ 'sysname SN-BJ-DS-CR-1.MAN.NE5KE', '#', '....', '#', 'interface Eth-Trunk10', 'description dT: zhuan-Xian-user-Manager', 'setflow-statinterval 10', 'ip address 172.31.255.1 255.255.255.252', 'mac-address 9ce3-852c-5907', '#', '#', 'interface GigabitEthernet1/1/0', 'description * * *', 'undo shutdown', 'ipv6 enable', 'ip address 10.XX.15.25 255.255.255.252', 'ipv6 address XXXX: F:2001:1500::2/127', 'pimsm', 'ospfv 31 area 0.0.0.0', 'ospfv3 network-type p2p', 'ospf network-type p2p', 'ip netstream inbound', 'ip netstream sampler fix-packets 1000 inbound', 'mpls', 'mpls ldp', 'trust upstream SN-QOS-1', 'traffic-policy tpFromBAS/SR inbound', '#', 'interface GigabitEthernet1/1/1', 'descriptiondT: * * *', 'undo shutdown', 'ipv6 enable', 'ip address 10.XX.15.37 255.255.255.252', 'ipv6 address XXXX: F:2001:1600::2/127', 'pim sm', 'ospfv 31 area 0.0.0.0', 'ospfv3 network-type p2p', 'ospf network-type p2p', 'ip netstream inbound', 'ip netstream sampler fix-packets 1000 inbound', 'mpls', 'mpls ldp', 'trust upstream SN-QOS-1', 'traffic-policy tpFromBAS/SR inbound', '#', 'interface GigabitEthernet3/0/10', 'description dT: * * *', 'undo shutdown', 'eth-trunk 10', '#', 'interface GigabitEthernet3/0/11', 'description dT: * * *', 'undo shutdown', </xnotran> <xnotran> 'eth-trunk 10', '#', 'interface Ethernet1/14/0/1', 'description dT: * *:10GE5/0/0', 'undo shutdown', 'ipv6 enable', 'ip address 10.XX.13.9 255.255.255.252', 'ipv6 address XXXX: F:2001:400::2/127', 'pim sm', 'ospfv 31 area 0.0.0.0', 'ospfv3 network-type p2p', 'ospf network-type p2p', 'ip netstream inbound', 'ip netstream sampler fix-packets 1000 inbound', 'mpls', 'mpls ldp', 'trust upstream SN-QOS-1', 'traffic-policy tpForDPI inbound', '#', 'interface Pos4/0/0', 'mtu 9178', 'description uT: SN- * * -C-1.163:Pos3/11/0/0 40G (40G 0001 IPM)', 'undo shutdown', 'ipv6 enable', 'ip address 21.14.131.2 255.255.255.252', 'ipv6 address XXXX: F:2001:1::3/127', 'link-protocol ppp', 'ip netstream inbound', 'ip netstream sampler fix-packets 1000 inbound', 'statistic mode forward', 'traffic-policy 163-To-BaoJi inbound', 'traffic-policy BAOJI-To-163 outbound', '#', '....' ] </xnotran>
Step S107: the content in the output list2 is the replaced device configuration file:
sysname SN-BJ-DS-CR-1.MAN.NE5KE
#
....
#
interface Eth-Trunk10
description dT:Zhuan-Xian-user-Manager
set flow-stat interval 10
ip address 172.31.255.1 255.255.255.252
mac-address 9ce3-852c-5907
#
#
interface GigabitEthernet1/1/0
description***
undo shutdown
ipv6 enable
ip address 10.XX.15.25 255.255.255.252
ipv6 address XXXX:F:2001:1500::2/127
pim sm
ospfv3 1 area 0.0.0.0
ospfv3 network-type p2p
ospf network-type p2p
ip netstream inbound
ip netstream sampler fix-packets 1000 inbound
Mpls
mpls ldp
trust upstream SN-QOS-1
traffic-policy tpFromBAS/SR inbound
#
interface GigabitEthernet1/1/1
description dT:***
undo shutdown
ipv6 enable
ip address 10.XX.15.37 255.255.255.252
ipv6 address XXXX:F:2001:1600::2/127
pim sm
ospfv3 1 area 0.0.0.0
ospfv3 network-type p2p
ospf network-type p2p
ip netstream inbound
ip netstream sampler fix-packets 1000 inbound
Mpls
mpls ldp
trust upstream SN-QOS-1
traffic-policy tpFromBAS/SR inbound
#
interface GigabitEthernet3/0/10
description dT:***
undo shutdown
eth-trunk 10
#
interface GigabitEthernet3/0/11
description dT:***
undo shutdown
eth-trunk 10
#
interface Ethernet1/14/0/1
description dT:**:10GE5/0/0
undo shutdown
ipv6 enable
ip address 10.XX.13.9 255.255.255.252
ipv6 address XXXX:F:2001:400::2/127
pim sm
ospfv3 1 area 0.0.0.0
ospfv3 network-type p2p
ospf network-type p2p
ip netstream inbound
ip netstream sampler fix-packets 1000 inbound
Mpls
mpls ldp
trust upstream SN-QOS-1
traffic-policy tpForDPI inbound
#
interface Pos4/0/0
mtu 9178
description uT:SN-**-C-1.163:Pos3/11/0/0 40G(40G0001IPM)
undo shutdown
ipv6 enable
ip address 21.14.131.2 255.255.255.252
ipv6 address XXXX:F:2001:1::3/127
link-protocol ppp
ip netstream inbound
ip netstream sampler fix-packets 1000 inbound
statistic mode forward
traffic-policy 163-To-BaoJi inbound
traffic-policy BAOJI-To-163 outbound
#
....
based on the same inventive concept, the invention also provides a device for replacing the equipment configuration ports in batches. The implementation of the device can be referred to the implementation of the method, and repeated details are not repeated. The term "module," as used below, may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a schematic structural diagram of an apparatus for configuring a port of a batch replacement device according to an embodiment of the present invention. As shown in fig. 2, the apparatus includes:
and the data acquisition module 201 is configured to acquire original configuration data of the device whose port needs to be replaced, and store the original configuration data as a text file s1.Txt.
And the data storage module 202 is used for manually storing the planned replacement port data into the excel table.
Specifically, an old port in the design file port change table is placed in a first column in the excel table, and a new port in the design file port change table is placed in a second column in the excel table.
And the data processing module 203 is used for reading the excel table content and processing the read data.
Specifically, the excel table content is read, and the read first column content and second column content are spliced (for example, interface100GE9/0/0 is a new port, 100GE2/10/0/0 is an old port) according to a standard configuration template (a form interface port number) configured by the port and stored in the list col 2.
The data comparison module 204 compares the processed data with the content of the text file s1.Txt line by line.
Specifically, reading the content of the text file S1.Txt line by line, storing the content into a list1, and copying the content into a list 2; and reading the content in list1, comparing the contents in the list col2 with the content in the list col, and outputting a matching item.
And the data modification module 205 modifies the matched data in the original configuration data of the equipment until all matching and modification are completed.
Specifically, the content at the corresponding position in list2 is removed according to the matching item of list1 in the data comparison module 204, and the content matched in list col2 is inserted at the corresponding position in list2 until all matching is completed; and outputting the content in list2, namely the replaced device configuration file.
It should be noted that although several modules of the apparatus for bulk replacement of device configuration ports are mentioned in the above detailed description, such partitioning is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module according to embodiments of the invention. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Based on the aforementioned inventive concept, as shown in fig. 3, the present invention further provides a computer device 300, which includes a memory 310, a processor 320, and a computer program 330 stored in the memory 310 and executable on the processor 320, wherein the processor 320 executes the computer program 330 to implement the aforementioned method for batch replacement of device configuration ports.
Based on the above inventive concept, the present invention also provides a computer-readable storage medium storing a computer program for executing the method for replacing device configuration ports in batches.
The method and the device for replacing the equipment configuration ports in batches can save a large amount of time, thereby improving the working efficiency and reducing the personnel cost and the error probability of companies.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
The present invention is not limited to the above embodiments, and it should be understood by those skilled in the art that various modifications and changes may be made without inventive changes in the technical solutions of the present invention.

Claims (10)

1. A method for replacing device configuration ports in a batch, the method comprising:
acquiring original configuration data of equipment needing to replace ports, and storing the original configuration data as a text file;
manually storing the planned replacement port data into an excel table;
reading excel table content, and processing the read data;
comparing the processed data with the content of the text file line by line;
and modifying the matched data in the original configuration data of the equipment until all matching and modification are completed.
2. The method for configuring ports for batch replacement equipment according to claim 1, wherein the step of manually storing planned replacement port data into an excel table comprises the following steps:
and placing the old port in the design file port change table into a first column in the excel table, and placing the new port in the design file port change table into a second column in the excel table.
3. The method for replacing the equipment configuration port in batches according to claim 1, wherein the step of reading excel table contents and processing the read data comprises the following steps:
reading excel table contents, splicing the read first column contents and the read second column contents according to a standard configuration template configured by a port, and storing the spliced first column contents and the read second column contents into a list col 2.
4. The method of mass replacement device configuration port according to claim 3, wherein the first and second column contents are connected by a string '|'.
5. The method of mass replacement device configuration port according to claim 1, wherein comparing the processed data with the content of the text file on a line-by-line basis comprises:
reading the text file content line by line, storing the text file content into a list1, and copying one copy into a list 2;
and reading the content in list1, comparing the contents in the list col2 with the content in the list col, and outputting a matching item.
6. The method for replacing device configuration ports in batches according to claim 1, wherein the matched data is modified in the original configuration data of the device until all matching and modification are completed, and the method comprises the following steps:
removing the content at the corresponding position in the list2 according to the matching item of the list1 in the previous step, and inserting the content matched in the list col2 at the corresponding position in the list2 until all matching is completed;
and outputting the content in list2, namely the replaced device configuration file.
7. The method of mass replacement of device configuration ports according to claim 1, wherein said text file is a txt format file.
8. An apparatus for batch replacement of equipment configuration ports, the apparatus comprising:
the data acquisition module is used for acquiring original configuration data of equipment needing to replace the port and storing the original configuration data as S1.Txt;
the data storage module is used for manually storing the planned replacement port data into the excel table;
the data processing module is used for reading the excel table content and processing the read data;
the data comparison module is used for comparing the processed data with the file content of the S1.Txt line by line;
and the data modification module is used for modifying the matched data in the original configuration data of the equipment until all matching and modification are completed.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1-7.
CN202010678918.7A 2020-07-15 2020-07-15 Method and device for replacing equipment configuration ports in batches Active CN111901159B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010678918.7A CN111901159B (en) 2020-07-15 2020-07-15 Method and device for replacing equipment configuration ports in batches

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010678918.7A CN111901159B (en) 2020-07-15 2020-07-15 Method and device for replacing equipment configuration ports in batches

Publications (2)

Publication Number Publication Date
CN111901159A CN111901159A (en) 2020-11-06
CN111901159B true CN111901159B (en) 2023-04-07

Family

ID=73191335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010678918.7A Active CN111901159B (en) 2020-07-15 2020-07-15 Method and device for replacing equipment configuration ports in batches

Country Status (1)

Country Link
CN (1) CN111901159B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112468897B (en) * 2020-11-13 2023-03-10 中盈优创资讯科技有限公司 PON port cut-over automatic configuration method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175317A (en) * 2019-04-26 2019-08-27 武汉欧铭达科技有限公司 A kind of txt batch turns the data method of Excel
CN110572278A (en) * 2019-08-19 2019-12-13 中盈优创资讯科技有限公司 Method and device for positioning information of three-layer gateway of metropolitan area network
CN111125169A (en) * 2019-11-28 2020-05-08 江苏苏宁物流有限公司 Data query method, control device, medium and computer equipment
CN111240763A (en) * 2020-01-13 2020-06-05 广州虎牙科技有限公司 Configuration updating method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10936694B2 (en) * 2018-04-13 2021-03-02 Vmware, Inc Methods and apparatus to analyze telemetry data in a networked computing environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175317A (en) * 2019-04-26 2019-08-27 武汉欧铭达科技有限公司 A kind of txt batch turns the data method of Excel
CN110572278A (en) * 2019-08-19 2019-12-13 中盈优创资讯科技有限公司 Method and device for positioning information of three-layer gateway of metropolitan area network
CN111125169A (en) * 2019-11-28 2020-05-08 江苏苏宁物流有限公司 Data query method, control device, medium and computer equipment
CN111240763A (en) * 2020-01-13 2020-06-05 广州虎牙科技有限公司 Configuration updating method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111901159A (en) 2020-11-06

Similar Documents

Publication Publication Date Title
US5745897A (en) Method and system for compiling management information base specifications
CN104462517A (en) Data synchronizing method and device
CN101582081A (en) Data comparison method and device
CN111901159B (en) Method and device for replacing equipment configuration ports in batches
CN111901451A (en) Method and device for combing reference relationship between private line user domain and address pool
CN111858730A (en) Data importing and exporting device, method, equipment and medium of graph database
WO2016074412A1 (en) Compatibility administration method based on network configuration protocol, storage medium and device
CN107609197B (en) A kind of method of data synchronization, data synchronization unit and mobile terminal
CN109491923B (en) Method, device, medium and electronic equipment for determining newly added abnormal code
CN115378862B (en) Method, device, equipment and medium for route configuration with grouping function
CN111651397A (en) Method and equipment for accessing peripheral module of PXIe
CN103778114A (en) System and method for file recovery
CN116010345A (en) Method, device and equipment for realizing table service scheme of flow batch integrated data lake
CN105607957B (en) A kind of data acquisition analysis system based on OPC DA
CN102930045A (en) Multi-device formula management method of integrated circuit production line
CN107770265B (en) A kind of method of data synchronization, data synchronization unit and mobile terminal
CN113282616A (en) Incremental time sequence data conflict detection method and device and storage medium
CN109739506B (en) Method and system for processing library function missing in high-performance application compilation
CN112242953B (en) Method and device for realizing end-to-end path dynamic management based on ISIS
CN109992701B (en) Chain table implementation method, device and equipment and readable storage medium
CN113157979B (en) Method, system and medium for constructing kernel module relation graph based on dummy module node
CN115374218B (en) Data synchronization method, device, equipment and medium of heterogeneous database
CN112436993B (en) VPN private line discovery method and device based on configuration file analysis
WO2024041358A1 (en) Configuration file updating method and apparatus, electronic device and readable storage medium
CN116225471A (en) Deployment method of elastic search cluster, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: 200000 room 702-2, No. 4811 Cao'an Road, Jiading District, Shanghai

Patentee after: CHINA UNITECHS

Address before: Room 1004-4, 10 / F, 1112 Hanggui Road, Anting Town, Jiading District, Shanghai

Patentee before: CHINA UNITECHS

CP02 Change in the address of a patent holder