Network equipment configuration method and device, equipment, medium and product

By creating a copy of the configuration file on the network device and automatically correcting the incorrect configuration change commands, the network device configuration problem caused by the incorrect command is solved, ensuring the connectivity and stability of the network device, and improving the efficiency and reliability of network management.

CN119603148AActive Publication Date: 2025-03-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411781926.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-11
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In the prior art, when the network device configuration is changed, the configuration problems may lead to configuration problems, affecting the connectivity and stability of the network device.

Method used

By creating a copy of the configuration file of the network device, execute the configuration change command, and verify its effectiveness when the command has not been reported; if the command error is reported, it will automatically find the matching reference command for correction, and repeat the verification process. Once the verification is passed, the changed copy is synchronized to the original configuration file according to the timing time.

Benefits of technology

It effectively avoids network equipment configuration problems caused by incorrect commands, ensures the connectivity and stability of network equipment, is not affected by the direct risks of configuration changes, and improves the efficiency and reliability of network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603148A_ABST
    Figure CN119603148A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a configuration method and device of network equipment, equipment, a medium and a product, and relates to the field of financial science and technology or other related fields. The method comprises the following steps: firstly, creating a copy of a configuration file of the network equipment, and executing a configuration change command on the copy; if the configuration change command does not report errors, verifying whether the configuration change command takes effect or not; and if the configuration change command reports an error, automatically searching the matched reference command for correction, and repeating the verification process. And once the verification is passed, according to the set timing time, synchronizing the copy which has executed the change command to the configuration file of the original network equipment. According to the method, the copy of the network equipment is created and the wrong configuration change command is automatically corrected, so that the risk possibly caused by directly executing the configuration change command on the original configuration file is avoided, and the connectivity and the stability of the network equipment are ensured not to be influenced; therefore, a powerful guarantee is provided for stable operation of the network equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology or other related fields, and in particular to a configuration method, device, equipment, medium and product for a network device. Background Art

[0002] With the rapid development of information technology, network devices such as routers, switches and integrated routers and switches play a vital role in modern network communications. They are not only responsible for data transmission and forwarding, but also undertake the construction and maintenance of network topology to ensure efficient and reliable flow of information in complex network environments.

[0003] In the existing network device management, when the configuration of a network device needs to be changed, the network change personnel must execute command configuration operations on the network device before knowing whether the network device has been changed successfully.

[0004] However, this operation of directly changing commands on network devices may cause configuration problems of network devices due to incorrect commands, thereby affecting the connectivity and stability of the network devices. Summary of the invention

[0005] The present application provides a method, apparatus, device, medium and product for configuring a network device, which are used to solve the technical problem that problems occur in the configuration of the network device due to incorrect commands, thereby affecting the connectivity and stability of the network device.

[0006] In a first aspect, the present application provides a method for configuring a network device, comprising:

[0007] creating a copy of a configuration file of the first network device;

[0008] Execute the configuration change command for the replica, and if the configuration change command does not report an error, verify whether the configuration change command is effective; if the configuration change command reports an error, find a reference command that matches the configuration change command, modify the configuration change command based on the found reference command, and repeat this step;

[0009] When it is verified that the configuration change command is effective, the copy after the configuration change command for the copy is executed is synchronized to the configuration file of the first network device according to the scheduled time.

[0010] In a possible implementation manner, searching for a reference command matching the configuration change command, and modifying the configuration change command based on the found reference command includes:

[0011] Determine a fixed participle in the configuration change command, and search for a reference command matching the fixed participle;

[0012] A reference participle matching the error participle in the configuration change command is determined from the reference command, and the error participle in the configuration change command is corrected to the reference participle.

[0013] In a possible implementation manner, searching for a reference command matching the configuration change command, and modifying the configuration change command based on the found reference command includes:

[0014] The first network device searches for a reference command matching the configuration change command, and modifies the configuration change command based on the reference command found on the first network device.

[0015] In a possible implementation manner, when the configuration change command is modified based on the reference command found on the first network device and an error is reported when the configuration change command for the copy is executed again, searching for a reference command matching the configuration change command and modifying the configuration change command based on the found reference command includes:

[0016] A reference command matching the configuration change command is searched from other network devices other than the first network device, and the configuration change command is modified based on the reference command found from the other network devices.

[0017] In a possible implementation manner, searching for a reference command matching the configuration change command from other network devices other than the first network device includes:

[0018] Acquire a network device search table of the first network device, wherein the network device search table includes a plurality of network devices other than the first network device and a brand, model, and weight of each network device;

[0019] Determine from the network device search table a second network device of the same brand and model as the first network device with the highest weight;

[0020] Search the second network device for a reference command that matches the configuration change command.

