Method, apparatus, device, medium and product for configuring network equipment

By creating a copy of the configuration file on the network device and automatically correcting configuration change commands, the network device connectivity and stability issues caused by incorrect commands are resolved, thus achieving stable operation and efficient management of the network device.

CN119603148BActive Publication Date: 2025-10-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, network device connectivity and stability can be affected by incorrect commands during configuration changes.

Method used

Create a copy of the network device's configuration file, execute the configuration change command on the copy, verify the effect if there are no errors, automatically find the reference command to correct it if there are errors, and synchronize it to the original configuration file at a scheduled time.

Benefits of technology

By using copy operations, the risks of executing change commands directly on the original configuration file are avoided, ensuring the connectivity and stability of network devices, improving the accuracy and security of configuration, and enhancing the efficiency and flexibility of network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603148B_ABST
    Figure CN119603148B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a network device configuration method, device, equipment, medium and product, relates to the field of financial technology or other related fields. 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 takes effect; 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 with the executed change command is synchronized to the configuration file of the original network device according to the set timing time. The method creates a copy of the network device and automatically corrects the incorrect configuration change command, avoids the risk that may be caused by directly executing the configuration change command on the original configuration file, and further ensures that the connectivity and stability of the network device are not affected, thereby providing strong protection for the stable operation of the network device.
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 network device configuration method and device, equipment, medium and product. BACKGROUND

[0002] With the rapid development of information technology, network devices such as routers, switches, and integrated routers and switches play a crucial role in modern network communication. They not only take charge of data transmission and forwarding, but also undertake the construction and maintenance of network topology, ensuring efficient and reliable flow of information in complex network environments.

[0003] In existing network device management, when the configuration of the network device needs to be changed, the network change personnel must perform a command configuration operation on the network device, and then determine whether the network device has been successfully changed.

[0004] However, this direct command change operation on the network device may cause problems in the configuration of the network device due to incorrect commands, thereby affecting the connectivity and stability of the network device. SUMMARY

[0005] The present application provides a network device configuration method, device, equipment, medium and product to solve the technical problem of incorrect commands causing problems in the configuration of the network device, thereby affecting the connectivity and stability of the network device.

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

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

[0008] Executing a configuration change command for the copy, verifying whether the configuration change command is effective in the case of no error, and in the case of an error, finding a reference command matching the configuration change command, modifying the configuration change command based on the found reference command, and repeating this step;

[0009] In the case of verifying that the configuration change command is effective, the copy after executing the configuration change command for the copy is synchronized to the configuration file of the first network device according to a timing time.

[0010] In one possible implementation, the reference command matching the configuration change command is found, and the configuration change command is modified based on the found reference command, comprising:

[0011] determine a fixed word in the configuration change command, find a reference command matching the fixed word in the configuration change command;

[0012] determine a reference word matching an error word in the configuration change command from the reference command, and correct the error word in the configuration change command to the reference word.

[0013] In a possible implementation, the finding of the reference command matching the configuration change command, and the correction of the configuration change command based on the found reference command, comprises:

[0014] The first network device locally finds the reference command matching the configuration change command, and corrects the configuration change command based on the reference command found on the first network device.

[0015] In a possible implementation, in the case that the correction of the configuration change command based on the reference command found on the first network device is performed again and the error of the configuration change command for the copy is executed again, the finding of the reference command matching the configuration change command, and the correction of the configuration change command based on the found reference command, comprises:

[0016] The other network device other than the first network device is found to have the reference command matching the configuration change command, and the configuration change command is corrected based on the reference command found on the other network device.

[0017] In a possible implementation, the finding of the other network device other than the first network device to have the reference command matching the configuration change command comprises:

[0018] A network device retrieval table of the first network device is acquired, and the network device retrieval table comprises a plurality of other network devices other than the first network device, and the brand, model and weight of each network device.

[0019] A second network device of the same brand and model as the first network device and with the highest weight is determined from the network device retrieval table.

[0020] The reference command matching the configuration change command is found on the second network device.

[0021] In a possible implementation, in the case that the correction of the configuration change command based on the reference command found on the second network device is performed again and the error of the configuration change command for the copy is executed again, the finding of the other network device other than the first network device to have the reference command matching the configuration change command comprises:

[0022] determine, from the network device retrieval table, a third network device of the same brand and different model as the first network device and having the highest weight;

[0023] find, from the third network device, a reference command matching the configuration change command.

[0024] In a possible implementation, before synchronizing the copy to the configuration file of the first network device after the configuration change command is executed on the copy at the timing time, the method further includes:

[0025] receiving a configuration change review confirmation instruction for indicating that the configuration change command for the copy is executed and verified to pass review, and a change execution reservation instruction for indicating the timing time.

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

[0027] a creating module for creating a copy of a configuration file of the first network device;

[0028] an executing module for executing a configuration change command for the copy;

[0029] a verifying module for verifying whether the configuration change command is effective in the case that the configuration change command is not reported as an error;

[0030] a finding module for finding a reference command matching the configuration change command in the case that the configuration change command is reported as an error;

[0031] a correcting module for correcting the configuration change command based on the found reference command, and repeating the step;

[0032] a synchronizing module for synchronizing the copy to the configuration file of the first network device after the configuration change command is executed on the copy at a timing time in the case that the configuration change command is verified to be effective.

[0033] In a possible implementation, the device further includes a determining module;

[0034] the determining module is configured to determine a fixed word in the configuration change command;

[0035] the finding module is configured to find a reference command matching the fixed word;

[0036] the determining module is further configured to determine a reference word in the reference command matching an error word in the configuration change command;

[0037] The modification module is specifically configured to modify error reporting word segmentation in the configuration change command to the reference word segmentation.

[0038] In a possible implementation, the searching module is further configured to search for a reference command matching the configuration change command on the first network device locally.

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

[0040] In a possible implementation, the searching module is further configured to search for a reference command matching the configuration change command on another network device other than the first network device.

[0041] The modification module is specifically configured to modify the configuration change command based on the reference command found on the another network device.

[0042] In a possible implementation, the apparatus further includes an obtaining module.

[0043] The obtaining module is further configured to obtain a network device retrieval table of the first network device, the network device retrieval table including a plurality of other network devices other than the first network device and brands, models and weights of the network devices.

[0044] The determining module is further configured to determine, from the network device retrieval table, a second network device of the same brand and the same model as the first network device and having the highest weight.

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

[0046] In a possible implementation, the determining module is further configured to determine, from the network device retrieval table, a third network device of the same brand and different model as the first network device and having the highest weight.

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

[0048] In a possible implementation, the apparatus further includes a receiving module.

[0049] The receiving module is configured to receive a configuration change review confirmation instruction and a change execution reservation instruction, the configuration change review confirmation instruction being used to indicate that a configuration change command for the copy is executed and verified to pass the review, and the change execution reservation instruction being used to indicate the timing time.

[0050] In a third aspect, an embodiment of the present application provides a configuration device of a network device, comprising: 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 first aspect and / or various possible implementation manners of the first aspect.

[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the first aspect and / or various possible implementation manners of the first aspect.

[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the first aspect and / or various possible implementation manners of the first aspect.

[0055] The network device configuration method, device, equipment, medium and product provided by the present application first create a copy of the configuration file of the network device, and execute the configuration change command on the copy. If the configuration change command does not report an error, it is verified whether it takes effect; 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 time. The method creates a copy of the network device and automatically corrects the incorrect configuration change command, avoids the risk that may be caused by directly executing the configuration change command on the original configuration file, and further ensures the connectivity and stability of the network device, thereby providing strong protection for the stable operation of the network device. BRIEF DESCRIPTION OF DRAWINGS

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

[0057] Figure 1 Flowchart of the network device configuration method provided by the present application Figure 1 ;

[0058] Figure 2 Flowchart of the network device configuration method provided by the present application Figure 2 ;

[0059] Figure 3 Flowchart of the network device configuration method provided by the present application Figure 3 ;

[0060] Figure 4 A topological structure diagram of a network device provided for the present application is shown in the following figure:

[0061] Figure 5 A structure diagram of a configuration device of a network device provided for the present application is shown in the following figure:

[0062] Figure 6 A structure diagram of a configuration device of a network device provided for the present application is shown in the following figure.

[0063] The specific embodiments of the present application have been shown in the above figures, and will be described in more detail hereinafter. These figures and the written description are not intended to limit the scope of the present application concept in any way, but to illustrate the present application concept to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0064] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to indicate the same or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0065] It should be noted that the network device configuration method, device, equipment, medium and product provided by the present 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. The application of the network device configuration method, device, equipment, medium and product provided by the present application is not limited.

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