[0021] In a possible implementation manner, when the configuration change command is corrected based on the reference command found on the second network device and an error is reported when the configuration change command for the copy is executed again, searching for a reference command matching the configuration change command on other network devices other than the first network device includes:

[0022] Determine from the network device search table a third network device with the same brand but different model as the first network device and with the highest weight;

[0023] A reference command matching the configuration change command is searched on the third network device.

[0024] In a possible implementation manner, before synchronizing the replica after executing the configuration change command for the replica at a scheduled time to the configuration file of the first network device, the method further includes:

[0025] A configuration change review confirmation instruction and a change execution reservation instruction are received, wherein the configuration change review confirmation instruction is used to indicate that the configuration change command for the copy is executed and the verification review is passed, and the change execution reservation instruction is used to indicate the timing time.

[0026] In a second aspect, the present application provides a configuration device for a network device, comprising:

[0027] A creation module, used to create a copy of the configuration file of the first network device;

[0028] An execution module, used for executing a configuration change command for the replica;

[0029] A verification module, used to verify whether the configuration change command is effective when no error is reported by the configuration change command;

[0030] A search module, used for searching for a reference command matching the configuration change command when the configuration change command reports an error;

[0031] A correction module, used to correct the configuration change command based on the found reference command, and repeat this step;

[0032] The synchronization module is used to synchronize the copy after executing the configuration change command for the copy to the configuration file of the first network device according to the scheduled time when verifying that the configuration change command is effective.

[0033] In a possible implementation manner, the device further includes: a determination module;

[0034] The determining module is used to determine the fixed participles in the configuration change command;

[0035] The search module is used to search for a reference command matching the fixed participle;

[0036] The determination module is further configured to determine, from the reference command, a reference participle that matches the error participle in the configuration change command;

[0037] The correction module is specifically used to correct the error segmentation in the configuration change command into the reference segmentation.

[0038] In a possible implementation manner, the search module is further configured to search the first network device locally for a reference command that matches the configuration change command;

[0039] The correction module is specifically configured to correct the configuration change command based on the reference command found on the first network device.

[0040] In a possible implementation manner, the search module is further configured to search for a reference command matching the configuration change command from other network devices other than the first network device;

[0041] The correction module is specifically used to correct the configuration change command based on the reference command found from the other network devices.

[0042] In a possible implementation manner, the device further includes: an acquisition module;

[0043] The acquisition module is further used to acquire a network device retrieval table of the first network device, wherein the network device retrieval table includes a plurality of other network devices other than the first network device and the brand, model and weight of each network device;

[0044] The determination module is further used to determine, from the network device search table, a second network device of the same brand and model as the first network device with the highest weight;

[0045] The search module is specifically configured to search the second network device for a reference command that matches the configuration change command.

[0046] In a possible implementation manner, the determination module is further configured to determine, from the network device search table, a third network device with the same brand but different model as the first network device and having the highest weight;

[0047] The search module is specifically configured to search the third network device for a reference command that matches the configuration change command.

[0048] In a possible implementation manner, the device further includes: a receiving module;

[0049] The receiving module is used to receive a configuration change review and confirmation instruction and a change execution reservation instruction, wherein the configuration change review and confirmation instruction is used to indicate that the configuration change command for the copy has been executed and the verification review has passed, and the change execution reservation instruction is used to indicate the timing time.

[0050] In a third aspect, an embodiment of the present application provides a configuration device for a network device, including: a memory, a processor;

[0051] The memory stores computer-executable instructions;

[0052] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0055] The present application provides a configuration method, apparatus, device, medium and product for a network device. The method first creates a copy of the configuration file of the network device and executes a configuration change command on the copy. If the configuration change command does not report an error, verify whether it is effective; if the configuration change command reports an error, automatically find a matching reference command to correct it, and repeat the verification process. Once the verification is passed, the copy of the executed change command is synchronized to the configuration file of the original network device according to the set timing. This method avoids the risks that may be caused by executing configuration change commands directly on the original configuration file by creating a copy of the network device and automatically correcting erroneous configuration change commands, thereby ensuring that the connectivity and stability of the network device are not affected, thereby providing a strong guarantee for the stable operation of the network device. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0057] Figure 1 Schematic diagram of the process of configuring the network device provided in this application Figure 1 ;

[0058] Figure 2 Schematic diagram of the process of configuring the network device provided in this application Figure 2 ;

[0059] Figure 3 Schematic diagram of the process of configuring the network device provided in this application Figure 3 ;

[0060] Figure 4 A schematic diagram of the topological structure of the network equipment provided for this application;

[0061] Figure 5 A schematic diagram of the structure of a configuration device for a network device provided in this application;

[0062] Figure 6 A schematic diagram of the structure of a configuration device for a network device provided in this application.