[0067] In the prior art, when the configuration of the network device needs to be changed, the network change personnel must perform command configuration operation on the network device, and then it can be known whether the network device is changed successfully.

[0068] However, such direct command change operation on the network device may cause problems in the configuration of the network device due to incorrect commands, thereby affecting the connectivity and stability of the network device.

[0069] To solve the above problems, the network device configuration method provided in the application is provided. The method first creates a copy of the configuration file of the network device, and executes the configuration change command on the copy. If the configuration change command does not report an error, it is verified whether it takes effect; 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 with the executed change command is synchronized to the configuration file of the original network device according to the set timing time. The method creates a copy of the network device and automatically corrects the incorrect configuration change command, avoiding the risks that may be caused by directly executing the configuration change command on the original configuration file, thereby ensuring the connectivity and stability of the network device, and thus providing strong protection for the stable operation of the network device.

[0070] The technical solutions of the application and how the technical solutions solve the above technical problems will be 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 described again in some embodiments. The embodiments of the application will be described below with reference to the accompanying drawings.

[0071] Figure 1 Flowchart of the network device configuration method provided in the application Figure 1 The method is applied to a first network device. As shown in Figure 1 , the method comprises:

[0072] S101, creating a copy of the configuration file of the first network device.

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

[0074] The first network device includes but is not limited to a router, a switch, and a router-switch integrated machine.

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

[0076] It can be understood that when the network change personnel needs 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 of the network device needs to be created. In this way, the network change personnel can update and test the copy without directly modifying the original configuration file. This way can effectively prevent the configuration file from being damaged or incorrect due to operation 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 MP2900-14 routing switch. It is known that the network change personnel currently needs to update the startup configuration file of the MP2900-14 routing switch. Then, based on the above information, the network change personnel will first log in to the operating system corresponding to the MP2900-14 routing switch, and 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 copy, verify whether the configuration change command takes effect in the case that the configuration change command does not report an error, find a reference command matched with the configuration change command in the case that the configuration change command reports an error, correct the configuration change command based on the found reference command, and repeat the present step.

[0079] The case that the configuration change command does not report an error includes but is not limited to: the command format does not have an error, the parameters do not have a mismatch, or the syntax does not have an error.

[0080] The purpose of the present step is to execute the change command on the copy of the configuration file without affecting the original configuration file, and to verify whether the changes take effect as expected.

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

[0082] For example, assume that the network changer inputs a configuration change command "mac-address static AAAA.AAAA.AAAA vlan 100 interface FastEthernet0 / 33" and a verification command "ping 192.168.168.168" on the operating system of the MP2900-14 integrated routing switch corresponding to the configuration that needs to be updated. The operating system will then perform error checking on the configuration change command through its built-in instruction detection mechanism. If the command is correct, the network changer will verify whether the configuration change command has been accepted by the first network device and takes effect through the verification command. If the configuration change command is detected to have errors, the operating system will automatically correct the configuration change command, and the corrected command will be input again for execution and verification until the configuration change command can be executed correctly and takes effect.

[0083] Optionally, the application provides an implementation manner for finding a reference command matched with the configuration change command and correcting the configuration change command based on the found reference command, which comprises:

[0084] Firstly, fixed words in the configuration change command are determined, and a reference command matched with the fixed words is found.

[0085] The purpose of determining the fixed words in the configuration change command is to screen out words that are consistent in syntax format, word segmentation format, and have no errors in content from the configuration change command.

[0086] The purpose of finding the reference command matched with the fixed words is to find a command that can correct the erroneous configuration change command.

[0087] Secondly, reference words matched with error words in the configuration change command are determined from the reference command, and the error words in the configuration change command are corrected to the reference words.

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

[0089] In this step, the reference words matched with the error words in the configuration change command are first found from the reference command, and then, when the matched reference words are found, the operating system will immediately replace the error words in the configuration change command with the correct reference words.

[0090] S103, in the case where the verification command takes effect, the copy after the configuration change command is executed on the copy is synchronized to the configuration file of the first network device according to the timing time.

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