[0063] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0064] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0065] It should be noted that the configuration methods, devices, equipment, media and products of the network equipment provided in this application can be used in the field of financial technology or other related fields, and can also be used in any field other than the field of financial technology or other related fields. This application does not limit the application field of the configuration methods, devices, equipment, media and products of the network equipment.

[0066] With the rapid development of information technology, network devices such as routers, switches, and integrated routers and switches play a vital role. They not only build the basic framework of the network, realize data transmission and forwarding, but also ensure that information can flow accurately in a complex and changing network environment.

[0067] In the prior art, when the configuration of a network device needs to be changed, the network change personnel must execute command configuration operations on the network device before knowing whether the network device has been changed successfully.

[0068] However, this operation of directly changing commands on network devices may cause configuration problems of network devices due to incorrect commands, thereby affecting the connectivity and stability of the network devices.

[0069] In response to the above problems, the present application provides a configuration method for a network device. The method first creates a copy of the configuration file of the network device, and executes a configuration change command on the copy. If the configuration change command does not report an error, it is verified whether it is effective; if the configuration change command reports an error, a matching reference command is automatically found for correction, and the verification process is repeated. Once the verification is passed, the copy of the executed change command is synchronized to the configuration file of the original network device according to the set timing. By creating a copy of the network device and automatically correcting the erroneous configuration change command, the method avoids the risks that may be caused by directly executing the configuration change command on the original configuration file, thereby ensuring that the connectivity and stability of the network device are not affected, thereby providing a strong guarantee for the stable operation of the network device.