[0092] The timing time can be immediate, a specific future time point, or determined based on a periodic event (e.g., a certain fixed time every day). The present application does not make special limitations on this.

[0093] The purpose of this step is to ensure that the changes are synchronized to the configuration file of the first network device according to the predetermined timing time on the basis of verifying that the configuration change command has taken effect.

[0094] It can be understood that synchronizing the copy that has been verified and taken effect to the configuration file of the first network device according to the preset timing time not only ensures that the configuration change 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 change, thereby ensuring the stable operation of the first network device.

[0095] For example, assuming that the configuration change command is "mac-address static 0000.5E00.01A5 vlan 100 interface FastEthernet0 / 33". It is known that the timing time set by the network change personnel is 10 pm. Then when it is set to 10 pm, the operating system will automatically trigger the synchronization operation to synchronize the copy containing the configuration change command after taking effect to the original configuration file of the MP2900-14 router switch integrated machine.

[0096] Optionally, after synchronizing the copy after executing the configuration change command for the copy to the configuration file of the first network device according to the timing time, the present application will also automatically delete the copy that has executed the change operation in order to save storage space and avoid potential configuration confusion.

[0097] The method for configuring network equipment provided by the embodiment of the present application first creates a copy of the configuration file of the first network equipment, and then executes the configuration change command on the copy. If the configuration change command is executed without error, it is further verified whether it takes effect; if the configuration change command encounters an error, the matching reference command is automatically searched for correction, and the process is repeated until there is no error. Once it is confirmed that the configuration change takes effect, the updated copy is synchronized to the original configuration file according to the preset timing strategy, so as to complete the configuration update. The method effectively solves the network equipment configuration problem caused by the error of the configuration command, avoids the decline of network connectivity and stability caused by the error of the command, realizes the accurate and safe change of the network equipment configuration, and significantly improves the efficiency and reliability of network management. In addition, the method provides great flexibility for network change personnel by creating a copy of the configuration file, so that they can change the configuration of the network equipment at any time, thereby improving the work efficiency of the network change personnel.

[0098] Figure 2 Flowchart of the method for configuring network equipment provided by the present application Figure 2 As shown in Figure 2 the embodiment, the method for configuring network equipment is described in detail on the basis of the embodiment, and the method comprises the following steps. Figure 1

[0099] S201, a copy of the configuration file of the first network equipment is created.

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

[0101] S202, a configuration change command for the copy is executed.

[0102] The explanation of step S202 is described in the explanation of the above embodiment, and will not be repeated here.

[0103] S203, if the configuration change command is not reported as an error, it is verified whether the configuration change command takes effect.

[0104] The explanation of step S203 is described in the explanation of the above embodiment, and will not be repeated here.

[0105] S204, if the configuration change command is reported as an error, the reference command matching the configuration change command is searched on the first network equipment, and the configuration change command is corrected based on the reference command found on the first network equipment.

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

[0107] ​The purpose of this step is to find a reference command matching the incorrect configuration change command in the first network device, and to automatically correct the incorrect configuration change command by the reference command.

[0108] It can be understood that when the operating system determines that the configuration change command input by the network change personnel is incorrect, the operating system first searches in the first network device to find a reference command matching the incorrect configuration change command. When the operating system finds a reference command that can correct the incorrect configuration change command in the first network device, the operating system automatically corrects the incorrect configuration change command. Then, when the operating system corrects the incorrect configuration change command, the operating system also checks whether the corrected configuration change command is error. Finally, when the operating system determines that the corrected configuration change command does not have an error, the operating system verifies whether the corrected configuration change command takes effect by executing a verification command.

[0109] For example, assuming that 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 routing switch machine has an error at fastethennet0 / 33, the operating system corresponding to the MP2900-14 routing switch machine first searches in the routing switch machine. Then, 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 interface FastEthennet0 / 33" in the routing switch machine, the operating system replaces "fastethennet0 / 33" with "fastethernet0 / 33" and generates the corrected configuration change command "mac-address static AAAA.AAAA.AAAA vlan 100 interface fastethernet0 / 33". Then, the operating system also checks whether the corrected configuration change command has an error. Finally, when the operating system determines that the corrected configuration change command does not have an error, the operating system verifies whether the corrected configuration change command takes effect by executing a verification command.

[0110] S205, in the case of modifying the configuration change command based on the reference command found on the first network device, and re-executing the error report of the configuration change command for the copy, finding the reference command matching the configuration change command from other network devices except the first network device, and modifying the configuration change command based on the reference command found from the other network devices.

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

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

[0113] It can be understood that after the operating system modifies the configuration change command based on the reference command found on the first network device, if the modified configuration change command still reports an error when re-executed, the operating system will find the reference command matching the erroneous configuration change command from other network devices except the first network device.

[0114] S206, in the case of verifying the effectiveness of the configuration change command, receiving 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 is executed and verified to pass the review, and the change execution reservation instruction is used to indicate a timing time.

[0115] By receiving the configuration change review confirmation instruction, it can be ensured that the configuration change command for the copy has passed strict execution and verification review, and it is 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 performed within the predetermined time, and avoids unnecessary interference to the 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 the confirmation instruction, the network change personnel will carefully check and send a change review confirmation instruction to the operating system to indicate the approval of the configuration change command after confirming that there is no error. At the same time, the network change personnel will also send a change execution reservation instruction to specify a suitable time point for the execution of 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 change of the configuration of the first network device according to the timing time in the change execution preset instruction.

[0118] S207: Synchronize the replica after executing the configuration change command on the replica 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 and will not be repeated here.

[0120] The embodiment of the present application provides a method for configuring a network device, which 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 its effectiveness is performed; if an error is encountered, a matching reference command is first searched for locally on the first network device for correction. If an error is still reported after the local correction, a reference command is further searched for 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 network device configuration problems caused by configuration command errors, thereby avoiding negative impacts on the connectivity and stability of network devices, and further improving the accuracy and security of configuration changes, 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 2 As shown, this embodiment Figure 4 Based on the embodiment, a detailed description is given of an implementation process of searching for a reference command matching a configuration change command on other network devices other than the first network device. 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 represent the degree of compatibility between the other network devices and the first network device. A higher weight indicates a higher degree of compatibility between the other network devices and the first network device. Conversely, a lower weight indicates a lower degree of compatibility 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 the related information of other network devices except the first network device, which includes the brand, model of the other network devices and the matching degree (represented by the weight) with the first network device, so as to better modify the configuration change command of the first network device.

[0126] Optionally, in the case that the operating system determines that the reference command found on the first network device cannot successfully modify the configuration change command, and the re-executed configuration change command for the copy still reports an error, the operating system will create a network retrieval table of the first network device in advance. The specific process is as follows: first, the operating system obtains a routing information table (as shown in Table 1), which includes: a plurality of other network devices, and the brand, model and node position of each other network device; then, the operating system determines the weight of each other network device according to the brand, model and node position of the first network device and the routing table information; finally, the operating system generates a network retrieval table of the first network device according to the brand, model and weight of each other network device.

[0127] Among them, the operating system will record the weight of other network devices with the same brand and model as 1, the weight of other network devices with the same brand and different models as 2, and the weight of other network devices with different brands and different 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 retrieval table of the first network device, the operating system will further obtain a network device topology diagram (as shown in Table 1) in order to comprehensively evaluate the brand, model and node position of each network device according to the topology diagram, thereby generating the network retrieval table of the first network device. Figure 5

[0129] For example, assuming that the first network device is an MP2900-14 routing switch integrated machine, its brand is MP, model is 2900, and node position is B2. Based on this information, the operating system will generate a network retrieval table (as shown in Table 1), which lists the related information of other devices in the network. In this network retrieval 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, determining a second network device with the highest weight from the network device retrieval table and the same brand and model as the first network device.