[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Figure 1 Schematic diagram of the process of configuring the network device provided in this application Figure 1 . Applied to the first network device. Figure 1 As shown, the method includes:

[0072] S101. Create a copy of a configuration file of a first network device.

[0073] The first network device is used to indicate a device that needs to update the configuration file at the current moment.

[0074] The first network device includes but is not limited to: a router, a switch, and an all-in-one router and switch.

[0075] The purpose of creating a copy of the configuration file of the first network device in this step is to protect the network device that currently needs to update the configuration file.

[0076] It is understandable that when the network change personnel need to update the configuration file of the first network device, in order to protect the configuration file and avoid the risks that may be caused by direct modification, they will send a creation instruction to the operating system corresponding to the first network device. The purpose of this instruction is to inform the operating system that a copy of the configuration file needs to be created for the network device. By doing so, the network change personnel can update and test the copy without directly modifying the original configuration file. This method can effectively prevent the configuration file from being damaged or wrong due to operational errors, thereby ensuring the stable operation of the network device and the security of the configuration.

[0077] For example, assume that the first network device is an MP2900-14 routing switch. It is known that the network change personnel currently need to update the configuration file startup of the MP2900-14 routing switch. Based on the above information, the network change personnel will first log in to the operating system corresponding to the MP2900-14 routing switch. Then, they will issue a creation instruction to the operating system, requiring the system to create a copy of the startup configuration file of the MP2900-14 routing switch. In response to this instruction, the operating system will immediately perform the creation operation and dynamically allocate a temporary space in its internal storage system. Subsequently, the operating system will copy the entire content of the startup configuration file to this temporary space and name the new file startup1. In this way, the network change personnel can update and test the copy file without affecting the original production configuration file.

[0078] S102. Execute the configuration change command for the replica. If the configuration change command does not report an error, verify whether the configuration change command is effective. If the configuration change command reports an error, find a reference command that matches the configuration change command, modify the configuration change command based on the found reference command, and repeat this step.

[0079] The situation where no error is reported for the configuration change command includes but is not limited to: no error occurs in the command format, no parameter mismatch occurs, or no error occurs in the syntax.

[0080] The purpose of this step is to execute the change commands on the copy of the configuration file without affecting the original configuration file and verify that the changes are effective as expected.

[0081] It can be understood that after the network change personnel inputs the configuration change command to the operating system corresponding to the first network device, if the operating system confirms that the command is correct (that is, no error occurs) through its built-in instruction detection mechanism, it is necessary to further verify whether these changes are accepted by the first network device and take effect; if it is determined that an error occurs in the configuration change command, it is necessary to find and match the corresponding reference command for correction, and repeat this step until the configuration change command can be correctly executed and take effect.

[0082] For example, suppose the network change personnel input the configuration change command "mac-address static AAAA.AAAA.AAAA vlan 100interface FastEthernet0 / 33" and the verification command "ping 192.168.168.168" on the operating system corresponding to the MP2900-14 routing switch that needs to update the configuration. The operating system will then perform an error check on the configuration change command through its built-in command detection mechanism. If the command is correct, the network change personnel will verify whether the configuration change command has been accepted and taken effect by the first network device through the verification command; if an error is detected in the configuration change command, the operating system will automatically correct the configuration change command and re-enter the corrected command for execution and verification until the configuration change command can be correctly executed and takes effect.

[0083] Optionally, the present application provides a method for finding a reference command that matches a configuration change command, and modifying the configuration change command based on the found reference command, including;

[0084] The first step is to determine the fixed participle in the configuration change command and find the reference command that matches the fixed participle.

[0085] The purpose of determining the fixed segmentation words in the configuration change command in this step is to filter out those words that are consistent in grammatical format and segmentation format and have no errors in content from the configuration change command.

[0086] The purpose of searching for a reference command that matches a fixed participle is to find a command that can correct an incorrect configuration change command.

[0087] In the second step, a reference participle matching the error participle in the configuration change command is determined from the reference command, and the error participle in the configuration change command is corrected to the reference participle.

[0088] The purpose of this step is to locate and correct errors in the configuration change command by using the correct reference command.

[0089] In this step, a reference word matching the error word in the configuration change command is first searched from the reference command, and then, when a matching reference word is found, the operating system immediately replaces the error word in the configuration change command with the correct reference word.

[0090] S103: When verifying that the configuration change command is effective, synchronize the copy after executing the configuration change command on the copy to the configuration file of the first network device according to the scheduled time.

[0091] The timing time is used to determine when to synchronize the configuration change command for the replica to the configuration file of the first network device.

[0092] The timing time may be, for example, immediately, or a specific future time point, or may be determined based on a periodic event (such as a fixed time of day), and the present application does not impose any special restrictions on this.

[0093] The purpose of this step is to ensure that these changes can be synchronized to the configuration file of the first network device at a predetermined time based on verifying that the configuration change command has taken effect.

[0094] It can be understood that synchronizing the verified and effective copy to the configuration file of the first network device according to the preset timing not only ensures that the configuration changes can be accurately applied to the first network device according to the predetermined plan, but also effectively reduces the potential risks caused by the configuration changes, thereby ensuring the stable operation of the first network device.

[0095] For example, suppose the configuration change command is "mac-address static 0000.5E00.01A5 vlan 100interface FastEthernet0 / 33". It is known that the network change personnel set the scheduled time to 10 pm. Then at the set 10 pm, the operating system will automatically trigger the synchronization operation and synchronize the copy content that already contains the configuration change command after it takes effect to the original configuration file of the MP2900-14 routing switch.

[0096] Optionally, after synchronizing the copy after executing the configuration change command for the copy to the configuration file of the first network device at a scheduled time, in order to save storage space and avoid potential configuration confusion, the present application will also automatically delete the copy on which the change operation has been performed.

[0097] The configuration method of a network device provided in an embodiment of the present application first creates a copy of a configuration file for a first network device, and then executes a configuration change command on the copy. If the configuration change command is executed correctly, it is further verified whether it is effective; if the configuration change command encounters an error, the matching reference command is automatically searched for correction, and this process is repeated until it is correct. Once it is confirmed that the configuration change is effective, the updated copy will be synchronized to the original configuration file according to the preset timing strategy, thereby completing the configuration update. This method effectively solves network device configuration problems caused by configuration command errors, avoids the decline in network connectivity and stability caused by incorrect commands, realizes accurate and secure changes in network device configuration, and significantly improves the efficiency and reliability of network management. In addition, by creating a copy of the configuration file, the method provides great flexibility for network change personnel, allowing them to change the configuration of network equipment at any time, thereby improving the work efficiency of network change personnel.

[0098] Figure 2 Schematic diagram of the process of configuring the network device provided in this application Figure 2 ,like Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, a configuration method of a network device is described in detail, and the method includes:

[0099] S201: Create a copy of a configuration file of a first network device.

[0100] The explanation of step S201 is similar to that of the above step S101 and will not be repeated here.

[0101] S202: Execute a configuration change command for the replica.

[0102] The explanation of step S202 refers to the explanation of the above embodiment and will not be repeated here.

[0103] S203: If the configuration change command does not report an error, verify whether the configuration change command is effective.

[0104] The explanation of step S203 refers to the explanation of the above embodiment, which will not be repeated here.

[0105] S204: When the configuration change command reports an error, search the first network device for a reference command that matches the configuration change command, and modify the configuration change command based on the reference command found on the first network device.

[0106] The first network device itself refers to the network device itself that currently needs to be configured.

[0107] The purpose of this step is to search the first network device for a reference command that matches the erroneous configuration change command, and automatically correct the erroneous configuration change command through the reference command.

[0108] It is understandable that when the operating system determines that the configuration change command input by the network change personnel is incorrect, the operating system will first search on the local machine of the first network device to find a reference command that matches the incorrect configuration change command. When the operating system finds a configuration change command that can correct the incorrect configuration change command on the local machine of the first network device, the operating system will automatically correct the incorrect configuration change command. Then, after the operating system corrects the incorrect configuration change command, the operating system will also check whether the corrected configuration change command reports an error. Finally, when the operating system determines that the corrected configuration change command does not report an error, the operating system will verify whether the corrected configuration change command is effective through a verification command.

[0109] For example, if the configuration change command "mac-address static 0000.5E00.01A5 vlan 100 interface FastEthennet0 / 33" executed by the copy of the configuration file of the MP2900-14 router switch reports an error at fastethennet0 / 33, then the operating system corresponding to the MP2900-14 router switch will first search within the router switch itself. Afterwards, when the operating system finds that "mac-address static 0000.5E00.01A5 vlan 100 interface FastEthernet0 / 32" matches the incorrect configuration change command "mac-address static 0000.5E00.01A5 vlan 100 interfaceFastEthennet0 / 33" in the router and switch, the operating system replaces "fastethennet0 / 33" with "fastethernet0 / 33" and generates a corrected configuration change command "mac-address static AAAA.AAAA.AAAA vlan 100interface fastethernet0 / 33". Then, the operating system verifies whether the corrected configuration change command reports an error. Finally, when the operating system determines that the corrected configuration change command does not report an error, the operating system verifies whether the corrected configuration change command is effective by executing a verification command.

[0110] S205. When the configuration change command is corrected based on the reference command found on the first network device and an error is reported when the configuration change command for the copy is executed again, a reference command matching the configuration change command is searched from other network devices other than the first network device, and the configuration change command is corrected based on the reference command found on the other network devices.

[0111] The other network devices include, but are not limited to: network devices of the same brand and model and network devices of the same brand but different models.

[0112] The purpose of this step is to further expand the search scope and find other possible solutions in order to more accurately locate and correct the errors in the configuration change command.

[0113] It can be understood that after the operating system corrects the configuration change command based on the reference command found locally on the first network device, if an error still occurs when the corrected configuration change command is executed again, the operating system will search for a reference command that matches the erroneous configuration change command from other network devices other than the first network device.

[0114] S206. When the configuration change command is verified to be effective, a configuration change review confirmation instruction and a change execution reservation instruction are received. The configuration change review confirmation instruction is used to indicate that the configuration change command for the copy is executed and the verification review is passed, and the change execution reservation instruction is used to indicate the timing time.

[0115] Among them, by receiving the configuration change review and confirmation instruction, it can be ensured that the configuration change command of the copy has been strictly executed and verified and confirmed to be correct. At the same time, receiving the change execution reservation instruction sets a clear time point for the execution of the configuration change, which helps to ensure that the change operation is carried out within the scheduled time and avoid unnecessary interference with normal network operation.

[0116] In this step, when the operating system successfully verifies and determines that the configuration change command has taken effect, it will actively send a confirmation instruction to the network change personnel to verify the correctness of the network change command. After receiving this confirmation instruction, the network change personnel will carefully check it, and after confirming that it is correct, send a change review confirmation instruction to the operating system to indicate the approval of the configuration change command. At the same time, the network change personnel will also send a change execution reservation instruction to specify a suitable time point to execute the configuration change.

[0117] It can be understood that when the operating system determines that the configuration change command is effective through the verification command, the operating system will receive the change review confirmation instruction and the change execution appointment instruction sent by the network change personnel. Subsequently, the operating system will complete the configuration change of the first network device according to the timing time in the change execution preset instruction.

[0118] S207: Synchronize the copy after executing the configuration change command for the copy to the configuration file of the first network device according to the scheduled time.

[0119] The explanation of step S207 refers to the explanation of the above embodiment, which will not be repeated here.

[0120] The configuration method of a network device provided in an embodiment of the present application first creates a copy of a configuration file for a first network device, and then executes a configuration change command on the copy. If there is no error in the configuration change command, a verification of effectiveness is performed; if an error is encountered, a matching reference command is first searched on the first network device for correction. If an error is still reported after the local correction, a reference command is further searched on other network devices for correction. Once the configuration change is verified to be effective, and after receiving the configuration change review and confirmation instruction and the change execution reservation instruction, the updated copy will be synchronized to the original configuration file of the first network device according to the scheduled time. This method effectively solves the network device configuration problem caused by configuration command errors, thereby avoiding the negative impact on the connectivity and stability of the network device, and further improving the accuracy and security of the configuration change, thereby enhancing the flexibility and efficiency of network management.

[0121] Figure 3 Schematic diagram of the process of configuring the network device provided in this application Figure 3 ,like Figure 3 As shown, in this embodiment Figure 2 Based on the embodiment, the implementation process of searching for a reference command matching the configuration change command on other network devices other than the first network device is described in detail. The method includes:

[0122] S301. Obtain a network device search table for a first network device, where the network device search table includes a plurality of network devices other than the first network device and the brand, model, and weight of each network device.

[0123] The weight is used to characterize the degree of matching between the other network devices and the first network device. The higher the weight, the higher the degree of matching between the other network devices and the first network device. On the contrary, the lower the weight, the lower the degree of matching between the other network devices and the first network device.

[0124] The purpose of this step is to find other network devices that match the first network device.

[0125] It can be understood that by obtaining the network device retrieval table of the first network device, the operating system can obtain relevant information of other network devices except the first network device, including the brand and model of other network devices and their matching degree with the first network device (expressed by weight), so as to better correct the configuration change command of the first network device.

[0126] Optionally, when the operating system determines that the reference command found on the first network device cannot successfully correct the configuration change command, and the configuration change command for the copy is still reported when it is executed again, the operating system will pre-create a network search table for the first network device. The specific process is as follows: First, the operating system obtains the routing information table (as shown in Table 1), and the routing information table includes: multiple other network devices, and the brand, model and node location of each other network device; then, the operating system determines the weight of each other network device based on the brand, model and node location of the first network device, as well as the routing table information; finally, the operating system generates a network search table for the first network device based on the brand, model and weight of each other network device.

[0127] The operating system records the weight of other network devices of the same brand and model as 1, the weight of other network devices of the same brand but different models as 2, and the weight of other network devices of different brands and models as 3.

[0128] Optionally, after the operating system obtains the node position of each other network device, in order to more accurately generate the network search table of the first network device, the operating system further obtains a topological structure diagram of the network device (such as Figure 4 As shown), in order to comprehensively evaluate the brand, model and node location of each network device according to the topology diagram, thereby generating a network retrieval table for the first network device.

[0129] For example, assume that the first network device is an MP2900-14 router-switch integrated machine, with a brand of MP, a model of 2900, and a node location of B2. Based on this information, the operating system generates a network search table (as shown in Table 1), which lists the relevant information of other devices in the network. In this network search table, the first row is an MP2900 router identified as B5, the second row is an MP2900X router identified as B3, the third and fourth rows are both MP1900 routers identified as B1, the fifth row is an RGS2653G router identified as A1, the sixth row is an RGS2910 router identified as A3, and the last row is an H3CL83016C router identified as A4.

[0130] Table 1

[0131]

[0132] S302: Determine, from the network device search table, a second network device with the same brand and model as the first network device and a highest weight.

[0133] The purpose of this step is to find a second network device that is highly similar to the first network device from the network device search table.

[0134] Understandably, first of all, network devices of the same brand and model usually have a high degree of consistency in design, function, and compatibility, which makes configuration migration, troubleshooting, and performance optimization between them easier and more efficient.

[0135] Secondly, weight is an important indicator for evaluating the matching degree of network devices. Its weight directly reflects the matching degree between other network devices and the first network device. The higher the weight, the higher the matching degree between other network devices and the first network device; conversely, the lower the weight, the worse the matching degree.

[0136] Therefore, by selecting a network device of the same brand and model as the first network device and having the highest weight as the second network device from the network device search table, a highly similar second network device can be found.

[0137] For example, assume that the first network device is an MP2900-14 routing switch. The network search table of the MP2900-14 routing switch is known, as shown in Table 1. Then the operating system can determine the network device with brand MP, model 2900 and weight 1 from the network search table according to the brand and model of the MP2900-14 routing switch, and use it as the second network device.

[0138] S303: Search the second network device for a reference command that matches the configuration change command.

[0139] The purpose of this step is to find a command from the second network device of the same brand and model that can correct the incorrect configuration change command and use it as a reference command.

[0140] Understandably, the same brand and model usually means that the two network devices follow the same design specifications when they are manufactured, use similar hardware configurations, and have the same software version or feature set built in. This consistency makes the devices of the same brand and model have a high degree of similarity and compatibility when it comes to command configuration.

[0141] Therefore, when a second network device that is highly similar to the first network device is found, the second network device can be used as a query factor, and a command that can correct the erroneous configuration change command can be searched from the second network device, so that the erroneous configuration change command can be corrected according to the command.

[0142] In this step, for example, the network device configuration command of the second network device may be obtained first, and then a reference command matching the configuration change command may be searched from the network device configuration command.

[0143] S304. When the configuration change command is modified based on the reference command found on the second network device and an error is reported when the configuration change command for the copy is executed again, a third network device with the highest weight that is the same brand but different model as the first network device is determined from the network device search table.

[0144] Among them, when a network device of the same brand and model cannot correctly correct the configuration change command of the first network device, in order to expand the correction range and find possible solutions, it is necessary to determine a third network device of the same brand but different model as the first network device and with the highest weight from the network device retrieval table as a reference.

[0145] Understandably, first of all, devices of the same brand usually have high similarity and compatibility in terms of underlying technology, configuration command sets, syntax, etc. This similarity allows the operating system to obtain useful solutions from network devices of the same brand.

[0146] Secondly, different models of network equipment often have unique hardware configurations, software versions, or feature sets, which provides more choices and possibilities for the operating system.

[0147] In addition, weight is an important indicator for evaluating the matching degree of network devices, and its level directly reflects the matching degree between other network devices and the first network device. The higher the weight, the higher the matching degree between other network devices and the first network device; conversely, the lower the weight, the worse the matching degree between other network devices and the first network device.

[0148] Therefore, when the operating system determines that a network device of the same brand and model cannot correctly correct the configuration change command of the first network device, the operating system needs to select a network device with the same brand and different model as the first network device and the highest weight from the network device retrieval table and use it as the third network device for further reference.

[0149] S305: Search the third network device for a reference command that matches the configuration change command.

[0150] The purpose of this step is to find a command that can correct the incorrect configuration change command from a third network device of the same brand but different model, and use it as a reference command.

[0151] Understandably, different models of network devices of the same brand mean that, although they may differ in hardware configuration, software version or feature set, they maintain a high degree of similarity and compatibility in underlying technology, configuration command set and syntax, etc. This similarity enables the operating system to easily obtain useful solutions from network devices of the same brand and different models.

[0152] Therefore, when a third network device with a high degree of matching with the first network device is found, the third network device can be used as a query factor, and a command that can correct the erroneous configuration change command can be searched from the third network device, so that the erroneous configuration change command can be corrected according to the command.

[0153] In this step, for example, the network device configuration command of the third network device may be obtained first, and then a reference command matching the configuration change command may be searched from the network device configuration command.

[0154] Optionally, when the configuration change command is corrected based on the reference command found on the third network device, and the configuration change command for the copy is executed again, if an error still occurs, the operating system will automatically send a command failure message to the network change personnel. The purpose of this message is to inform the network change personnel that the configuration change command they entered is wrong and the automatic correction attempted by the system was unsuccessful. Through such a feedback mechanism, the network change personnel can promptly understand the status of the command execution and take appropriate measures to further correct the error.

[0155] The configuration method of a network device provided in an embodiment of the present application first obtains a network device retrieval table containing multiple other network devices and their brands, models and weight information; then, a second network device of the same brand and model as the first network device and with the highest weight is selected from the table; then, a reference command matching the configuration change command in which an error occurred is searched on the second network device, and the original command is attempted to be corrected with the reference command; if an error is still reported after the correction, a third network device of the same brand but different model and with the highest weight is selected instead, and the configuration change command is attempted to be found and corrected again. This method successfully solves the problem of being unable to automatically correct configuration change commands through intelligent search and reference command matching, thereby achieving automatic detection and rapid correction of configuration command errors, and significantly improving the accuracy and execution efficiency of network configuration changes.

[0156] Figure 5A schematic diagram of the structure of the configuration device of the network device provided in this application, such as Figure 5 As shown, the network device configuration device 400 provided in this embodiment includes:

[0157] A creation module 401, configured to create a copy of a configuration file of the first network device;

[0158] An execution module 402, configured to execute a configuration change command for the replica;

[0159] Verification module 403, used to verify whether the configuration change command is effective when the configuration change command does not report an error;

[0160] A search module 404 is used to search for a reference command matching the configuration change command when the configuration change command reports an error;

[0161] A correction module 405, configured to correct the configuration change command based on the found reference command, and repeat this step;

[0162] The synchronization module 406 is used to synchronize the copy after executing the configuration change command on the copy to the configuration file of the first network device according to the scheduled time when verifying that the configuration change command is effective.

[0163] In a possible implementation manner, the apparatus further includes: a determination module 407;

[0164] The determination module, 407, is used to determine the fixed participle in the configuration change command;

[0165] The search module 404 is used to search for a reference command matching the fixed participle;

[0166] The determination module 407 is further configured to determine, from the reference command, a reference word that matches the error word in the configuration change command;

[0167] The correction module 405 is specifically configured to correct the error segmentation in the configuration change command into the reference segmentation.

[0168] In a possible implementation manner, the search module 404 is further configured to search the first network device for a reference command matching the configuration change command;

[0169] The correction module 405 is specifically configured to correct the configuration change command based on the reference command found on the first network device.

[0170] In a possible implementation manner, the search module 404 is further configured to search for a reference command matching the configuration change command from other network devices other than the first network device;

[0171] The correction module 405 is specifically configured to correct the configuration change command based on the reference command found from the other network devices.

[0172] In a possible implementation, the device further includes: an acquisition module 408;

[0173] The acquisition module 408 is further used to acquire a network device search table of the first network device, wherein the network device search table includes a plurality of other network devices other than the first network device and the brand, model and weight of each network device;

[0174] The determination module 407 is further configured to determine, from the network device search table, a second network device of the same brand and model as the first network device with the highest weight;

[0175] The searching module 404 is specifically configured to search the second network device for a reference command that matches the configuration change command.

[0176] In a possible implementation manner, the determination module 407 is further configured to determine, from the network device search table, a third network device with the same brand but different model as the first network device and having the highest weight;

[0177] The searching module 404 is specifically configured to search the third network device for a reference command that matches the configuration change command.

[0178] In a possible implementation manner, the device further includes: a receiving module 409;

[0179] The receiving module 409 is used to receive a configuration change review confirmation instruction and a change execution reservation instruction. The configuration change review confirmation instruction is used to indicate that the configuration change command for the copy has been executed and the verification review has passed. The change execution reservation instruction is used to indicate the timing time.

[0180] The configuration device of the network device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0181] Figure 6 This is a schematic diagram of the configuration device of the network device provided in this application. Figure 6As shown, the electronic device 500 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 500 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0182] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0183] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0184] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0185] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0186] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0187] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0188] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0189] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0190] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0191] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0194] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0195] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0196] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0197] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0198] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0199] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0200] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0201] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0202] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0203] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0204] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for configuring a network device, characterized in that: Applied to a first network device, the method comprises: creating a copy of a configuration file of the first network device; Execute the configuration change command for the replica, and if the configuration change command does not report an error, verify whether the configuration change command is effective; if the configuration change command reports an error, find a reference command that matches the configuration change command, modify the configuration change command based on the found reference command, and repeat this step; When it is verified that the configuration change command is effective, the copy after the configuration change command for the copy is executed is synchronized to the configuration file of the first network device according to the scheduled time.