[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 retrieval table.

[0134] It can be understood that first, network devices of the same brand and model usually have high consistency in design, function and compatibility, which makes it easier and more efficient for configuration migration, troubleshooting and performance optimization between them.

[0135] Second, weight is an important indicator for evaluating the matching degree of network devices, and its high and low directly reflects the matching degree of other network devices with the first network device. The higher the weight, the higher the matching degree of other network devices with the first network device; on the contrary, the lower the weight, the worse the matching degree.

[0136] Therefore, by filtering out the network device with the same brand and model and the highest weight from the network device retrieval table as the second network device, a highly similar second network device can be found.

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

[0138] S303, finding a reference command matching the configuration change command from the second network device.

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

[0140] It can be understood that the same brand and model usually means that two network devices follow the same design specification, use similar hardware configuration and have the same software version or function set built-in when manufactured. This consistency makes the same brand and model devices have high similarity and compatibility in command configuration.

[0141] Therefore, when a second network device highly similar to the first network device is found, the second network device can be taken as a query factor, and a command capable of correcting the incorrect configuration change command is found from the second network device, so as to correct the incorrect configuration change command according to the command.

[0142] In this step, for example, the network device configuration command of the second network device can be acquired first, and then a reference command matching the configuration change command is found from the network device configuration command.

[0143] S304、In the case that the configuration change command is corrected based on the reference command found from the second network device, and the error of the configuration change command for the copy is executed again, a third network device of the same brand but different model and with the highest weight is determined from the network device retrieval table.

[0144] When the 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, a third network device of the same brand but different model and with the highest weight is determined from the network device retrieval table as a reference.

[0145] It can be understood that, first, network devices of the same brand usually have high similarity and compatibility in underlying technology, configuration command set and syntax, etc. Such similarity can enable the operating system to obtain useful solutions from network devices of the same brand.

[0146] Secondly, network devices of different models often have unique hardware configurations, software versions or function sets, which provide the operating system with more abundant choices and possibilities.

[0147] In addition, the weight, as an important indicator for evaluating the matching degree of network devices, directly reflects the matching degree of other network devices with the first network device. The higher the weight, the higher the matching degree of other network devices with the first network device; on the contrary, the lower the weight, the lower the matching degree of other network devices with the first network device.

[0148] Therefore, when the operating system determines that the 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 filter a network device of the same brand but different model and with the highest weight from the network device retrieval table, and take it as a third network device for further reference.

[0149] S305、A reference command matching the configuration change command is found from the third network device.

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

[0151] It can be understood that the network devices of the same brand but different models means that they have high similarity and compatibility in underlying technology, configuration command set and syntax, although they can be different in hardware configuration, software version or function set. The similarity enables the operating system to easily obtain useful solutions from the network devices of the same brand but different models.

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

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

[0154] Optionally, when the configuration change command is corrected based on the reference command found from the third network device, and the configuration change command for the copy is executed again, if an error still occurs, the operating system automatically sends a command failure information to the network change personnel. The information aims to inform the network change personnel that the configuration change command input by them is incorrect, and the automatic correction attempted by the system is not successful. Through the feedback mechanism, the network change personnel can know the command execution situation in time and take corresponding measures to further correct the error.

[0155] The method provided by the embodiment of the application comprises the following steps: obtaining a network device search table comprising a plurality of other network devices and brand, model and weight information of the network devices; selecting a second network device of the same brand and the same model and with the highest weight from the table; searching a reference command matching an incorrect configuration change command from the second network device, and attempting to correct the original command by using the reference command; and if an error still occurs after correction, selecting a third network device of the same brand but different model and with the highest weight, and attempting to search and correct the configuration change command again. The method successfully solves the problem of being unable to automatically correct the configuration change command by intelligent searching and reference command matching, thereby realizing automatic detection and rapid correction of configuration command errors, and significantly improving the accuracy and execution efficiency of network configuration change.

[0156] Figure 5A structural schematic diagram of a configuration device of a network device provided in the present application is shown in Figure 6 The configuration device 400 of the network device provided in the present embodiment includes:

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

[0158] An executing module 402 configured to execute a configuration change command on the copy;

[0159] A verifying module 403 configured to verify whether the configuration change command takes effect in a case where the configuration change command does not report an error;

[0160] A searching module 404 configured to search for a reference command matched with the configuration change command in a case where the configuration change command reports an error;

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

[0162] A synchronizing module 406 configured to synchronize the copy after the configuration change command is executed on the copy to the configuration file of the first network device according to a timing time in a case where the configuration change command takes effect.

[0163] In a possible implementation, the device further includes a determining module 407;

[0164] The determining module 407 is configured to determine a fixed token in the configuration change command;

[0165] The searching module 404 is configured to search for a reference command matched with the fixed token;

[0166] The determining module 407 is further configured to determine a reference token matched with an error token in the configuration change command from the reference command;

[0167] The correcting module 405 is specifically configured to correct the error token in the configuration change command to the reference token.

[0168] In a possible implementation, the searching module 404 is further configured to search for a reference command matched with the configuration change command locally in the first network device;

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

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

[0171] The correcting module 405 is specifically configured to correct the configuration change command based on the reference command searched from the other network device.

[0172] In a possible implementation, the apparatus further includes an obtaining module 408.

[0173] The obtaining module 408 is further configured to obtain a network device retrieval table of the first network device, the network device retrieval table including a plurality of other network devices other than the first network device and the brand, model and weight of each network device.

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

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

[0176] In a possible implementation, the determining module 407 is further configured to determine, from the network device retrieval table, a third network device of the same brand and different model as the first network device and with the highest weight.

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

[0178] In a possible implementation, the apparatus further includes a receiving module 409.

[0179] The receiving module 409 is configured to receive a configuration change review confirmation instruction and a change execution reservation instruction, the configuration change review confirmation instruction being used to indicate that the configuration change command for the copy is executed and verified to pass the review, and the change execution reservation instruction being used to indicate the timing time.

[0180] The configuration apparatus of the network device provided in this embodiment can perform the method provided in the method embodiments, and has similar implementation principles and technical effects, which will not be described here in detail.

[0181] Figure 6 The configuration apparatus of the network device provided in this embodiment can perform the method provided in the method embodiments, and has similar implementation principles and technical effects, which will not be described here in detail. ​As shown, the electronic device 500 provided by the embodiment includes at least one processor 501 and a memory 502. Optionally, the device 500 further includes a communication component 503. Wherein, the processor 501, the memory 502 and the communication component 503 are connected through a bus 504.

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

[0183] The specific implementation process of the processor 501 can refer to the above-mentioned method embodiment, which has similar implementation principles and technical effects, and will not be described here in detail.

[0184] In the above-mentioned embodiment, it should be understood that the processor can be a central processing unit (English: Central Processing Unit, for short: CPU), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, for short: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, for short: ASIC) and the like. The general-purpose processor can be a microprocessor, or the processor can be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as the execution of the hardware processor, or executed by the combination of hardware and software modules in the processor.

[0185] The memory can contain a random access memory (Random Access Memory, RAM), and can also include a non-volatile memory (Non-volatile Memory, NVM), for example, at least one disk memory.

[0186] The bus can be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect (Peripheral Component, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit only one bus or one type of bus.

[0187] The present application also provides a computer program product, including a computer program, which is executed by the processor to realize the above-mentioned method.

[0188] The application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions.

[0189] The readable storage medium can be implemented by any type of volatile or nonvolatile storage devices 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 storage, 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 the 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 an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0191] The division of units is only a logical function division, and in actual implementation, there can be another division mode, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

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

[0194] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0195] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. 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, magnetic disk or optical disk, and various media that can store program codes.

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

[0197] It should be further noted that although each step in the flowchart is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise stated in this paper, the execution of these steps has no strict order limit, and these steps can be executed in other order. Moreover, at least part of the steps in the flowchart can include multiple sub-steps or multiple stages, which 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 sequential, but can be executed with at least part of other steps or other steps or stages of sub-steps or stages.

[0198] It should be understood that the above-described apparatus embodiments are merely illustrative, and the apparatus of the present application can also be implemented in other manners. For example, the division of units / modules in the above-described embodiments is merely a logical function division, and the actual implementation can be in another manner. For example, a plurality of units / modules or components can be combined, or can be integrated into another system, or some features can be omitted or not implemented.

[0199] In addition, unless specifically stated otherwise, each functional unit / module in each embodiment of the present application can be integrated in one unit / module, or can be physically present separately, or two or more units / modules can be integrated together. The integrated unit / module can 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 can 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 specifically stated otherwise, the processor can be any suitable hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless specifically stated otherwise, the storage unit can be any suitable 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 units / modules are implemented in the form of software program modules and sold or used as independent products, they can be stored in a computer readable memory. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a number of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0202] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. The technical features of the above embodiments can be combined arbitrarily, and in order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0203] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains or can relate. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the application are indicated by the following claims.

[0204] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the claims that follow.