2. The method according to claim 1, characterized in that The searching for a reference command matching the configuration change command, and modifying the configuration change command based on the found reference command, includes: Determine a fixed participle in the configuration change command, and search for a reference command matching the fixed participle; A reference participle matching the error participle in the configuration change command is determined from the reference command, and the error participle in the configuration change command is corrected to the reference participle.

3. The method according to claim 1, characterized in that The searching for a reference command matching the configuration change command, and modifying the configuration change command based on the found reference command, includes: The first network device searches for a reference command matching the configuration change command, and modifies the configuration change command based on the reference command found on the first network device.

4. The method according to claim 3, characterized in that In a case where the configuration change command is modified based on the reference command found on the first network device and an error is reported when the configuration change command for the copy is executed again, searching for a reference command matching the configuration change command and modifying the configuration change command based on the found reference command includes: A reference command matching the configuration change command is searched from other network devices other than the first network device, and the configuration change command is modified based on the reference command found from the other network devices.

5. The method according to claim 4, characterized in that The searching for a reference command matching the configuration change command from other network devices other than the first network device includes: Acquire a network device search table of the first network device, wherein the network device search table includes a plurality of network devices other than the first network device and a brand, model, and weight of each network device; Determine from the network device search table a second network device of the same brand and model as the first network device with the highest weight; Search the second network device for a reference command that matches the configuration change command.

6. The method according to claim 5, characterized in that When the configuration change command is corrected based on the reference command found on the second network device and an error is reported when the configuration change command for the copy is executed again, searching for a reference command matching the configuration change command on other network devices other than the first network device includes: Determine from the network device search table a third network device with the same brand but different model as the first network device and with the highest weight; A reference command matching the configuration change command is searched on the third network device.

7. The method according to any one of claims 1 to 6, characterized in that: Before synchronizing the copy after executing the configuration change command for the copy at a scheduled time to the configuration file of the first network device, the method further includes: A configuration change review confirmation instruction and a change execution reservation instruction are received, wherein the configuration change review confirmation instruction is used to indicate that the configuration change command for the copy is executed and the verification review is passed, and the change execution reservation instruction is used to indicate the timing time.

8. A configuration device for a network device, characterized in that: Applied to a first network device, comprising: A creation module, configured to create a copy of a configuration file of the first network device; An execution module, used for executing a configuration change command for the replica; A verification module, used to verify whether the configuration change command is effective when no error is reported by the configuration change command; A search module, used for searching for a reference command matching the configuration change command when the configuration change command reports an error; A correction module, used to correct the configuration change command based on the found reference command, and repeat this step; The synchronization module is used to synchronize the copy after executing the configuration change command for the copy to the configuration file of the first network device according to the scheduled time when verifying that the configuration change command is effective.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.

Citation Information

Patent Citations

  • Standard configuration generation device and method and network equipment configuration error correction device and method

    CN110300017A

  • Systems and methods for live, on-device configuration validation

    CN111258880A

  • Vehicle network repairing method and system, computer equipment and readable storage medium

    CN115277747A

  • Network configuration method, device and system and computer readable storage medium

    CN115473803A

  • Configuration detection method and device

    CN116405394A