Claims

1. A configuration method of a network device, characterized by, The method is applied to a first network device, and comprises: creating a copy of a configuration file of the first network device; executing a configuration change command for the copy, verifying whether the configuration change command takes effect in the case that the configuration change command does not report an error, finding a reference command matching the configuration change command in the case that the configuration change command reports an error, correcting the configuration change command based on the found reference command, and repeating the step until the configuration change command can be executed correctly and takes effect; in the case that the configuration change command is verified to take effect, synchronizing the copy after the configuration change command is executed for the copy to the configuration file of the first network device according to a timing time; the finding of the reference command matching the configuration change command and the correction of the configuration change command based on the found reference command comprises: locally finding, in the first network device, the reference command matching the configuration change command, and correcting the configuration change command based on the found reference command in the first network device; in the case that the configuration change command is corrected based on the found reference command in the first network device and the configuration change command for the copy is executed again and reports an error, the finding of the reference command matching the configuration change command and the correction of the configuration change command based on the found reference command comprises: finding, from other network devices except the first network device, the reference command matching the configuration change command, and correcting the configuration change command based on the found reference command from the other network devices; the finding of the reference command matching the configuration change command from the other network devices except the first network device comprises: obtaining a network device retrieval table of the first network device, the network device retrieval table comprising a plurality of other network devices except the first network device and brands, models and weights of the network devices; determining, from the network device retrieval table, a second network device of the same brand and the same model as the first network device and having the highest weight; finding, from the second network device, the reference command matching the configuration change command.

2. The method of claim 1, wherein, the finding of the reference command matching the configuration change command and the correction of the configuration change command based on the found reference command comprises: determining a fixed word in the configuration change command, and finding a reference command matching the fixed word; determining, from the reference command, a reference word matching an error word in the configuration change command, and correcting the error word in the configuration change command to the reference word.

3. The method of claim 1, wherein, in the case that the configuration change command is corrected based on the found reference command from the second network device and the configuration change command for the copy is executed again and reports an error, the finding of the reference command matching the configuration change command from the other network devices except the first network device comprises: determining, from the network device retrieval table, a third network device of the same brand and different model as the first network device and having the highest weight. find a reference command matching the configuration change command from the third network device.

4. The method according to any one of claims 1 to 3, characterized in that, Before synchronizing the copy after the configuration change command is executed to the configuration file of the first network device according to the timing time, the method further comprises: receiving a configuration change review confirmation instruction and a change execution reservation instruction, the configuration change review confirmation instruction being used to indicate that the configuration change command for the copy is executed and verified to pass, and the change execution reservation instruction being used to indicate the timing time.

5. A configuration apparatus of a network device, characterized by comprising: Applied to a first network device, comprising: a creating module configured to create a copy of a configuration file of the first network device; an executing module configured to execute a configuration change command for the copy; a verifying module configured to verify whether the configuration change command takes effect in the case that the configuration change command does not report an error; a finding module configured to find a reference command matching the configuration change command in the case that the configuration change command reports an error; a correcting module configured to correct the configuration change command based on the found reference command, and repeat the step until the configuration change command can be correctly executed and takes effect; a synchronizing module configured to synchronize the copy after the configuration change command is executed to the configuration file of the first network device according to a timing time in the case that the configuration change command takes effect; the correcting module is specifically configured to find a reference command matching the configuration change command locally on the first network device, and correct the configuration change command based on the found reference command on the first network device; the finding module is specifically configured to find a reference command matching the configuration change command from other network devices except the first network device, and correct the configuration change command based on the found reference command from the other network devices; an obtaining module configured to obtain a network device retrieval table of the first network device, the network device retrieval table including a plurality of other network devices except the first network device, and brands, models and weights of the network devices; a determining module configured to determine a second network device with the highest weight and the same brand and model as the first network device from the network device retrieval table; the finding module is further configured to find a reference command matching the configuration change command from the second network device.

6. An electronic device, comprising: comprising: a processor, and a memory connected with the processor in communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method in any one of claims 1 to 4.

8. A computer program product, characterised in that, comprising a computer program, which is executed by the processor to implement the method in any one of claims 1 to 4.

Citation Information

Patent Citations

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

    CN111258880A

  • Configuration detection method and device

    CN116405394A