WO2021077967A1 - 网络设备的管理方法、装置及系统 - Google Patents

网络设备的管理方法、装置及系统 Download PDF

Info

Publication number
WO2021077967A1
WO2021077967A1 PCT/CN2020/116938 CN2020116938W WO2021077967A1 WO 2021077967 A1 WO2021077967 A1 WO 2021077967A1 CN 2020116938 W CN2020116938 W CN 2020116938W WO 2021077967 A1 WO2021077967 A1 WO 2021077967A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
identification information
network device
information
state
Prior art date
Application number
PCT/CN2020/116938
Other languages
English (en)
French (fr)
Inventor
王建平
王启俊
阎丽芳
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021077967A1 publication Critical patent/WO2021077967A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • This application relates to the field of communications, and in particular to a method, device and system for managing network equipment.
  • the Restconf protocol defines a set of management operations for network devices, which can be switches or routers.
  • the management operation includes at least one operation such as adding configuration information of the network device, deleting the configuration information of the network device, or modifying the configuration information of the network device.
  • the configuration information of the network device is stored in the configuration database of the network device, and the user can use this set of management operations to modify the configuration database of the network device to make the state of the network device reach the state desired by the user.
  • the modification to the configuration database includes adding configuration information to the configuration database, deleting the configuration information saved in the configuration database, or modifying the content of the configuration information in the configuration database.
  • users modify the configuration database of a network device, they find that the modification is wrong, which leads to an error in the state of the network device.
  • the user needs to modify the configuration information saved in the configuration database to restore the configuration database saved before the modification.
  • Configuration information so as to realize the restoration of the original state of the network equipment.
  • the network device uses the modified configuration database to run for a period of time, the user needs to restore the original state of the network device. At this time, the user also needs to modify the configuration database back.
  • This application provides a management method, device, and system for network equipment to improve the efficiency of restoring configuration data.
  • the technical solution is as follows:
  • this application provides a method for managing a network device.
  • the network device receives a recovery message sent by the management device. Since the recovery message includes first identification information, the first identification information is used for Identifies the first configuration operation that has been performed on the configuration database of the network device.
  • the network device obtains the operation object and operation type corresponding to the first identification information from the identification information, the correspondence relationship between the operation object and the operation type.
  • the operation type is the type of the first configuration operation
  • the operation object is the operation performed by the first configuration operation.
  • the network device restores the configuration database from the first state to the second state according to the operation object and operation type.
  • the first state is the state that the configuration database is in after the first configuration operation is performed, and the second state is the first configuration operation being performed.
  • the administrator when restoring the configuration database, the administrator only needs to enter the first identification information in the management device, and the management device sends a recovery message including the first identification information to the network device, and the network device automatically restores the second state according to the first identification information
  • the configuration database improves the efficiency of restoring configuration data.
  • the network device receives the first trial run request, the first trial run request includes first identification information, and during the first trial run period corresponding to the first configuration operation identified by the first identification information, Run according to the configuration database in the first state, the start time of the first trial run period is the time for performing the first configuration operation, and the time length of the first trial run period is equal to the duration threshold.
  • the network device receives the recovery message during the first trial operation period, it acquires the operation type and operation object corresponding to the first identification information from the corresponding relationship between the first identification information, the operation object and the operation type.
  • the network device Since the network device performs a trial operation according to the configuration database in the first state during the first trial operation period, it can detect whether the modification to the configuration database is incorrect during the first trial operation period, and request recovery in time if there is an error Configuring the database can reduce the impact of network equipment on the business.
  • the configuration message further includes a trial operation identifier
  • the network device is triggered by the trial operation identifier during the first trial operation period corresponding to the first configuration operation, according to the status of the first state.
  • the configuration database is running, the start time of the first trial run period is the time for performing the first configuration operation, and the time length of the first trial run period is equal to the duration threshold.
  • the network device receives the recovery message during the first trial operation period, it acquires the operation type and operation object corresponding to the first identification information from the corresponding relationship between the first identification information, the operation object and the operation type.
  • the network device Since the network device performs a trial operation according to the configuration database in the first state during the first trial operation period, it can detect whether the modification to the configuration database is incorrect during the first trial operation period, and request recovery in time if there is an error Configuring the database can reduce the impact of network equipment on the business.
  • the network device receives a second test run request, the second test run request includes second identification information, the second identification information is used to identify the second configuration operation, and the second configuration operation is that the network device has The operation performed on the configuration database.
  • the network device operates according to the configuration database in the third state.
  • the start time of the second trial operation period is the time for performing the second configuration operation.
  • the time length is equal to the time length threshold
  • the third state is the state that the configuration database is in after the second configuration operation is performed.
  • the network device receives a third trial run request, the third trial run request includes third identification information, the third identification information is used to identify the third configuration operation, and the third configuration operation is that the network device has The operation performed on the configuration database.
  • the network device operates according to the configuration database in the fourth state.
  • the start time of the third trial run period is the time when the third configuration operation is performed.
  • the duration is equal to the duration threshold, and the fourth state is the state that the configuration database is in after the third configuration operation is performed.
  • the configuration database When the network device does not receive a message including the third identification information during the third trial operation period, at the end of the third trial operation period, according to the operation type and operation object corresponding to the third configuration operation, the configuration database will be assigned to the third configuration database.
  • the fifth state is restored to the fourth state, and the fifth state is the state that the configuration database is in after the third configuration operation is performed. In this way, if the configuration database is modified incorrectly, the administrator does not need to trigger any operation on the network device, as long as the network device automatically restores the configuration database at the end of the third trial operation period, which improves the recovery efficiency and increases the user Experience.
  • the network device obtains recovery information according to the operation object, and the recovery information is used to describe the content that has changed in the configuration database during the process of performing the first configuration operation on the configuration database.
  • the network device restores the configuration database from the first state to the second state according to the operation type and the restoration information. In this way, the content modified by the first configuration operation on the configuration database is restored according to the restoration information, while the modification on the configuration database by other configuration operations can still be retained.
  • the recovery message is a message including recovery identification information and first identification information, and the recovery identification information is used to identify that the type of the message is a recovery message.
  • the present application provides a method for managing a network device.
  • the network device receives a recovery message sent by the management device, the recovery message includes first identification information, and the first identification information is used to identify the first identification information.
  • Configuration information the first configuration information is the configuration information saved in the configuration database of the network device before the first configuration operation is performed, and the first configuration operation is the operation that the network device has performed on the configuration database.
  • the network device obtains the first configuration information corresponding to the first identification information from the correspondence between the identification information and the configuration information.
  • the network device updates the content of the configuration database to the first configuration information.
  • the administrator when recovering the configuration database before the first configuration operation is performed, the administrator only needs to input the first identification information, and the management device sends a recovery message including the first identification information to the network device, and the network device automatically according to the first identification information
  • the configuration database prior to the execution of the first configuration operation is restored to improve the efficiency of restoring configuration data.
  • the network device receives a configuration message sent by the management device, and the configuration message includes the first identification information, the operation type and the operation object of the first configuration operation.
  • the network device obtains the content in the configuration database to obtain the first configuration information; stores the first identification information and the first configuration information in the corresponding relationship between the identification information and the configuration information, and performs the operation on the configuration database according to the operation object Type should be the first configuration operation. Since the network device saves the corresponding relationship between the first identification information and the first configuration information, when the configuration database is restored, it can be automatically restored based on the saved corresponding relationship.
  • this application provides a network device management apparatus, which is used to execute the first aspect or the method in any one of the possible implementation manners of the first aspect.
  • the device includes a unit for executing the method of the first aspect or any one of the possible implementation manners of the first aspect.
  • the device includes a unit for executing the method of the second aspect or a possible implementation manner of the second aspect.
  • an embodiment of the present application provides a network device management apparatus.
  • the apparatus includes a transceiver, a processor, and a memory.
  • the processor, the memory and the transceiver may be connected through a bus system.
  • the memory is used to store one or more programs, and the processor is used to execute one or more programs in the memory to complete the method in the first aspect or any possible implementation of the first aspect; or, the The processor is configured to execute one or more programs in the memory to complete the second aspect or a method in a possible implementation manner of the second aspect.
  • the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions that, when run on a processor, cause the processor to execute the first aspect or any of the possibilities of the first aspect.
  • the method in the implementation manner; or, when it runs on the processor, the processor is caused to execute the above-mentioned second aspect or a method in a possible implementation manner of the second aspect.
  • this application provides a computer program product containing instructions, which when run on a processor, causes the processor to execute the method in the first aspect or any possible implementation of the first aspect; or, when When it runs on the processor, the processor is made to execute the foregoing second aspect or a method in a possible implementation manner of the second aspect.
  • the present application provides a network device management system, the system includes a management device and a network device,
  • the management device is configured to send a recovery message to the network device, the recovery message includes first identification information, and the first identification information is used to identify the first configuration operation that has been performed on the configuration database of the network device.
  • the network device is used to obtain the operation object and operation type corresponding to the first identification information from the identification information, the corresponding relationship between the operation object and the operation type.
  • the operation type is the type of the first configuration operation
  • the operation object is the first configuration operation.
  • the object of operation; according to the operation object and operation type, the configuration database is restored from the first state to the second state.
  • the first state is the state that the configuration database is in after the first configuration operation is executed, and the second state is the execution of the first state.
  • the administrator when restoring the configuration database, the administrator only needs to enter the first identification information in the management device, and the management device sends a restoration message including the first identification information to the network device, and the network device automatically restores the second identification information based on the first identification information.
  • the stateful configuration database improves the efficiency of restoring configuration data.
  • the present application provides a network device management system, the system includes: a management device and a network device; the management device is used to send a recovery message to the network device, the recovery message includes first identification information, and An identification information is used to identify the first configuration information, the first configuration information is the configuration information saved in the configuration database of the network device before the first configuration operation is performed, and the first configuration operation is the operation that the network device has performed on the configuration database; network The device is configured to obtain the first configuration information corresponding to the first identification information from the corresponding relationship between the identification information and the configuration information; and update the content of the configuration database to the first configuration information.
  • the administrator when restoring the configuration database before the first configuration operation is performed, the administrator only needs to enter the first identification information in the management device, and the management device sends a recovery message including the first identification information to the network device, and the network device is based on the first identification information.
  • the identification information is automatically restored to the configuration database before the first configuration operation is performed, which improves the efficiency of restoring configuration data.
  • Figure 1 is a schematic structural diagram of a network device management system provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for managing network equipment provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a first interface provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another first interface provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another first interface provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a second interface provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a third interface provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of another network device management method provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a fourth interface provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a fifth interface provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a network device management apparatus provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of another network device management apparatus provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of another network device management apparatus provided by an embodiment of the present application.
  • an embodiment of the present application provides a network device management system, which includes:
  • Management equipment and network equipment and a network connection can be established between the management equipment and the network equipment.
  • the network device includes a configuration database, which is used to store configuration information.
  • the network device operates according to the configuration information in the configuration database.
  • the network device may be a router or a switch.
  • the configuration information may be routing information of network traffic, etc., so that when the network device receives the network traffic, it forwards the network traffic according to the routing information of the network traffic stored in the configuration database.
  • the routing information of network traffic includes identification information and next hop information of the network traffic.
  • the configuration database shown in Table 1 below.
  • the first piece of configuration information is the routing information of network traffic 1, including the identification information "11” of network traffic 1 and next hop information "192.168.10.1”
  • the second piece of configuration information is the routing information of network traffic 2, including the identification information "12” of network traffic 2 and the next hop information "192.168.10.2".
  • the network device receives network traffic 1, it forwards network traffic 1 according to the first piece of configuration information, and when it receives network traffic 2, it forwards network traffic 2 according to the second piece of configuration information.
  • the management device can use a set of configuration operations to modify the configuration database of the network device, and then the network device operates according to the modified configuration database. Since the configuration database before modification is different from the configuration database after modification, the running state of the network device according to the configuration database before modification and the running state of running according to the modified configuration information are also different.
  • the set of configuration operations may include an addition operation for adding configuration information to the configuration database, a modification operation for modifying configuration information in the configuration database, or a deletion operation for deleting configuration information in the configuration database, etc. at least one.
  • the management device can use the add operation to add at least one piece of configuration information to the configuration database of the network device when modifying the configuration database of the network device, or use the modify operation to modify at least one piece of configuration information included in the configuration database of the network device, or , Use the delete operation to delete at least one piece of configuration information included in the configuration database of the network device.
  • the management device can modify the configuration database of the network device under the trigger of the administrator.
  • the administrator can select the configuration operation that needs to be performed in the management device.
  • the management device performs the configuration operation on the configuration database of the network device, so as to modify the configuration database of the network device.
  • the network device operates according to the modified configuration database, so that the operating state of the network device is changed.
  • the administrator can configure the new routing information corresponding to the network traffic in the management device and the selected configuration operation is a modification operation .
  • the management device modifies the routing information of the network traffic stored in the configuration database of the network device to the new routing information.
  • the network device receives the network traffic, it forwards the network traffic according to the new routing information stored in the configuration database. In this way, the forwarding path of the network traffic is adjusted.
  • the management device can run a client for managing the network device, and the administrator can modify the configuration database of the network device through the client.
  • the administrator modifies the configuration database of the network device through the management device, and part of the content in the configuration database will change.
  • the operating state of the network device according to the modified configuration database may be the same as the operating state required by the administrator, or may be different from the operating state required by the administrator.
  • the operating state of the network device is the same as the operating state required by the administrator, it indicates that the administrator has modified the configuration database correctly.
  • the operating state of the network device is different from the operating state required by the administrator, it indicates that the administrator configures the network device. There is an error in the modification of the database.
  • the network device forwards the network traffic according to the new routing information stored in the configuration database, and the forwarding path of the network traffic is the same as the forwarding path expected by the administrator, indicating that the configuration database is modified Correct, if the forwarding path of the network traffic is different from the forwarding path expected by the administrator, it means that the configuration database is modified incorrectly.
  • a trial run capability set can be defined in the network device, so that the network device has a trial run function.
  • the so-called trial operation function means that after the configuration operation is performed on the configuration database of the network device, the network device can run for a period of time according to the modified configuration database.
  • the management device may request the network device to restore the changed content in the configuration database.
  • the administrator may not be able to determine whether the modification to the configuration database is correct when modifying the configuration database. Therefore, the administrator can make the network device run for a period of time according to the modified configuration database after modifying the configuration database of the network device through the management device. During this period of trial operation, if the administrator finds that the operating state of the network device is incorrect or the management device detects that the operating state of the network device is incorrect, the administrator can trigger the network device to perform the configuration database through the management device. The changed content is restored, or the management device directly triggers the network device to restore the changed content in the configuration database.
  • the administrator finds that the operating state of the network device is correct or the management device detects that the operating state of the network device is correct, the administrator can confirm the modification of the configuration database through the management device, or manage The device directly confirms the modification of the configuration database. After confirming the modification of the configuration database, the network device continues to operate according to the modified configuration database during the remaining time of the period of time and after the end of the period of time.
  • the detailed process of the trial operation refer to the embodiment shown in FIG. 2, which will not be described in detail here.
  • the administrator can determine that the modification to the configuration database is correct when modifying the configuration database.
  • the network device operates according to the modified configuration database.
  • the administrator may need to restore the operating state of the network device to the operating state before the configuration database was modified.
  • define the fallback capability in the network device Set so that the network equipment has a fallback function.
  • the so-called rollback function means that after performing the configuration operation on the configuration database of the network device, the network device can restore the content in the modified configuration database to the content saved in the configuration database before the configuration operation is performed.
  • the administrator can trigger the network device to restore the content of the configuration database to the content before the modification through the management device, so that the operating state of the network device is restored to the operating state before the configuration database is modified.
  • an embodiment of the present application provides a method for managing network equipment, and the method can be applied to the network architecture shown in FIG. 1.
  • the trial operation function of the network device can be used to restore the changed content in the configuration database.
  • the method includes:
  • Step 101 The management device sends a configuration message to the network device, where the configuration message includes a trial run identifier, first identification information, operation type and operation object of the configuration operation to be performed.
  • the first identification information is used to identify the configuration operation, and the trial operation identifier is used to instruct the network device to operate according to the configuration database in the first state during the trial operation period corresponding to the configuration operation.
  • the first state is the state that the configuration database of the network device is in after the configuration operation is performed on the configuration database of the network device.
  • the start time of the trial operation period is the time for performing the configuration operation, and the time length of the trial operation period is equal to the duration threshold.
  • the configuration message may also not include the trial operation identifier.
  • the management device also sends a trial operation request to the network device when sending the configuration message, or sends a trial operation request to the network device before sending the configuration message, the trial operation request Including the first identification information.
  • the trial operation request is used to request the network device to operate according to the configuration database in the first state during the trial operation period corresponding to the configuration operation.
  • the administrator can input the identification of the network device, the operation type and operation object of the configuration operation, and the first identification information used to identify the configuration operation to the management device. Then, the management device obtains the first identification information, the operation type and the operation object of the configuration operation, and generates a configuration message including the trial run identification, the first identification information, the operation type and the operation object of the configuration operation, and according to the network device Identification information, sending a configuration message to the network device; or, generating a configuration message including the first identification information, the operation type of the configuration operation, and the operation object, and generating a trial operation request including the first identification information, according to the network device , Send configuration messages to network devices, and send trial run requests.
  • the trial operation identification may also be input into the management device by the administrator, or the management device may include the trial operation identification.
  • the identifier of the network device may be an internet protocol (IP) address or the like for interconnection between networks of the network device.
  • the trial operation identification may be preset information, or may be information agreed in advance by the management device and the network device.
  • the configuration message further includes a duration threshold.
  • the trial operation request also includes a duration threshold.
  • the duration threshold may be a threshold entered by the administrator to the management device.
  • the duration threshold may be a threshold pre-stored in the management device.
  • the configuration message may not include the duration threshold; or, the trial operation request may not include the duration threshold, but the network device may include the duration threshold.
  • the duration threshold included in may be a threshold agreed upon with the management device in advance.
  • the configuration operation is an operation that the administrator needs to perform on the configuration database of the network device.
  • the operation type of the configuration operation may be an add operation used to add configuration information to the configuration database, a modification operation used to modify the configuration information in the configuration database, or a delete operation used to delete the configuration information in the configuration database.
  • the operation object When the operation type is a modification operation, the operation object includes the identifier of the configuration information to be modified and the first content, and the first content is the content after the administrator has modified the configuration information to be modified.
  • the operation type is an add operation, the operation object includes the configuration information to be added, and the configuration information to be added includes the identification and content of the configuration information to be added.
  • the operation object may include an identifier of the configuration information to be deleted.
  • the identifier of the configuration information may be a component part of the configuration information, and other parts of the configuration information may be referred to as the content of the configuration information.
  • the first piece of configuration information includes the identification information "11" of network traffic 1 and the next hop information "192.168.10.1".
  • the identification information "11” can be used as the first piece of configuration information.
  • the next hop information "192.168.10.1” is taken as the content of the first piece of configuration information.
  • a set of configuration operations defined by the Restconf protocol can be used.
  • the configuration operations defined by the Restconf protocol include at least one of post, creat, or delete. post, creat, and delete are respectively modify operation, add operation, and delete operation.
  • the management device After obtaining the first identification information, the operation type and operation object of the configuration operation, the management device generates a message including the trial run identification, the first identification information, the operation type and operation object of the configuration operation, and the generated message The operation type is included, so the message type of the message generated at this time is the configuration message.
  • the generated message includes the first parameter and the second parameter.
  • the value of the first parameter is set to the first identification information
  • the value of the second parameter is set to Trial run identification, so that the first identification information and trial run identification are included in the generated message.
  • the generated message further includes a third parameter, and the value of the third parameter is set to the duration threshold in generating the message, so that the duration threshold is included in the generated message .
  • the management device can display the first interface to the administrator, and the administrator can input the network device identification, first identification information, operation type and operation object of the configuration operation to the management device through the first interface And other information. It is also possible to input information such as a trial run identification or the duration threshold to the management device through the first interface.
  • the first interface includes a selection button 1 for selecting the operation type, a first input interface 2 for inputting first identification information, a second input interface 3 for inputting a trial run identification, and The third input interface 4 for the duration threshold, the fourth input interface 5 for inputting the operation object, and the fifth input interface 6 for inputting the identification of the network device.
  • the selection button 1 may be a drop-down button, and the selection button 1 includes at least one configuration operation operation type, and the operation type to one configuration operation includes post, creat, and delete.
  • the administrator can select the operation type of the configuration operation to be performed in the selection button 1.
  • the first configuration information is the routing information of network traffic 1, and the administrator needs to modify the routing information
  • the next hop information in is changed from "192.168.10.1" to "192.168.10.3".
  • the administrator selects the operation type of the configuration operation to be performed as the modification operation post, enters the first identification information in the first input interface 2 as abc, and enters the trial operation identification in the second input interface 3 as A, and in the third input interface 3.
  • the input duration threshold in the input interface 4 is 180, and the operation object is input in the fourth input interface 5.
  • the operation object includes the identifier "11" of the configuration information to be modified and the first content "192.168.10.3” of the configuration information to be modified, and
  • the identification of the network device input into the fifth input interface 6 is IP1.
  • the unit of the duration threshold may be seconds or minutes.
  • the management device can read the operation type post of the configuration operation, the first identification information abc, the trial run identification A, the duration threshold value of 180, the identification "11" of the configuration information to be modified, and the pending configuration information from the first interface shown in FIG. 3. Modify the first content "192.168.10.3" of the configuration information and the identification of the network device as IP1.
  • the configuration message generated by the management device based on the read information can be expressed as:
  • the management device sends the configuration message again.
  • the administrator needs to add a piece of configuration information to the configuration database of the network device.
  • the configuration information is routing information of network traffic 3, and the routing information includes identification information of network traffic 3. "13" and the next hop information "192.168.10.4".
  • the administrator selects the operation type of the configuration operation to be executed as the add operation create, enter the first identification information in the first input interface 2 as abc, and enter the trial operation identification in the second input interface 3 as A,
  • the input duration threshold in the input interface 4 is 180, and the operation object is input in the fourth input interface 5.
  • the operation object includes the identifier "13" of the configuration information to be added and the content of the configuration information to be added "192.168.10.4".
  • the identification of the input network device in the five input interface 6 is IP1.
  • the management device can read the operation type create of the configuration operation, the first identification information abc, the trial run identification A, the duration threshold value of 180, the identification "13" of the configuration information to be added, and the waiting Add the content of the configuration information "192.168.10.4", and the identification of the network device is IP1.
  • the configuration message generated by the management device based on the read information can be expressed as:
  • the management device sends the configuration message again.
  • the second piece of configuration information is routing information for network traffic 2.
  • the routing information includes Identification information "12" and next hop information "192.168.10.2".
  • the administrator selects the operation type of the configuration operation to be executed as the delete operation delete, enters the first identification information in the first input interface 2 as abc, and enters the trial operation identification as A in the second input interface 3, and in the third input interface 3.
  • the input duration threshold in the input interface 4 is 180, and the operation object is input in the fourth input interface 5.
  • the operation object includes the identifier "12" of the configuration information to be deleted, and the identifier of the network device input in the fifth input interface 6 is IP1 .
  • the management device can read the operation type delete of the configuration operation from the first interface shown in FIG. 5, the first identification information abc, the trial operation identification A, the duration threshold value is 180, the identification "12" of the configuration information to be added, and
  • the identification of the network device is IP1.
  • the configuration message generated by the management device based on the read information can be expressed as:
  • the management device sends the configuration message.
  • Step 102 The network device receives the configuration message, saves the first identification information, the operation object, and the operation type corresponding to the identification information, the corresponding relationship between the operation object and the operation type, and executes the configuration database according to the operation object.
  • the configuration operation corresponding to the operation type.
  • the network device receives the configuration message, extracts the value of the first parameter in the configuration message to obtain the first identification information, extracts the value of the second parameter to obtain the trial operation identification, and extracts the information included in the configuration message Operation object and operation type, save the first identification information, the operation object and the operation type corresponding to the identification information, the corresponding relationship between the operation object and the operation type, and execute the operation type corresponding to the configuration database according to the operation object.
  • the network device may also extract the value of the third parameter from the configuration message to obtain the duration threshold.
  • the network device also receives the trial run request.
  • the operation object when the operation type is an add operation, the operation object includes the configuration information to be added, and the configuration information to be added includes the identifier and content of the configuration information to be added.
  • the network device can save the configuration information to be added in the configuration database according to the operation type.
  • the configuration message received by the network device can be expressed as:
  • the operation type extracted from the configuration message is the add operation create, and the operation object is the configuration information to be added.
  • the configuration information to be added includes the identifier "13" of the configuration information to be added and the content of the configuration information to be added "192.168.10.4".
  • extracting the value abc of the first parameter persist-id from the configuration message to obtain the first identification information, extracting the value A of the second parameter trial to obtain the trial operation identifier, and extracting the value 180 of the third parameter timeout to obtain the duration threshold.
  • the first identification information abc, the operation type create, and the operation object are correspondingly saved in the corresponding relationship between the identification information, the operation type and the operation object as shown in Table 2 below.
  • the network device saves the configuration information to be added in the configuration database shown in Table 3 below according to the operation type create.
  • the configuration database shown in Table 3 below is the configuration database in the first state after the adding operation is performed.
  • the operation object when the operation type is a delete operation, the operation object includes an identifier of the configuration information to be deleted.
  • the network device obtains the configuration information to be deleted from the configuration database according to the identifier of the configuration information to be deleted, and saves the configuration information to be deleted in the recovery information table. Then, the network device deletes the configuration information to be deleted from the configuration database.
  • the configuration message received by the network device can be expressed as:
  • the operation type extracted from the configuration message is the delete operation delete
  • the operation object is the identifier "12" of the configuration information to be deleted
  • the value abc of the first parameter persist-id is extracted from the configuration message to obtain the first identification information
  • Extract the value A of the second parameter trial to obtain the trial run identification and extract the value 180 of the third parameter timeout to obtain the duration threshold.
  • the first identification information abc, operation type delete, and the operation object are correspondingly saved in the corresponding relationship between the identification information, operation type and operation object as shown in Table 4 below.
  • the network device obtains the configuration information to be deleted from the configuration database shown in Table 1 according to the identifier "12" of the configuration information to be deleted.
  • the configuration information to be deleted includes the identifier "12" of the configuration information to be deleted and the content of the configuration information to be deleted " 192.168.10.2", save the configuration information to be deleted as shown in the following table 5 in the recovery information table.
  • the network device deletes the configuration information to be deleted from the configuration database shown in Table 1 above, and the obtained configuration database is shown in Table 6 below.
  • the configuration database shown in Table 6 below is the configuration database in the first state after the delete operation is performed.
  • the operation object when the operation type is a modification operation, includes the identifier of the configuration information to be modified and the first content.
  • the network device obtains the configuration information to be modified from the configuration database according to the identifier of the configuration information to be modified.
  • the obtained configuration information to be modified includes the identifier of the configuration information to be modified and the second content, and the obtained configuration information to be modified Save it in the recovery information table. Then, the network device updates the second content of the configuration information to be modified to the first content in the configuration database.
  • the configuration message received by the network device can be expressed as:
  • the operation type extracted from the configuration message is the modification operation post
  • the operation object is the identifier "11" of the configuration information to be modified and the first content is "192.168.10.3”
  • the first parameter persist is extracted from the configuration message
  • the value of -id is abc to obtain the first identification information
  • the value A of the second parameter trial is extracted to obtain the trial operation identification
  • the value of the third parameter timeout 180 is extracted to obtain the duration threshold.
  • the first identification information abc, the operation type post, and the operation object are correspondingly saved in the corresponding relationship between the identification information, the operation type and the operation object as shown in Table 7 below.
  • the network device obtains the configuration information to be modified from the configuration database shown in Table 1 according to the identifier "11" of the configuration information to be modified.
  • the configuration information to be modified includes the identifier "11" of the configuration information to be modified and the second content "192.168.10.1” ", save the configuration information to be modified including the identifier "11” of the configuration information to be modified and the second content "192.168.10.1” in the recovery information table shown in Table 8 below.
  • the network device updates the second content "192.168.10.1” of the configuration information to be modified to the first content "192.168.10.3” from the configuration database shown in Table 1 above, and the obtained configuration database is shown in Table 9 below.
  • the configuration database shown in Table 9 below is the configuration database in the first state after the modification operation is performed.
  • the network device after the network device performs the configuration operation on the configuration database, it can also send a notification message to the management device, and the management device displays the notification message to the administrator.
  • Step 103 The network device runs according to the configuration database in the first state during the trial run period of the configuration operation under the trigger of the trial run flag.
  • the start time of the trial run period is the time when the configuration operation is performed, and the The length of time during the trial operation is the time threshold.
  • the network device when the network device receives the trial operation request, the network device reads the first identification information from the trial operation request, and during the trial operation period of the configuration operation identified by the first identification information, according to the first identification information A stateful configuration database is running.
  • the network device may time the configuration operation under the trigger of the test operation identifier or the test operation request.
  • the network device may start a timer for the configuration operation, use the timer to time the configuration operation, and correspondingly save the corresponding relationship between the timer and the first identification information.
  • the timer started by the network device is a countdown timer, and the initial time value of the countdown timer is equal to the duration threshold.
  • the countdown timer After starting the countdown timer, the countdown timer gradually decreases the initial value of the time. When the countdown timer reduces the initial value of the time to a value of 0, the countdown timer overflows. The length of time between the time when the countdown timer is started and the time when the countdown timer overflows is equal to The duration threshold.
  • the management device may allow the administrator to continue to perform another configuration operation on the configuration database of the network device.
  • the management device may not allow the administrator to continue to perform another configuration operation on the configuration database of the network device during the trial operation period corresponding to the configuration operation.
  • the configuration database of the network device can be restored from the first state to The second state, the second state is the state in which the configuration database of the network device is in before the configuration operation is performed.
  • the detailed implementation process includes the following operations 104 to 105.
  • Step 104 The management device sends a recovery message to the network device, where the recovery message includes the first identification information.
  • the management device generates a message including the first identification information and restoration identification information, where the restoration identification information is used to identify that the type of the message is a restoration message.
  • the management device When the management device generates a message, it can set the value of the first parameter in the message to the first identification information, and set the value of the second parameter in the message to the recovery identification information. Identification information and messages for restoring identification information.
  • the management device regenerates a message including the first identification information and the recovery identification information to obtain the recovery message, and sends the recovery message to the network device according to the identification of the network device.
  • the restoration identification information is preset information, or information agreed in advance by the management device and the network device.
  • the management device may include recovery identification information, so that the administrator does not need to input the recovery identification information.
  • the management device may display a second interface to the administrator, and the administrator inputs the first identification information and recovery identification information to the management device through the second interface.
  • the second interface includes a first input interface 2 for inputting first identification information, a sixth input interface 7 for inputting recovery identification information, and an identification of the network device.
  • the fifth input interface 6. The administrator can input the first identification information abc into the first input interface 2 and the recovery identification information B into the sixth input interface 7, and input the identification IP1 of the network device into the fifth input interface 6.
  • the management device reads the first identification information abc, the recovery identification information B, and the identification IP1 of the network device from the second interface.
  • Step 105 The network device receives the recovery message, obtains the operation object and operation type corresponding to the first identification information from the corresponding relationship between the identification information, the operation object and the operation type. According to the operation object and operation type, the configuration database is assigned to the first identification information. The first state is restored to the second state.
  • the second state is the state that the configuration database is in before the configuration operation identified by the first identification information is executed.
  • the network device extracts the first identification information and the restoration identification information from the restoration message, and under the trigger of the restoration identification information, obtains the first identification information from the identification information, the correspondence between the operation object and the operation type The corresponding operation object and operation type; according to the operation object and the operation type, the recovery information is obtained, and the recovery information is used to describe the content that has changed in the configuration database during the process of performing the configuration operation on the configuration database, and according to the recovery information With this type of operation, the configuration database is restored from the first state to the second state.
  • the network device also deletes the first identification information and the timer corresponding to the first identification information from the correspondence between the identification information and the timer.
  • the operation object corresponding to the first identification information is the added configuration information
  • the obtained restoration information is the added configuration information
  • the added configuration information is deleted from the configuration database to realize the restoration of the configuration database from the first state to the second state.
  • the network device saves the identification information shown in Table 3, the correspondence between the operation type and the operation object, and saves the first state shown in Table 4.
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, operation type and operation object as shown in Table 3.
  • the operation type is to add an operation create
  • the operation object includes the identifier 13 of the added configuration information. According to the identifier 192.168.10.3, the added configuration information is deleted from the configuration database in the first state as shown in Table 4, and the second state as shown in Table 1 is obtained. Configure the database.
  • the operation object corresponding to the first identification information when the operation type corresponding to the first identification information is a delete operation, the operation object corresponding to the first identification information includes the identification of the deleted configuration information, and the deleted configuration information is obtained from the recovery information table according to the identification of the deleted configuration information. Add the deleted configuration information to the configuration database to realize the restoration of the configuration database from the first state to the second state.
  • the network device saves the identification information shown in Table 5, the corresponding relationship between the operation type and the operation object, as shown in the recovery information table shown in Table 6, and Save the configuration database in the first state as shown in Table 7.
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, operation type and operation object as shown in Table 5, and the operation type is delete operation panel delete
  • the operation object includes the identifier 12 of the deleted configuration information, and the deleted configuration information is obtained from the recovery information table shown in Table 6 according to the identifier 12, and the deleted configuration information includes "12" and "192.168.10.2", Add and delete configuration information from the configuration database in the first state as shown in Table 7, and obtain the configuration database in the second state as shown in Table 1.
  • the operation object corresponding to the first identification information is the identification of the modified configuration information
  • the configuration information is obtained from the restoration information table according to the identification of the configuration information
  • the first content after the modification of the configuration information stored in the configuration database is updated to the second content to realize the restoration of the configuration database from the first state to the second state .
  • the network device saves the identification information shown in Table 8, the corresponding relationship between the operation type and the operation object, such as the restoration information table shown in Table 9, and Save the configuration database in the first state as shown in Table 10.
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, operation type, and operation object as shown in Table 8.
  • the operation type is the modification operation post
  • the operation object includes the identifier 11 of the modified configuration information.
  • the second content of the configuration information before the modification is "192.168.10.1” obtained from the restoration information table shown in Table 9, as shown in Table 10.
  • the first content "192.168.10.3” after the configuration information has been modified is updated to the second content "192.168.10.1” to obtain the configuration of the second state as shown in Table 1.
  • the administrator When restoring the configuration database, the administrator only needs to input the first identification information and the restoration identification information to trigger the network device to automatically restore the configuration database from the first state to the second state, thereby improving the efficiency of restoration.
  • the network device automatically restores the configuration database from the first state to the second state.
  • the detailed implementation process includes the following operations 106 to 107.
  • Step 106 The management device sends a confirmation message to the network device, where the confirmation message includes the first identification information.
  • the management device generates a message including the first identification information and confirmation identification information, where the confirmation identification information is used to identify that the type of the message is a confirmation message.
  • the management device When the management device generates a message, it can set the value of the first parameter in the message to the first identification information, and set the value of the second parameter in the message to the confirmation identification information. Identification information and a message confirming the identification information.
  • the identification information is preset information, or information agreed in advance by the management device and the network device.
  • the management device may display a third interface to the administrator, and the administrator inputs the first identification information and confirmation identification information to the management device through the third interface.
  • the third interface includes a first input interface 2 for inputting first identification information, and a seventh input interface 8 for inputting confirmation identification information.
  • the administrator can input the first identification information abc into the first input interface 2, input the confirmation identification information C into the seventh input interface 8, and input the identification IP1 of the network device into the fifth input interface 6.
  • Step 107 The network device receives the confirmation message, and deletes the record including the first identification information from the corresponding relationship between the identification information, the operation object, and the operation type.
  • the network device receives the confirmation message, which includes the confirmation identification information and the first identification information, and is triggered by the confirmation identification information to stop timing the configuration operation of the first identification information identification, and The record that includes the first identification information is deleted from the correspondence between the identification information, the operation object, and the operation type.
  • the network device may also obtain the operation object and operation type corresponding to the first identification information from the identification information, the correspondence between the operation object and the operation type, and the operation object includes the identification of the configuration information. If the operation type is a deletion operation or a modification operation, the configuration information including the identifier of the configuration information is deleted from the restoration information table.
  • the network device may delete the first identification information and the timer corresponding to the first identification information from the corresponding relationship between the timer and the identification information, so as to stop timing the configuration operation of the first identification information identification.
  • the network device saves the identification information, the corresponding relationship between the operation type, and the operation object as shown in Table 3.
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, the operation type and the operation object as shown in Table 3, and the operation type is the add operation create,
  • the record including the first identification information abc is deleted from the corresponding relationship between the identification information, the operation type, and the operation object as shown in Table 3.
  • the network device saves the identification information shown in Table 5, the correspondence between the operation type and the operation object, and the recovery information table shown in Table 6. .
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, the operation type and the operation object as shown in Table 6, and the operation type is the delete operation delete
  • the operation object includes the identifier "12" of the deleted configuration information.
  • the configuration information including "12" is deleted from the recovery information table shown in Table 6. From the identification information, operation type and operation object shown in Table 5 The record including the first identification information abc is deleted from the corresponding relationship.
  • the network device saves the identification information shown in Table 8, the correspondence between the operation type and the operation object, and the restoration information table shown in Table 9. .
  • the operation type and operation object corresponding to the first identification information abc are obtained from the corresponding relationship between the identification information, operation type, and operation object as shown in Table 8.
  • the operation type is the modification operation post,
  • the operation object includes the identifier "11" of the modified configuration information.
  • the configuration information including "11” is deleted from the recovery information table shown in Table 9, and the identification information, operation type and operation object shown in Table 8 are deleted. Delete the record that includes the first identification information abc from the corresponding relationship.
  • the network device will perform the trial run of the configuration operation.
  • the configuration database is restored from the first state to the second state.
  • a timer corresponding to the first identification information is still stored in the corresponding relationship between the identification information and the timer, and the time counted by the timer reaches the duration threshold, and the timer triggers the network device.
  • the network device obtains the operation type and operation object corresponding to the configuration operation from the corresponding relationship between the identification information, the operation type and the operation object according to the first identification information corresponding to the timer, and then The configuration database is restored from the first state to the second state.
  • the timer is a countdown timer, and at this time, the timer overflows and triggers the network device.
  • the network device receives the configuration message sent by the management device.
  • the configuration message includes the trial run identifier, the first identification information, the operation type and the operation object of the configuration operation to be performed, and the network device
  • the configuration database in the device is in the second state; the first identification information, the operation object and the operation type are correspondingly saved to the identification information, the corresponding relationship between the operation object and the operation type, and the configuration database of the network device according to the operation object Perform the configuration operation corresponding to the operation type to obtain the configuration database in the first state.
  • the configuration operation is performed, during the trial operation period corresponding to the configuration operation, the operation is performed according to the configuration database in the first state.
  • the trial operation period it is found that the configuration database of the first state is incorrect.
  • the administrator only needs to input the first identification information to the management device, and the management device sends a recovery message including the first identification information to the network device, so that the network device restores
  • the first identification information in the message obtains the operation type and operation object of the configuration operation identified by the first identification information from the identification information, the correspondence between the operation object and the operation type, and restores the second state according to the operation type and operation object
  • the configuration database so there is no need to edit the changed content in the configuration database, which improves the recovery efficiency.
  • an embodiment of the present application provides a method for managing network equipment, and the method can be applied to the network architecture shown in FIG. 1.
  • a fallback capability set can be defined in the network device, so that the network device has a fallback function.
  • the so-called rollback function means that after performing configuration operations on the configuration database of the network device, if the network device needs to be connected, the management device can request the network device to restore the changed content in the configuration database.
  • the method includes:
  • Step 201 The management device sends a configuration message to the network device, where the configuration message includes the first identification information, the operation type and the operation object of the configuration operation to be performed.
  • the first identification information is used to identify the configuration operation to be performed.
  • the management device displays a fourth interface to the administrator, and the administrator inputs the identification of the network device to the management device through the fourth interface, the operation type and operation object of the configuration operation, and the first identification used to identify the configuration operation information. Then, the management device obtains the input identification of the network device, the first identification information, the operation type and the operation object of the configuration operation, and generates a configuration message including the first identification information, the operation type of the configuration operation, and the operation object, according to the The identifier of the network device, which sends a configuration message to the network device.
  • the administrator inputs the identification of the network device, the operation type and operation object of the configuration operation to the management device, and the detailed implementation process of generating the configuration message by the management device can refer to the relevant content in the above step 101, which will not be described in detail here.
  • the first parameter is added to the configuration message, and the value of the first parameter is set equal to the first identification information, so that the generated configuration message includes the first identification information.
  • the management device displays a fourth interface as shown in FIG. 9.
  • the fourth interface includes a selection button 1, a first input interface for inputting first identification information, and a second interface for inputting operation objects.
  • the selection button 1 may be a drop-down button, and the selection button 1 includes at least one configuration operation operation type, and the operation type to one configuration operation includes post, creat, and delete.
  • the first piece of configuration information is the routing information of network traffic 1.
  • the administrator needs to modify the next hop information in the routing information Changed from "11" to "192.168.10.3".
  • the administrator selects the operation type of the configuration operation to be performed as the modification operation post, and enters the first identification information as abc in the first input interface 2 and the operation object in the fourth input interface 5, which includes the operation object to be modified
  • the identifier "11" of the configuration information and the first content "192.168.10.3" of the configuration information to be modified, and the identifier of the network device entered in the fifth input interface 6 is IP1.
  • the management device can read the operation type post of the configuration operation from the fourth interface shown in Figure 9, the first identification information abc, the identification "11" of the configuration information to be modified, and the first content of the configuration information to be modified "192.168. 10.3", and the identification of the network device is IP1.
  • the configuration message generated by the management device based on the read information can be expressed as:
  • conifig-id is the first parameter, and the network device sends the configuration message again.
  • Step 202 The network device receives the configuration message, obtains the content in the configuration database of the network device, obtains the first configuration information, and stores the first identification information and the first configuration information in the corresponding relationship between the identification information and the configuration information. And execute the configuration operation corresponding to the operation type on the configuration database according to the operation object.
  • the network device receives the configuration message, copies the content in the configuration database to obtain the first configuration information stored in the configuration database, and saves the first identification information and the first configuration information in the identification information and configuration correspondingly.
  • the first configuration operation corresponding to the operation type is performed on the configuration database according to the operation object.
  • the network device receives the following configuration message:
  • the operation type extracted from the configuration message is the modification operation post, the operation object is the identifier "11" of the configuration information to be modified and the first content is "192.168.10.3", and the first parameter conifig is extracted from the configuration message
  • the value abc of -id obtains the first identification information.
  • the configuration database shown in Table 1 is copied to obtain the first configuration information, and the first identification information and the first configuration information are correspondingly saved in the corresponding relationship between the identification information and the configuration information.
  • the network device obtains the configuration information to be modified from the configuration database shown in Table 1 according to the identifier "11" of the configuration information to be modified.
  • the configuration information to be modified includes the identifier "11" of the configuration information to be modified and the second content "192.168.10.1” Then, the network device updates the second content "192.168.10.1” of the configuration information to be modified to the first content "192.168.10.3” from the configuration database shown in Table 1 above, and the obtained configuration database is as shown in Table 9 above. Show.
  • the network device After the network device performs the configuration operation on the configuration database, the network device operates according to the configuration database. In addition, if the administrator still needs to perform configuration operations on the configuration database, the administrator can enter the network device identification, the operation type and operation object of the configuration operation, and the identification information used to identify the configuration operation into the management device. , And then the management device and network device perform the above steps 201 to 202 again.
  • the administrator may need to restore the operating state of the network device to the operating state before performing a certain configuration operation. At this time, it is necessary to restore the configuration information saved in the configuration database of the network device to the configuration database saved before the configuration operation is performed. Configuration information. Among them, in order to meet this requirement, the following steps 203 to 204 can be implemented.
  • Step 203 The management device sends a recovery message to the network device, where the recovery message includes the first identification information.
  • the management device generates a message including the first identification information and rollback identification information, where the rollback identification information is used to identify that the type of the message is a recovery message.
  • the management device When the management device generates a message, it can set the value of the first parameter in the message to the first identification information, and add rollback identification information to the message, so that the generation includes the first identification information and the rollback identification. Information message.
  • the rollback identification information is preset information, or information agreed in advance by the management device and the network device.
  • the management device may display a fifth interface to the administrator, and the administrator inputs the first identification information and the rollback identification information to the management device through the fifth interface.
  • the fifth interface includes a first input interface 2 for inputting first identification information, a fourth input interface 5 for inputting network device identification, and rollback identification information "rollback "And the eighth input interface 9 for the user to confirm whether to input the rollback identification information.
  • the administrator confirms to input the rollback identification information, he can choose to input the rollback identification information in the eighth input interface 9 (for example, input value, which is used to indicate that the administrator chooses to enter the rollback identification information), and in the first input interface 2 Enter the first identification information abc in the input interface, and enter the identification IP1 of the network device in the fourth input interface 5.
  • the management device reads the first identification information abc, rollback identification information "rollback”, and the identification IP1 of the network device from the second interface.
  • Step 204 The network device receives the recovery message, obtains the first configuration information corresponding to the first identification information from the corresponding relationship between the identification information and the configuration information, and updates the content of the configuration database to the first configuration information.
  • the network device extracts the value of the first parameter from the recovery message to obtain the first identification information, so as to extract the rollback identification information from the recovery message.
  • the identification information is retrieved from the identification information.
  • the first configuration information corresponding to the first identification information is acquired from the correspondence relationship with the configuration information, and the content of the configuration database is updated to the first configuration information.
  • the rollback identification information "rollback” is extracted from the recovery message
  • the first configuration information corresponding to the first identification information abc is obtained from the corresponding relationship between the identification information and the configuration information under the trigger of the rollback identification information "rollback”
  • the first configuration information corresponding to the first identification information abc is the configuration information stored in the configuration database shown in Table 1
  • the content of the configuration database shown in Table 9 is updated to the first configuration information to obtain the configuration shown in Table 1.
  • the database so as to realize the restoration of the configuration database before the configuration operation identified by the first identification information abc is performed.
  • the network device receives a configuration message sent by the management device.
  • the configuration message includes the first identification information, the operation type and the operation object of the configuration operation to be performed; the content in the configuration database is obtained, and the first Configuration information; correspondingly save the first identification information and the first configuration information in the corresponding relationship between the identification information and the configuration information, and then perform the configuration operation corresponding to the operation type on the configuration database according to the operation object.
  • the administrator needs to restore the configuration database before performing the configuration operation, the administrator only needs to input the first identification information into the management device, and the management device sends a recovery message including the first identification information to the network device, so that the network device will respond to the recovery report.
  • the first identification information in the text obtains the first configuration information corresponding to the first identification information from the corresponding relationship between the identification information and the configuration information, and updates the configuration database to the first configuration information, so that there is no need to edit the changed content in the configuration database , Improve the recovery efficiency.
  • an embodiment of the present application provides an apparatus 300 for managing network equipment.
  • the apparatus 300 may be deployed in the network equipment of the embodiment described in FIG. 1 or FIG. 2 and includes:
  • the receiving unit 301 is configured to receive a recovery message sent by the management device, the recovery message includes first identification information, and the first identification information is used to identify the first configuration operation that has been performed on the configuration database of the network device;
  • the processing unit 302 is configured to obtain the operation object and operation type corresponding to the first identification information from the identification information, the correspondence between the operation object and the operation type, where the operation type is the type of the first configuration operation, and the operation object is the first configuration The object operated by the operation;
  • the processing unit 302 is further configured to restore the configuration database from the first state to the second state according to the operation object and the operation type.
  • the first state is the state that the configuration database is in after the first configuration operation is performed
  • the second state is Configure the state of the database before performing the first configuration operation.
  • the receiving unit 301 is further configured to receive a configuration message sent by the management device, the configuration message including the first identification information, the operation type and the operation object of the first configuration operation;
  • the processing unit 302 is further configured to save the first identification information, the operation object and the operation type corresponding to the identification information, the corresponding relationship between the operation object and the operation type, and execute the operation type corresponding to the configuration database according to the operation object.
  • the first configuration operation is further configured to save the first identification information, the operation object and the operation type corresponding to the identification information, the corresponding relationship between the operation object and the operation type, and execute the operation type corresponding to the configuration database according to the operation object.
  • the processing unit 302 saves the first identification information, the corresponding relationship between the operation object and the operation type, and the detailed implementation process of performing the first configuration operation on the configuration database, please refer to the embodiment shown in FIG. 2 Related content in step 102.
  • the receiving unit 301 is further configured to receive a first trial run request, where the first trial run request includes first identification information;
  • the processing unit 302 is configured to run according to the configuration database in the first state during the first trial run period corresponding to the first configuration operation identified by the first identification information, and the start time of the first trial run period is to execute the first configuration Operation time, the length of time during the first trial run is equal to the duration threshold; when a recovery message is received during the first trial run, the first identification information is obtained from the first identification information, the correspondence between the operation object and the operation type The corresponding operation type and operation object.
  • the receiving unit 301 is further configured to receive a second trial run request, the second trial run request includes second identification information, the second identification information is used to identify a second configuration operation, and the second configuration operation is that the device 300 has been Operations performed on the configuration database;
  • the processing unit 302 is further configured to run according to the configuration database in the third state during the second trial run period corresponding to the second configuration operation.
  • the start time of the second trial run period is the time to perform the second configuration operation.
  • the duration of the second trial operation period is equal to the duration threshold, and the third state is the state that the configuration database is in after the second configuration operation is performed; when the receiving unit 301 receives the confirmation message during the second trial operation period, the confirmation message includes the second
  • the identification information is to delete the record including the second identification information from the identification information, the corresponding relationship between the operation object and the operation type.
  • the receiving unit 301 is further configured to receive a third trial run request, the third trial run request includes third identification information, the third identification information is used to identify the third configuration operation, and the third configuration operation is that the device 300 has been Operations performed on the configuration database;
  • the processing unit 302 is further configured to run according to the configuration database in the fourth state during the third trial run period corresponding to the third configuration operation.
  • the start time of the third trial run period is the time for performing the third configuration operation.
  • the length of time during the third trial run is equal to the duration threshold, and the fourth state is the state that the configuration database is in after the third configuration operation is performed; when the receiving unit 301 does not receive a message including the third identification information during the third trial run ,
  • the configuration database is restored from the fifth state to the fourth state.
  • the fifth state is that the configuration database is in the fourth state after the third configuration operation is performed. status.
  • processing unit 302 is configured to:
  • the recovery information is used to describe the content that has changed in the configuration database during the process of performing the first configuration operation on the configuration database;
  • the configuration database is restored from the first state to the second state.
  • the recovery message is a message including recovery identification information and first identification information, and the recovery identification information is used to identify the type of the message as a recovery message.
  • the receiving unit receives the recovery message sent by the management device. Since the recovery message includes the first identification information, the first identification information is used to identify the first configuration operation that has been performed on the configuration database of the network device.
  • the processing unit obtains the operation object and operation type corresponding to the first identification information from the identification information, the correspondence relationship between the operation object and the operation type.
  • the operation type is the type of the first configuration operation
  • the operation object is the operation performed by the first configuration operation. Object.
  • the processing unit restores the configuration database from the first state to the second state according to the operation object and operation type.
  • the first state is the state that the configuration database is in after the first configuration operation is executed
  • the second state is the execution of the first configuration Configure the state of the database before the operation.
  • the management device when restoring the configuration database, the administrator only needs to enter the first identification information, the management device sends a restore message including the first identification information to the network device, and the processing unit automatically restores the configuration database in the second state according to the first identification information. , Improve the efficiency of restoring configuration data.
  • an embodiment of the present application provides an apparatus 400 for managing network equipment.
  • the apparatus 400 may be deployed in the network equipment of the embodiment described in FIG. 1 or FIG. 8, and includes:
  • the receiving unit 401 is configured to receive a recovery message sent by the management device, the recovery message includes first identification information, the first identification information is used to identify the first configuration information, and the first configuration information is the network device before performing the first configuration operation
  • the first configuration operation is an operation that the device 400 has performed on the configuration database
  • the processing unit 402 is configured to obtain the first configuration information corresponding to the first identification information from the corresponding relationship between the identification information and the configuration information; and update the content of the configuration database to the first configuration information.
  • the detailed implementation process of the processing unit 402 acquiring the first configuration information and updating the content of the configuration database to the first configuration information may refer to the related content in step 204 of the embodiment shown in FIG. 8.
  • the receiving unit 401 is further configured to receive a configuration message sent by the management device, where the configuration message includes the first identification information, the operation type and the operation object of the first configuration operation;
  • the processing unit 402 is further configured to obtain the content in the configuration database to obtain the first configuration information; to store the first identification information and the first configuration information in the corresponding relationship between the identification information and the configuration information, and to pair according to the operation object
  • the configuration database performs the first configuration operation for this operation type.
  • the processing unit 402 stores the correspondence between the first identification information and the first configuration information, and the detailed implementation process of performing the first configuration operation on the configuration database can be found in step 202 of the embodiment shown in FIG. 2 Related content.
  • the receiving unit receives the recovery message sent by the management device, the recovery message includes first identification information, the first identification information is used to identify the first configuration information, and the first configuration information is performing the first configuration operation
  • the first configuration operation is an operation that the network device has performed on the configuration database.
  • the processing unit obtains the first configuration information corresponding to the first identification information from the correspondence between the identification information and the configuration information. And the processing unit updates the content of the configuration database to the first configuration information.
  • the management device sends a recovery message including the first identification information to the network device, and the processing unit automatically according to the first identification information
  • the configuration database prior to the execution of the first configuration operation is restored to improve the efficiency of restoring configuration data.
  • FIG. 13 is a schematic diagram of a network device management apparatus 500 according to an embodiment of the application.
  • the device 500 includes at least one processor 501, a bus system 502, a memory 503, and at least one transceiver 504.
  • the device 500 is a device with a hardware structure, and can be used to implement the functional modules in the device 300 described in FIG. 11 or the functional modules in the device 400 described in FIG. 12.
  • the processing unit 302 in the device 300 shown in FIG. 11 or the processing unit 402 in the device 400 shown in FIG. 12 can be implemented by calling the code in the memory 503 by the at least one processor 501.
  • the receiving unit 301 in the device 300 shown in FIG. 11 or the receiving unit 401 in the device 400 shown in FIG. 12 may be implemented by the transceiver 504.
  • the device 500 can also be used to implement the function of the collection and analysis device in any of the foregoing embodiments.
  • processor 501 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (ASIC) , Or one or more integrated circuits used to control the execution of the program of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the above-mentioned bus system 502 may include a path for transferring information between the above-mentioned components.
  • the aforementioned transceiver 504 is used to communicate with other devices or a communication network.
  • the aforementioned memory 503 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), or other types that can store information and instructions.
  • the type of dynamic storage device can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical discs Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can be used by Any other medium accessed by the computer, but not limited to this.
  • the memory can exist independently and is connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory 503 is used to store application program codes for executing the solutions of the present application, and the processor 501 controls the execution.
  • the processor 501 is configured to execute the application program code stored in the memory 503, so as to realize the functions in the method of the present patent.
  • the processor 501 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 13.
  • the apparatus 500 may include multiple processors, such as the processor 501 and the processor 507 in FIG. 13. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the program can be stored in a computer-readable storage medium.
  • the storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种网络设备的管理方法、装置及系统,属于通信领域。该方法包括:网络设备接收管理设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识已对网络设备的配置数据库执行的第一配置操作;从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,操作类型是第一配置操作的类型,操作对象是第一配置操作所操作的对象;根据操作对象和操作类型,将配置数据库由第一状态恢复成第二状态,第一状态是在执行第一配置操作之后配置数据库处于的状态,第二状态是在执行第一配置操作之前配置数据库处于的状态。采用该方法,可以提高对配置数据库的恢复效率。

Description

网络设备的管理方法、装置及系统
本申请要求于2019年10月21日提交的申请号为201911002749.9、发明名称为“网络设备的管理方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,特别涉及一种网络设备的管理方法、装置及系统。
背景技术
Restconf协议定义了一套网络设备的管理操作,该网络设备可以为交换机或路径器等。该管理操作包括增加网络设备的配置信息、删除网络设备的配置信息或修改网络设备的配置信息等至少一种操作。网络设备的配置信息保存在网络设备的配置数据库中,用户可以使用该套管理操作对网络设备的配置数据库进行修改,使网络设备的状态达到用户所期望的状态。
对配置数据库的修改包括在配置数据库中添加配置信息、删除配置数据库保存的配置信息或对配置数据库中的配置信息的内容进行修改。有时用户对网络设备的配置数据库进行修改后,发现修改有误,导致网络设备的状态发生错误,此时用户需要将配置数据库中保存的配置信息修改回去,以恢复出修改前配置数据库中保存的配置信息,从而实现恢复出网络设备的原状态。或者,有时在网络设备使用修改后的配置数据库运行一段时间后,用户需要恢复网络设备的原状态,此时用户也需要将配置数据库修改回去。
目前需要用户手动修改配置数据库,以对配置数据库进行恢复,手动修改往往需要较长时间,导致对配置数据库的恢复效率较低。
发明内容
本申请提供了一种网络设备的管理方法、装置及系统,以提高对配置数据加的恢复效率,所述技术方案如下:
第一方面,本申请提供了一种网络设备的管理方法,在所述方法中:网络设备接收管理设备发送的恢复报文,由于该恢复报文包括第一标识信息,第一标识信息用于标识已对网络设备的配置数据库执行的第一配置操作。网络设备从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,该操作类型是第一配置操作的类型,该操作对象是第一配置操作所操作的对象。网络设备根据该操作对象和操作类型,将配置数据库由第一状态恢复成第二状态,第一状态是在执行第一配置操作之后配置数据库处于的状态,第二状态是在执行第一配置操作之前配置数据库处于的状态。这样在恢复配置数据库时,管理员只需要在管理设备输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,网络设备根据第一标识信息自动地恢复出第二状态的配置数据库,提高了恢复配置数据的效率。
在一种可能的实现方式中,网络设备接收管理设备发送的配置报文,配置报文包括第一标识信息、第一配置操作的操作类型和操作对象。网络设备将第一标识信息、该操作对象和该操作类型对应保存到标识信息、操作对象与操作类型的对应关系,以及,根据该操作对象对该配置数据库执行该操作类型对应的第一配置操作。由于网络设备保存第一标识信息、该操作对象和该操作类型之间的对应关系,从而可以在恢复配置数据库时,可以基 于保存的对应关系进行自动恢复。
在另一种可能的实现方式中,网络设备接收第一试运行请求,第一试运行请求包括第一标识信息,在第一标识信息标识的第一配置操作对应的第一试运行期间内,根据第一状态的配置数据库进行运行,第一试运行期间的起始时间是执行第一配置操作的时间,第一试运行期间的时间长度等于时长阈值。网络设备在第一试运行期间内接收到恢复报文时,从第一标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作类型和操作对象。由于网络设备在第一试运行期间内根据第一状态的配置数据库进行试运行,这样在第一试运行期间内可以检测出对配置数据库的修改是否有误,在有误的情况下及时请求恢复配置数据库,可以减轻网络设备对业务产生的影响。
在另一种可能的实现方式中,该配置报文还包括试运行标识,网络设备在该试运行标识的触发下,在第一配置操作对应的第一试运行期间内,根据第一状态的配置数据库进行运行,第一试运行期间的起始时间是执行第一配置操作的时间,第一试运行期间的时间长度等于时长阈值。网络设备在第一试运行期间内接收到恢复报文时,从第一标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作类型和操作对象。由于网络设备在第一试运行期间内根据第一状态的配置数据库进行试运行,这样在第一试运行期间内可以检测出对配置数据库的修改是否有误,在有误的情况下及时请求恢复配置数据库,可以减轻网络设备对业务产生的影响。
在另一种可能的实现方式中,网络设备接收第二试运行请求,第二试运行请求包括第二标识信息,第二标识信息用于标识第二配置操作,第二配置操作是网络设备已对配置数据库执行的操作。网络设备在第二配置操作对应的第二试运行期间内,根据第三状态的配置数据库进行运行,第二试运行期间的起始时间是执行第二配置操作的时间,第二试运行期间的时间长度等于时长阈值,第三状态是在执行第二配置操作后配置数据库处于的状态。网络设备在第二试运行期间内接收确认报文时,该确认报文包括第二标识信息,从标识信息、操作对象与操作类型的对应关系中删除包括第二标识信息的记录。这样在第二试运行期间内检测出对配置数据库的修改是正确的,则可以及时对配置数据库进行确认,避免网络设备在第二试运行期间结束时自动恢复配置数据库。
在另一种可能的实现方式中,网络设备接收第三试运行请求,第三试运行请求包括第三标识信息,第三标识信息用于标识第三配置操作,第三配置操作是网络设备已对配置数据库执行的操作。网络设备在第三配置操作对应的第三试运行期间内,根据第四状态的配置数据库进行运行,第三试运行期间的起始时间是执行第三配置操作的时间,第三试运行期间的时间长度等于时长阈值,第四状态是在执行第三配置操作后配置数据库处于的状态。网络设备在第三试运行期间内未接收到包括第三标识信息的报文时,则在第三试运行期间结束时根据第三配置操作对应的操作类型和操作对象,将该配置数据库由第五状态恢复成第四状态,第五状态是在执行第三配置操作之后配置数据库处于的状态。这样如果对配置数据库的修改有误,管理员可以不用对网络设备触发任何操作,只要在第三试运行期间结束时,网络设备自动地对配置数据库进行恢复,提高了恢复效率,还提高了用户体验。
在另一种可能的实现方式中,网络设备根据该操作对象获取恢复信息,恢复信息用于描述在对配置数据库中执行第一配置操作的过程配置数据库中发生变化的内容。网络设备根据该操作类型和该恢复信息,将配置数据库由第一状态恢复成第二状态。这样根据恢复信息将第一配置操作对配置数据库修改的内容进行恢复,而其他配置操作对配置数据库的修改仍可以保留。
在另一种可能的实现方式中,恢复报文为包括恢复标识信息和第一标识信息的报文,该恢复标识信息用于标识该报文的类型为恢复报文。
第二方面,本申请提供了一种网络设备的管理方法,在所述方法中,网络设备接收管理设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识第一配置信息,第一配置信息是在执行第一配置操作前网络设备的配置数据库中保存的配置信息,第一配置操作是网络设备已对配置数据库执行的操作。网络设备从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息。网络设备将配置数据库的内容更新为第一配置信息。这样在恢复出在执行第一配置操作前的配置数据库时,管理员只需要输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,网络设备根据第一标识信息自动地恢复出在执行第一配置操作前的配置数据库,提高了恢复配置数据的效率。
在一种可能的实现方式中,网络设备接收管理设备发送的配置报文,配置报文包括第一标识信息、第一配置操作的操作类型和操作对象。网络设备获取配置数据库中的内容,得到第一配置信息;将第一标识信息和第一配置信息对应保存在标识信息与配置信息的对应关系中,以及,根据该操作对象对配置数据库执行该操作类型应的第一配置操作。由于网络设备保存第一标识信息和第一配置信息之间的对应关系,从而可以在恢复配置数据库时,可以基于保存的对应关系进行自动恢复。
第三方面,本申请提供了一种网络设备的管理装置,用于执行第一方面或第一方面的任意一种可能实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能实现方式的方法的单元。或者,所述装置包括用于执行第二方面或第二方面的一种可能实现方式的方法的单元。
第四方面,本申请实施例提供了一种网络设备的管理装置,所述装置包括:收发器、处理器和存储器。其中,所述处理器、所述存储器和所述收发器之间可以通过总线系统相连。所述存储器用于存储一个或多个程序,所述处理器用于执行所述存储器中的一个或多个程序,完成第一方面或第一方面的任意可能实现方式中的方法;或者,所述处理器用于执行所述存储器中的一个或多个程序,完成第二方面或第二方面的一种可能实现方式中的方法。
第五方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在处理器上运行时,使得处理器执行上述第一方面或第一方面的任意可能实现方 式中的方法;或者,当其在处理器上运行时,使得处理器执行上述第二方面或第二方面的一种可能实现方式中的方法。
第六方面,本申请提供了一种包含指令的计算机程序产品,当其在处理器上运行时,使得处理器执行上述第一方面或第一方面的任意可能实现方式中的方法;或者,当其在处理器上运行时,使得处理器执行上述第二方面或第二方面的一种可能实现方式中的方法。
第七方面,本申请提供了一种网络设备的管理系统,所述系统包括管理设备和网络设备,
管理设备用于向网络设备发送恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识已对网络设备的配置数据库执行的第一配置操作。网络设备用于从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,该操作类型是第一配置操作的类型,该操作对象是第一配置操作所操作的对象;根据该操作对象和操作类型,将配置数据库由第一状态恢复成第二状态,第一状态是在执行第一配置操作之后配置数据库处于的状态,第二状态是在执行第一配置操作之前配置数据库处于的状态。这样在恢复配置数据库时,管理员只需要在管理设备中输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,网络设备根据第一标识信息自动地恢复出第二状态的配置数据库,提高了恢复配置数据的效率。
第八方面,本申请提供了一种网络设备的管理系统,所述系统包括:管理设备和网络设备;管理设备用于向网络设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识第一配置信息,第一配置信息是在执行第一配置操作前网络设备的配置数据库中保存的配置信息,第一配置操作是网络设备已对配置数据库执行的操作;网络设备,用于从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息;将配置数据库的内容更新为第一配置信息。这样在恢复出在执行第一配置操作前的配置数据库时,管理员只需要在管理设备中输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,网络设备根据第一标识信息自动地恢复出在执行第一配置操作前的配置数据库,提高了恢复配置数据的效率。
附图说明
图1是本申请实施例提供的一种网络设备的管理系统的结构示意图;
图2是本申请实施例提供的一种网络设备的管理方法流程图;
图3是本申请实施例提供的一种第一界面示意图;
图4是本申请实施例提供的另一种第一界面示意图;
图5是本申请实施例提供的另一种第一界面示意图;
图6是本申请实施例提供的第二界面示意图;
图7是本申请实施例提供的第三界面示意图;
图8是本申请实施例提供的另一种网络设备的管理方法流程图;
图9是本申请实施例提供的第四界面示意图;
图10是本申请实施例提供的第五界面示意图;
图11是本申请实施例提供的一种网络设备的管理装置结构示意图;
图12是本申请实施例提供的另一种网络设备的管理装置结构示意图;
图13是本申请实施例提供的另一种网络设备的管理装置结构示意图。
具体实施方式
参见图1,本申请实施例提供了一种网络设备的管理系统,该管理系统包括:
管理设备和网络设备,管理设备与网络设备之间可以建立有网络连接。
网络设备中包括配]置数据库,该配置数据库用于保存配置信息。网络设备根据该配置数据库中的配置信息进行运行。
可选的,网络设备可以为路由器或交换机等。该配置信息可以为网络流量的路由信息等,这样网络设备在接收到该网络流量时,根据配置数据库中保存的该网络流量的路由信息对该网络流量进行转发。
网络流量的路由信息包括网络流量的标识信息和下一跳信息。例如,参见下表1所示的配置数据库,假设该配置数据库包括两条配置信息,第一条配置信息是网络流量1的路由信息,包括网络流量1的标识信息“11”和下一跳信息“192.168.10.1”;第二条配置信息是网络流量2的路由信息,包括网络流量2的标识信息“12”和下一跳信息“192.168.10.2”。这样网络设备在接收到网络流量1时,根据第一条配置信息对网络流量1进行转发,在接收到网络流量2时,根据第二条配置信息对网络流量2进行转发。
表1
Figure PCTCN2020116938-appb-000001
管理设备可以使用一套配置操作对网络设备的配置数据库进行修改,然后网络设备根据修改后的配置数据库进行运行。由于修改前的配置数据库和修改后的配置数据库不同,这样网络设备根据修改前的配置数据库进行运行的运行状态和根据修改后的配置信息进行运行的运行状态也随之不同。
可选的,该套配置操作可以包括用于向配置数据库添加配置信息的添加操作、用于修改配置数据库中的配置信息的修改操作或用于删除配置数据库中的配置信息的删除操作等中的至少一个。
这样,管理设备可以在修改网络设备的配置数据库时,可以使用添加操作向网络设备的配置数据库中添加至少一条配置信息,或者,使用修改操作修改网络设备的配置数据库包括的至少一条配置信息,或者,使用删除操作删除网络设备的配置数据库中包括的至少一条配置信息。
可选的,管理设备可以在管理员的触发下对网络设备的配置数据库进行修改。通常管理员需要改变网络设备的运行状态时,管理员可以在管理设备中选择需要执行的配置操作。然后,管理设备对该网络设备的配置数据库执行该配置操作,以实现修改该网络设备的配置数据库。网络设备根据修改后的配置数据库进行运行,如此实现改变网络设备的运行状态。
例如,仍以上述网络流量为例,假设管理员需要调整网络设备转发该网络流量的转发 路径,则管理员可以在管理设备中配置该网络流量对应的新路由信息以及选择的配置操作为修改操作。然后,管理设备将网络设备的配置数据库保存的该网络流量的路由信息修改为该新路由信息,网络设备在接收到该网络流量时,根据配置数据库中保存的该新路由信息转发该网络流量,如此实现调整该网络流量的转发路径。
可选的,管理设备可以运行用于管理网设备的客户端,管理员可以通过该客户端修改网络设备的配置数据库。
管理员通过管理设备修改网络设备的配置数据库,该配置数据库中的部分内容会发生变化。网络设备根据修改后的配置数据库进行运行的运行状态可能与管理员需要的运行状态相同,也可能与管理员需要的运行状态不同。在网络设备的运行状态与管理员需要的运行状态相同时,表明管理员对配置数据库的修改正确,在网络设备的运行状态与管理员需要的运行状态不同时,表明管理员对网络设备的配置数据库的修改有误。例如,仍以上述网络流量为例,网络设备根据配置数据库中保存的该新路由信息转发该网络流量,在该网络流量的转发路径与管理员所期望的转发路径相同,表示对配置数据库的修改正确,在该网络流量的转发路径与管理员所期望的转发路径不同,表示对配置数据库的修改有误。
在对配置数据库的修改有误时,需要对配置数据库中发生变化的内容进行恢复。为了实现恢复配置数据库,可以在网络设备中定义试运行能力集,使网络设备具有试运行功能。所谓试运行功能是指当对网络设备的配置数据库执行完配置操作后,网络设备可以根据修改后的配置数据库运行一段时间。其中,如果在该段时间内发现对配置数据库的修改有误,管理设备可以请求网络设备对该配置数据库中发生变化的内容进行恢复。
这样,管理员在修改配置数据库时可能无法确定对配置数据库的修改是否正确,所以管理员在通过管理设备修改网络设备的配置数据库后,可以使网络设备根据修改后的配置数据库试运行一段时间。在试运行的该段时间内,如果管理员会发现网络设备的运行状态有误或管理设备会检测到网络设备的运行状态有误,则管理员可以通过管理设备触发网络设备对配置数据库中发生变化的内容进行恢复,或者,管理设备直接触发网络设备对配置数据库中发生变化的内容进行恢复。在试运行的该段时间内,如果管理员发现网络设备的运行状态正确或管理设备检测出网络设备的运行状态正确,则管理员可以通过管理设备对该配置数据库的修改进行确认,或者,管理设备直接对该配置数据库的修改进行确认。在对该配置数据库的修改进行确认后,网络设备在该段时间剩余的时间内以及在该段时间结束后,继续根据修改后的配置数据库运行。试运行的详细流程可以参见图2所示的实施例,在此先不详细说明。
管理员在修改配置数据库时能够确定对配置数据库的修改是正确的,则在修改该配置数据库后,网络设备根据修改后的配置数据库进行运行。在网络设备根据修改后的配置数据库运行一段时间后,管理员可能需要网络设备的运行状态恢复到在对该配置数据库进行修改前的运行状态,为了满足该需求,在网络设备中定义回退能力集,使网络设备具有回退功能。所谓回退功能是指在对网络设备的配置数据库执行完配置操作后,网络设备可以将修改后的配置数据库中的内容恢复到在执行该配置操作之前该配置数据库中保存的内容。
这样管理员可以通过管理设备触发网络设备将配置数据库的内容恢复到修改前的内容,以使网络设备的运行状态恢复到对该配置数据库进行修改前的运行状态。该过程的详细流程可以参见图8所示的实施例,在此先不详细说明。
参见图2,本申请实施例提供了一种网络设备的管理方法,该方法可以应用于图1所示的网络架构中。在方法中,可以使用网络设备的试运行功能对该配置数据库中发生变化的内容进行恢复。该方法包括:
步骤101:管理设备向网络设备发送配置报文,该配置报文包括试运行标识、第一标识信息、待执行的配置操作的操作类型和操作对象。
第一标识信息用于标识该配置操作,试运行标识用于指示网络设备在该配置操作对应的试运行期间内根据第一状态的配置数据库进行运行。第一状态是在对网络设备的配置数据库执行该配置操作后该配置数据库处于的状态。该试运行期间的起始时间为执行该配置操作的时间,该试运行期间的时间长度等于时长阈值。
该配置报文也可以不包括试运行标识,管理设备在发送配置报文时还向网络设备发送试运行请求,或者,在发送该配置报文之前向网络设备发送试运行请求,该试运行请求包括第一标识信息。该试运行请求用于请求网络设备在该配置操作对应的试运行期间内根据第一状态的配置数据库进行运行。
管理员可以向管理设备输入网络设备的标识、该配置操作的操作类型和操作对象,以及用于标识该配置操作的第一标识信息。然后,管理设备获取第一标识信息、该配置操作的操作类型和操作对象,生成包括试运行标识、第一标识信息、该配置操作的操作类型和操作对象的配置报文,根据该网络设备的标识信息,向网络设备发送配置报文;或者,生成包括第一标识信息、该配置操作的操作类型和操作对象的配置报文,以及生成包括第一标识信息的试运行请求,根据该网络设备的标识信息,向网络设备发送配置报文,以及发送试运行请求。
可选的,该试运行标识也可以由管理员输入到管理设备,或者管理设备中包括该试运行标识。网络设备的标识可以为网络设备的网络之间互连的协议(internet protocol,IP)地址等。
试运行标识可以是预设的信息,或者,可以是管理设备与网络设备事先约定的信息。
可选的,在该配置报文包括试运行标识的情况下,该配置报文还包括时长阈值。或者,该试运行请求还包括时长阈值。
该时长阈值可以是管理员向管理设备输入的阈值。或者,该时长阈值可以是管理设备中预先保存的阈值。
可选的,在该配置报文包括试运行标识的情况下,该配置报文也可以不包括时长阈值;或者,试运行请求可以不包括时长阈值,但网络设备中可以包括时长阈值,网络设备中包括的时长阈值可以是事先与管理设备约定的阈值。
可选的,该配置操作是管理员需要对网络设备的配置数据库执行的操作。该配置操作的操作类型可以为用于向该配置数据库添加配置信息的添加操作、用于修改该配置数据库中的配置信息的修改操作或用于删除该配置数据库中的配置信息的删除操作等。
在该操作类型为修改操作的情况,该操作对象包括待修改配置信息的标识和第一内容,第一内容是管理员对待修改配置信息进行修改后的内容。在该操作类型为添加操作的情况,该操作对象包括待添加配置信息,待添加配置信息包括待添加配置信息的标识和内容。在该操作类型为删除操作,该操作对象可以包括待删除配置信息的标识。
可选的,配置信息的标识可以是该配置信息的组成部分,该配置信息的其他部分可以 称为该配置信息的内容。例如参见上述表1所示的第一条配置信息,第一条配置信息包括网络流量1的标识信息“11”和下一跳信息“192.168.10.1”,可以将标识信息“11”作为第一条配置信息的标识,将下一跳信息“192.168.10.1”作为第一条配置信息的内容。
在本步骤中,可以使用Restconf协议定义的一套配置操作,Restconf协议定义的配置操作包括post、creat或delete等至少一个。post、creat、delete分别为修改操作、增加操作、删除操作。管理设备在获取到第一标识信息、该配置操作的操作类型和操作对象后,生成包括试运行标识、第一标识信息、该配置操作的操作类型和操作对象的报文,由于生成的报文中包括操作类型,所以此时生成的报文的报文类型为配置报文。
可选的,在本步骤中,生成的报文中包括第一参数和第二参数,在生成该报文时将第一参数的值设为第一标识信息,将第二参数的值设为试运行标识,如此实现在生成的报文中包括第一标识信息和试运行标识。
可选的,在本步骤中,生成的报文中还包括第三参数,在生成该报文中将第三参数的值设为该时长阈值,如此实现在生成的报文中包括该时长阈值。
可选的,在本步骤中,管理设备可以向管理员显示第一界面,管理员可以通过第一界面向管理设备输入网络设备的标识、第一标识信息、该配置操作的操作类型和操作对象等信息。还可以通过第一界面向管理设备输入试运行标识或该时长阈值等信息。
例如,参见图3,第一界面包括用于选择操作类型的选择按钮1、用于输入第一标识信息的第一输入接口2、用于输入试运行标识的第二输入接口3、用于输入时长阈值的第三输入接口4、用于输入操作对象的第四输入接口5和用于输入网络设备的标识的第五输入接口6。
选择按钮1可以为一个下拉按钮,选择按钮1中包括至少一个配置操作的操作类型,该至一个配置操作的操作类型包括post、creat和delete。
管理员可以在选择按钮1中选择待执行的配置操作的操作类型。参见图3所示的第一界面,假设管理员需要修改上述表1所示配置数据库中的第一条配置信息,第一条配置信息为网络流量1的路由信息,管理员需要将该路由信息中的下一跳信息由“192.168.10.1”修改为“192.168.10.3”。此时管理员选择待执行的配置操作的操作类型为修改操作post,在第一输入接口2中输入第一标识信息为abc,在第二输入接口3中输入试运行标识为A、在第三输入接口4中输入时长阈值为180、在第四输入接口5中输入操作对象,该操作对象包括待修改配置信息的标识“11”以及待修改配置信息的第一内容“192.168.10.3”,以及在第五输入接口6中输入网络设备的标识为IP1。其中,时长阈值的单位可以为秒或分钟等。
管理设备可以从图3所示的第一界面中读取该配置操作的操作类型post、第一标识信息abc、试运行标识A、时长阈值为180、待修改配置信息的标识“11”、待修改配置信息的第一内容“192.168.10.3”、以及网络设备的标识为IP1。管理设备基于读取的信息生成的配置报文可以表示为:
post http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180(Port为网络设备的端口号)
<routeInfo>
<Id info>11</Id info>(待修改配置信息的标识)
<Next hop>192.168.10.3</Next hop>(待修改配置信息的第一内容)
</routeInfo>
管理设备再发送该配置报文。
再如,参见图4所示的第一界面,假设管理员需要向网络设备的配置数据库增加一条配置信息,假设该配置信息为网络流量3的路由信息,该路由信息包括网络流量3的标识信息“13”和下一跳信息“192.168.10.4”。此时管理员选择待执行的配置操作的操作类型为增加操作create,在第一输入接口2中输入第一标识信息为abc,在第二输入接口3中输入试运行标识为A、在第三输入接口4中输入时长阈值为180、在第四输入接口5中输入操作对象,该操作对象包括待添加配置信息的标识“13”以及待添加配置信息的内容“192.168.10.4”,以及在第五输入接口6中输入网络设备的标识为IP1。
管理设备可以从图4所示的第一界面中读取该配置操作的操作类型create,第一标识信息abc,试运行标识A、时长阈值为180、待添加配置信息的标识“13”、待添加配置信息的内容“192.168.10.4”,以及网络设备的标识为IP1。管理设备基于读取的信息生成的配置报文可以表示为:
create http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180
<routeInfo>
<Id info>13</Id info>(待添加配置信息的标识)
<Next hop>192.168.10.4</Next hop>(待添加配置信息的内容)
</routeInfo>
管理设备再发送该配置报文。
再如,参见图5所示的第一界面,假设管理员需要删除上述表1所示配置数据库中的第二条配置信息,第二条配置信息为网络流量2的路由信息,该路由信息包括标识信息“12”和下一跳信息“192.168.10.2”。此时管理员选择待执行的配置操作的操作类型为删除操作delete,在第一输入接口2中输入第一标识信息为abc,在第二输入接口3中输入试运行标识为A、在第三输入接口4中输入时长阈值为180、在第四输入接口5中输入操作对象,该操作对象包括待删除配置信息的标识“12”,以及在第五输入接口6中输入网络设备的标识为IP1。
管理设备可以从图5所示的第一界面中读取该配置操作的操作类型delete,第一标识信息abc,试运行标识A、时长阈值为180、待添加配置信息的标识“12”、以及网络设备的标识为IP1。管理设备基于读取的信息生成的配置报文可以表示为:
delete http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180
<routeInfo>
<Id info>12</Id info>(待删除配置信息的标识)
</routeInfo>
管理设备发送该配置报文。
步骤102:网络设备接收该配置报文,将第一标识信息、该操作对象和该操作类型对应保存到标识信息、操作对象与操作类型的对应关系,以及,根据该操作对象对配置数据库执行该操作类型对应的配置操作。
在本步骤中,网络设备接收该配置报文,在该配置报文中提取第一参数的值得到第一标识信息,提取第二参数的值得到试运行标识,以及提取该配置报文包括的操作对象和操作类型,将第一标识信息、该操作对象和该操作类型对应保存到标识信息、操作对象与操 作类型的对应关系,以及,根据该操作对象对配置数据库执行该操作类型对应的第一配置操作。
可选的,在该配置报文还包括时长阈值的情况下,网络设备还可以在该配置报文中提取第三参数的值得到该时长阈值。
可选的,在该配置报文没有包括试运行标识且管理设备发送试运行请求的情况下,网络设备还接收试运行请求。
可选的,在该操作类型为添加操作的情况下,该操作对象包括待添加配置信息,待添加配置信息包括待添加配置信息的标识和内容。网络设备可以根据该操作类型,将待添加配置信息保存到配置数据库中。
例如,假设网络设备接收的配置报文可以表示为:
create http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180
<routeInfo>
<Id info>13</Id info>(待添加配置信息的标识)
<Next hop>192.168.10.4</Next hop>(待添加配置信息的内容)
</routeInfo>
从该配置报文中提取操作类型为添加操作create,提取操作对象为待添加配置信息,待添加配置信息包括待添加配置信息的标识“13”和待添加配置信息的内容“192.168.10.4”,以及从该配置报文中提取第一参数persist-id的值abc得到第一标识信息,提取第二参数trial的值A得到试运行标识,以及提取第三参数timeout的值180得到时长阈值。将第一标识信息abc、操作类型create和该操作对象对应保存在如下表2所示的标识信息、操作类型与操作对象的对应关系中。网络设备根据操作类型create将待添加配置信息保存在如下表3所示的配置数据库中。如下表3所示的配置数据库为执行该添加操作后处于第一状态的配置数据库。
表2
标识信息 操作类型 操作对象
abc create 13、192.168.10.4
…… …… ……
表3
Figure PCTCN2020116938-appb-000002
可选的,在该操作类型为删除操作的情况下,该操作对象包括待删除配置信息的标识。在执行该删除操作之前,网络设备根据待删除配置信息的标识,从配置数据库中获取待删除配置信息,将待删除配置信息保存在恢复信息表中。然后,网络设备从配置数据库中删除待删除配置信息。
例如,假设网络设备接收到的配置报文可以表示为:
delete http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180
<routeInfo>
<Id info>12</Id info>(待删除配置信息的标识)
</routeInfo>
从该配置报文中提取操作类型为删除操作delete,提取操作对象为待删除配置信息的标识“12”,以及从该配置报文中提取第一参数persist-id的值abc得到第一标识信息,提取第二参数trial的值A得到试运行标识,以及提取第三参数timeout的值180得到时长阈值。将第一标识信息abc、操作类型delete和该操作对象对应保存在如下表4所示的标识信息、操作类型与操作对象的对应关系中。
表4
标识信息 操作类型 操作对象
abc delete 12
…… …… ……
网络设备根据待删除配置信息的标识“12”,从如表1所示的配置数据库获取待删除配置信息,待删除配置信息包括待删除配置信息的标识“12”和待删除配置信息的内容“192.168.10.2”,将待删除配置信息保存如下表5所示的恢复信息表。然后,网络设备从上述表1所示的配置数据库中删除待删除配置信息,得到的配置数据库如下表6所示。如下表6所示的配置数据库为执行该删除操作后处于第一状态的配置数据库。
表5
12、192.168.10.2
……
表6
Figure PCTCN2020116938-appb-000003
可选的,在该操作类型为修改操作的情况下,该操作对象包括待修改配置信息的标识和第一内容。在执行修改操作之前,网络设备根据待修改配置信息的标识从配置数据库中获取待修改配置信息,获取的待修改配置信息包括待修改配置信息的标识和第二内容,将获取的待修改配置信息保存在恢复信息表中。然后,网络设备在配置数据库中将待修改配置信息的第二内容更新为第一内容。
例如,假设网络设备接收到的配置报文可以表示为:
post http://{IP1}{Port}:/restconf/systemInfo?trail=A&persist-id=abc&timeout=180
<routeInfo>
<Id info>11</Id info>(待修改配置信息的标识)
<Next hop>192.168.10.3</Next hop>(待修改配置信息的第一内容)
</routeInfo>
从该配置报文中提取操作类型为修改操作post,提取操作对象为待修改配置信息的标 识“11”和第一内容为“192.168.10.3”,以及从该配置报文中提取第一参数persist-id的值abc得到第一标识信息,提取第二参数trial的值A得到试运行标识,以及提取第三参数timeout的值180得到时长阈值。将第一标识信息abc、操作类型post和该操作对象对应保存在如下表7所示的标识信息、操作类型与操作对象的对应关系中。
表7
标识信息 操作类型 操作对象
abc post 11、192.168.10.3
…… …… ……
网络设备根据待修改配置信息的标识“11”,从如表1所示的配置数据库获取待修改配置信息,待修改配置信息包括待修改配置信息的标识“11”和第二内容“192.168.10.1”,将待修改配置信息包括待修改配置信息的标识“11”和第二内容为“192.168.10.1”保存在如下表8所示的恢复信息表。然后,网络设备从上述表1所示的配置数据库中将待修改配置信息的第二内容“192.168.10.1”更新为第一内容“192.168.10.3”,得到的配置数据库如下表9所示。如下表9所示的配置数据库为执行该修改操作后处于第一状态的配置数据库。
表8
11、192.168.10.1
……
表9
Figure PCTCN2020116938-appb-000004
可选的,网络设备对配置数据库执行完配置操作后,还可以向管理设备发送通知消息,管理设备向管理员显示该通知消息。
步骤103:网络设备在试运行标识的触发下,在该配置操作的试运行期间内根据第一状态的配置数据库进行运行,该试运行期间的起始时间为执行该配置操作的时间,以及该试运行期间的时间长度为该时长阈值。
可选的,在网络设备接收到试运行请求的情况下,网络设备从该试运行请求中读取第一标识信息,在第一标识信息所标识的该配置操作的试运行期内,根据第一状态的配置数据库进行运行。
可选的,网络设备在该试运行标识的触发或该试运行请求的触发下,对该配置操作进行计时。其中,网络设备可以为该配置操作启动一个计时器,使用该计时器为该配置操作计时,并对应保存该计时器与第一标识信息的对应关系。
可选的,网络设备启动的计时器为倒计时器,该倒计时器的时间初值等于该时长阈值。
启动倒计时器后,倒计时器逐渐减小该时间初值,当倒计时器将该时间初值减为数值0时,倒计时器溢出,启动倒计时器的时间至倒计时器溢出的时间之间的时间长度等于该时长阈值。
可选的,在该配置操作对应的试运行期间内管理设备可以允许管理员继续对网络设备 的配置数据库执行另一配置操作,执行过程可以参见上述101至103的过程。或者,在该配置操作对应的试运行期间内管理设备也可以不允许管理员继续对网络设备的配置数据库执行另一配置操作。
在该配置操作对应的试运行期间内,如果管理员或管理终端发现网络设备根据处于第一状态的配置数据库进行运行的运行状态有误,则可以将网络设备的配置数据库由第一状态恢复为第二状态,第二状态为在执行该配置操作之前网络设备的配置数据库处于的状态。详细实现过程包括如下104至105的操作。
步骤104:管理设备向网络设备发送恢复报文,该恢复报文包括第一标识信息。
可选的,管理设备生成包括第一标识信息和恢复标识信息的报文,该恢复标识信息用于标识该报文的类型为恢复报文。
管理设备在生成报文时,可以设置该报文中的第一参数的值为第一标识信息,以及设置该报文中的第二参数的值为该恢复标识信息,如此实现生成包括第一标识信息和恢复标识信息的报文。
管理员发现网络设备的运行状态有误,根据网络设备的运行状态可以确定出对网络设备的配置数据库执行的哪一次配置操作有问题,向管理设备输入恢复标识信息,用于标识该次配置操作的第一标识信息,以及该网络设备的标识。管理设备再生成包括第一标识信息和恢复标识信息的报文,即得到恢复报文,根据该网络设备的标识向网络设备发送该恢复报文。
可选的,恢复标识信息为预设的信息,或为管理设备与网络设备事先约定的信息。管理设备中可以包括恢复标识信息,这样管理员可以不用输入该恢复标识信息。
可选的,管理设备可以向管理员显示第二界面,管理员通过第二界面向管理设备输入第一标识信息和恢复标识信息。
例如,参见图6所示的第二界面,第二界面包括用于输入第一标识信息的第一输入接口2、用于输入恢复标识信息的第六输入接口7和用于输入网络设备的标识的第五输入接口6。管理员可以在第一输入接口2中输入第一标识信息abc以及在第六输入接口7中输入恢复标识信息B,以及在第五输入接口6中输入网络设备的标识IP1。管理设备从第二界面中读取第一标识信息abc、恢复标识信息B和网络设备的标识IP1,基于读取的信息生成的恢复报文可以表示为:“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=B”,向该网络设备发送该恢复报文。
步骤105:网络设备接收该恢复报文,从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,根据该操作对象和操作类型,将配置数据库由第一状态恢复成第二状态。
第二状态是在执行第一标识信息所标识的配置操作之前配置数据库处于的状态。
在本步骤中,网络设备从该恢复报文中提取第一标识信息和恢复标识信息,在该恢复标识信息的触发下,从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型;根据该操作对象和该操作类型,获取恢复信息,该恢复信息用于描述在对配置数据库中执行该配置操作的过程配置数据库中发生变化的内容,根据该恢复信息和该操作类型,将配置数据库由第一状态恢复成第二状态。
网络设备还从标识信息与计时器的对应关系中删除第一标识信息和第一标识信息对应的计时器。
可选的,在第一标识信息对应的操作类型为增加操作时,第一标识信息对应的操作对象为增加的配置信息,根据该操作对象和该增加操作,获取的恢复信息为增加的配置信息的标识,根据该增加的配置信息的标识从配置数据库中删除增加的配置信息,实现将配置数据库由第一状态恢复成第二状态。
例如,在步骤101中待执行的配置操作为增加操作的情况下,网络设备保存如表3所示的标识信息、操作类型与操作对象的对应关系,以及保存如表4所示的第一状态的配置数据库。网络设备从恢复报文“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=B”中,提取第一标识信息abc以及恢复标识信息B。在恢复标识信息B的触发下,从如表3所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为增加操盘create,该操作对象包括增加的配置信息的标识13,根据该标识192.168.10.3从如表4所示的第一状态的配置数据库中删除增加的配置信息,得到如表1所示的第二状态的配置数据库。
可选的,在第一标识信息对应的操作类型为删除操作时,第一标识信息对应的操作对象包括删除的配置信息的标识,根据该删除的配置信息的标识从恢复信息表中获取被删除的配置信息,将被删除的配置信息添加到配置数据库中,实现将配置数据库由第一状态恢复成第二状态。
例如,在步骤101中待执行的配置操作为删除操作的情况下,网络设备保存如表5所示的标识信息、操作类型与操作对象的对应关系,如表6所示的恢复信息表,以及保存如表7所示的第一状态的配置数据库。网络设备从恢复报文“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=B”中,提取第一标识信息abc以及恢复标识信息B。在恢复标识信息B的触发下,从如表5所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为删除操盘delete,该操作对象包括删除的配置信息的标识12,根据该标识12从如表6所示的恢复信息表中获取删除的配置信息,该删除的配置信息包括“12”和“192.168.10.2”,从如表7所示的第一状态的配置数据库中增加删除的配置信息,得到如表1所示的第二状态的配置数据库。
可选的,在第一标识信息对应的操作类型为修改操作时,第一标识信息对应的操作对象为被修改的配置信息的标识,根据该配置信息的标识从恢复信息表中获取该配置信息被修改前的第二内容,根据该配置信息的标识,将配置数据库中保存的该配置信息被修改后的第一内容更新为第二内容,实现将配置数据库由第一状态恢复成第二状态。
例如,在步骤101中待执行的配置操作为修改操作的情况下,网络设备保存如表8所示的标识信息、操作类型与操作对象的对应关系,如表9所示的恢复信息表,以及保存如表10所示的第一状态的配置数据库。网络设备从恢复报文“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=B”中,提取第一标识信息abc以及恢复标识信息B。在恢复标识信息B的触发下,从如表8所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为修改操作post,该操作对象包括被修改的配置信息的标识11,根据该标识11从如表9所示的恢复信息表中获取该配置信息被修改前的第二内容为“192.168.10.1”,在如表10所示的第一状态的配置数据库中,将该配置信息被修改后的第一内容“192.168.10.3”更新为第二内容“192.168.10.1”,得到如表1所示的第二状态的配置数据库。
由于对配置数据库进行恢复时,管理员只需要输入第一标识信息和恢复标识信息,就可以触发网络设备自动地将配置数据库由第一状态恢复成第二状态,从而提高了恢复的效率。
在该配置操作对应的试运行期间内,如果管理员或管理设备发现网络设备根据处于第一状态的配置数据库进行运行的运行状态正确,则可以对网络设备的配置数据库进行确认,以避免在该配置操作的试运行期间结束后,网络设备自动将配置数据库由第一状态恢复成第二状态。详细实现过程包括如下106至107的操作。
步骤106:管理设备向网络设备发送确认报文,该确认报文包括第一标识信息。
可选的,管理设备生成包括第一标识信息和确认标识信息的报文,该确认标识信息用于标识该报文的类型为确认报文。
管理设备在生成报文时,可以设置该报文中的第一参数的值为第一标识信息,以及设置该报文中的第二参数的值为该确认标识信息,如此实现生成包括第一标识信息和确认标识信息的报文。
管理员发现网络设备的运行状态正确,根据网络设备的运行状态可以确定出对网络设备的配置数据库执行的哪一次配置操作需要确认,向管理设备输入确认标识信息,用于标识该次配置操作的第一标识信息,以及网络设备的标识。生成包括该确认标识信息和第一标识信息的报文,即得到了确认报文,根据该网络设备的标识向该网络设备发送该确认报文。
可选的,确认标识信息为预设的信息,或为管理设备与网络设备事先约定的信息。
可选的,管理设备可以向管理员显示第三界面,管理员通过第三界面向管理设备输入第一标识信息和确认标识信息。
例如,参见图7所示的第三界面,第三界面包括用于输入第一标识信息的第一输入接口2,用于输入确认标识信息的第七输入接口8。管理员可以在第一输入接口2中输入第一标识信息abc,在第七输入接口8中输入确认标识信息C,以及在第五输入接口6中输入网络设备的标识IP1。管理设备从第三界面中读取第一标识信息abc和确认标识信息C,基于读取的信息生成的确认报文可以表示为:“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=C”,向该网络设备发送该确认报文。
步骤107:网络设备接收该确认报文,从标识信息、操作对象与操作类型的对应关系中删除包括第一标识信息的记录。
在本步骤中,网络设备接收到该确认报文,该确认报文包括确认标识信息和第一标识信息,在确认标识信息的触发下,停止对第一标识信息标识的配置操作进行计时,以及从标识信息、操作对象与操作类型的对应关系中删除包括第一标识信息的记录。
网络设备在删除包括第一标识信息的记录之前,还可以从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,该操作对象中包括配置信息的标识,在该操作类型为删除操作或修改操作的情况下,从恢复信息表中删除包括该配置信息的标识的配置信息。
其中,网络设备可以从计时器与标识信息的对应关系中删除第一标识信息和第一标识信息对应的计时器,实现停止对第一标识信息标识的配置操作进行计时。
例如,在步骤101中待执行的配置操作为增加操作的情况下,网络设备保存如表3所示的标识信息、操作类型与操作对象的对应关系。网络设备从确认报文 “http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=C”中,提取第一标识信息abc以及确认标识信息C。在确认标识信息C的触发下,从如表3所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为增加操作create,从如表3所示的标识信息、操作类型与操作对象的对应关系中删除包括第一标识信息abc的记录。
再如,在步骤101中待执行的配置操作为删除操作的情况下,网络设备保存如表5所示的标识信息、操作类型与操作对象的对应关系,以及如表6所示的恢复信息表。网络设备从确认报文“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=C”中,提取第一标识信息abc以及确认标识信息C。在确认标识信息C的触发下,从如表6所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为删除操作delete,该操作对象包括删除的配置信息的标识“12”,从如表6所示的恢复信息表中删除包括“12”的配置信息,从如表5所示的标识信息、操作类型与操作对象的对应关系中删除包括第一标识信息abc的记录。
再如,在步骤101中待执行的配置操作为修改操作的情况下,网络设备保存如表8所示的标识信息、操作类型与操作对象的对应关系,以及如表9所示的恢复信息表。网络设备从确认报文“http://{IP1}{Port}:/restconf/systemInfo?persist-id=abc&trial=C”中,提取第一标识信息abc以及确认标识信息C。在确认标识信息C的触发下,从如表8所示的标识信息、操作类型与操作对象的对应关系中获取第一标识信息abc对应的操作类型和操作对象,该操作类型为修改操作post,该操作对象包括被修改的配置信息的标识“11”,从如表9所示的恢复信息表中删除包括“11”的配置信息,从如表8所示的标识信息、操作类型与操作对象的对应关系中删除包括第一标识信息abc的记录。
可选的,如果在该配置操作的试运行期间内网络设备没有接收包括第一标识信息的恢复报文,也没有接收到包括第一标识信息的确认报文,则在该配置操作的试运行期间结束时,根据该配置操作对应的操作类型和操作对象,将配置数据库由第一状态恢复成第二状态。
由于在该配置操作的试运行期间内网络设备没有接收包括第一标识信息的恢复报文,也没有接收到包括第一标识信息的确认报文,则在该配置操作的试运行期间结束时,在标识信息与计时器的对应关系中仍保存有第一标识信息对应的计时器,该计时器计时的时长达到该时长阈值,并且该计时器触发网络设备。此时网络设备在该计时器的触发下,根据该计时器对应的第一标识信息,从标识信息、操作类型与操作对象的对应关系中获取该配置操作对应的操作类型和操作对象,然后将配置数据库由第一状态恢复成第二状态。其中,在该计时器为倒计时器,在此时该计时器溢出并触发网络设备。
网络设备将配置数据库由第一状态恢复成第二状态的详细实现过程可以参见上述步骤105中的相关内容,在此不再详细说明。
在本申请实施例中,网络设备接收管理设备发送的配置报文,配置报文包括试运行标识、第一标识信息、待执行的配置操作的操作类型和操作对象,在执行该配置操作之前网络设备中的配置数据库处于第二状态;将第一标识信息、该操作对象和该操作类型对应保存到标识信息、操作对象与操作类型的对应关系,以及,根据该操作对象对网络设备的配置数据库执行该操作类型对应的配置操作,得到处于第一状态的配置数据库。在执行该配置操作后,在该配置操作对应的试运行期间内,根据第一状态的配置数据库运行。在该试 运行期间内发现第一状态的配置数据库有误,管理员只需要向管理设备输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,这样网络设备根据恢复报文中的第一标识信息,从标识信息、操作对象与操作类型的对应关系获取第一标识信息所标识的配置操作的操作类型和操作对象,根据该操作类型和操作对象恢复出第二状态的配置数据库,这样不需要编辑配置数据库中发生变化的内容,提高了恢复效率。
参见图8,本申请实施例提供了一种网络设备的管理方法,该方法可以应用于图1所示的网络架构中。在方法中,可以在网络设备中定义回退能力集,使网络设备具有回退功能。所谓回退功能是指当对网络设备的配置数据库执行完配置操作后,如果需要将网络设备,管理设备可以请求网络设备对该配置数据库中发生变化的内容进行恢复。该方法包括:
步骤201:管理设备向网络设备发送配置报文,该配置报文包括第一标识信息、待执行的配置操作的操作类型和操作对象。
第一标识信息用于标识待执行的配置操作。
可选的,管理设备向管理员显示第四界面,管理员通过第四界面向管理设备输入网络设备的标识,该配置操作的操作类型和操作对象,以及用于标识该配置操作的第一标识信息。然后,管理设备获取输入的网络设备的标识,第一标识信息,该配置操作的操作类型和操作对象,生成包括第一标识信息、该配置操作的操作类型和操作对象的配置报文,根据该网络设备的标识,向网络设备发送配置报文。
管理员向管理设备输入网络设备的标识、该配置操作的操作类型和操作对象,以及管理设备生成配置报文的详细实现过程可以参见上述步骤101中的相关内容,在此不再详细说明。
在本步骤中,在该配置报文中增加第一参数,设置第一参数的值等于第一标识信息,使得生成的配置报文包括第一标识信息。
例如,管理设备显示如图9所示的第四界面,第四界面包括用于选择操作类型的选择按钮1、用于输入第一标识信息的第一输入接口2、用于输入操作对象的第四输入接口5和用于输入网络设备的标识的第五输入接口6。选择按钮1可以为一个下拉按钮,选择按钮1中包括至少一个配置操作的操作类型,该至一个配置操作的操作类型包括post、creat和delete。
参见图9,假设管理员需要修改上述表1所示配置数据库中的第一条配置信息,第一条配置信息为网络流量1的路由信息,管理员需要将该路由信息中的下一跳信息由“11”修改为“192.168.10.3”。此时管理员选择待执行的配置操作的操作类型为修改操作post,在第一输入接口2中输入第一标识信息为abc,在第四输入接口5中输入操作对象,该操作对象包括待修改配置信息的标识“11”以及待修改配置信息的第一内容“192.168.10.3”,以及在第五输入接口6中输入网络设备的标识为IP1。
管理设备可以从图9所示的第四界面中读取该配置操作的操作类型post,第一标识信息abc,待修改配置信息的标识“11”,待修改配置信息的第一内容“192.168.10.3”,以及网络设备的标识为IP1。管理设备基于读取的信息生成的配置报文可以表示为:
post http://{IP1}{Port}:/restconf/systemInfo?conifig-id=abc&timeout=180
<routeInfo>
<Id info>11</Id info>(待修改配置信息的标识)
<Next hop>192.168.10.3</Next hop>(待修改配置信息的第一内容)
</routeInfo>
在配置报文中conifig-id为第一参数,网络设备再发送该配置报文。
步骤202:网络设备接收该配置报文,获取网络设备的配置数据库中的内容,得到第一配置信息,将第一标识信息和第一配置信息对应保存在标识信息与配置信息的对应关系中,以及根据该操作对象对配置数据库执行该操作类型对应的配置操作。
在本步骤中,网络设备接收该配置报文,对配置数据库中的内容进行复制得到该配置数据库中保存的第一配置信息,将第一标识信息和第一配置信息对应保存在标识信息与配置信息的对应关系中,以及根据该操作对象对配置数据库执行该操作类型对应的第一配置操作。
网络设备对该配置数据库执行该操作类型对应的第一配置操作的详细实现过程可以参见图2所示实施例中的步骤102中的相关内容。
接下来仍以步骤201中的例子对本步骤进行说明,网络设备接收如下配置报文:
post http://{IP1}{Port}:/restconf/systemInfo?conifig-id=abc&timeout=180
<routeInfo>
<Id info>11</Id info>
<Next hop>192.168.10.3</Next hop>
</routeInfo>
从该配置报文中提取操作类型为修改操作post,提取操作对象为待修改配置信息的标识“11”和第一内容为“192.168.10.3”,以及从该配置报文中提取第一参数conifig-id的值abc得到第一标识信息。对如表1所示的配置数据库进行复制,得到第一配置信息,将第一标识信息和第一配置信息对应保存到标识信息与配置信息的对应关系中。网络设备根据待修改配置信息的标识“11”,从如表1所示的配置数据库获取待修改配置信息,待修改配置信息包括待修改配置信息的标识“11”和第二内容“192.168.10.1”,然后,网络设备从上述表1所示的配置数据库中将待修改配置信息的第二内容“192.168.10.1”更新为第一内容“192.168.10.3”,得到的配置数据库如上述表9所示。
网络设备在对配置数据库执行完该配置操作后,网络设备根据该配置数据库进行运行。另外,如果管理员还继续需要对配置数据库执行配置操作,则管理员可以再向管理设备中输入网络设备的标识、该配置操作的操作类型和操作对象,以及用于标识该配置操作的标识信息,然后管理设备和网络设备再重新执行上述步骤201至202的操作。
有时管理员可能需要将网络设备的运行状态恢复到在执行某个配置操作之前的运行状态,此时需要将网络设备的配置数据库中保存的配置信息恢复到在执行该配置操作之前配置数据库保存的配置信息。其中,为了满足该需求,可以如下203至204的步骤来实现。
步骤203:管理设备向网络设备发送恢复报文,该恢复报文包括第一标识信息。
可选的,管理设备生成包括第一标识信息和回滚标识信息的报文,该回滚标识信息用于标识该报文的类型为恢复报文。
管理设备在生成报文时,可以设置该报文中的第一参数的值为第一标识信息,以及在该报文中添加回滚标识信息,如此实现生成包括第一标识信息和回滚标识信息的报文。
可选的,回滚标识信息为预设的信息,或为管理设备与网络设备事先约定的信息。
可选的,管理设备可以向管理员显示第五界面,管理员通过第五界面向管理设备输入 第一标识信息和回滚标识信息。
例如,参见图10所示的第五界面,第五界面包括用于输入第一标识信息的第一输入接口2、用于输入网络设备的标识的第四输入接口5、回滚标识信息“rollback”和用于供用户确认是否输入回滚标识信息的第八输入接口9。管理员确认输入回滚标识信息时,可以在第八输入接口9选择输入回滚标识信息(例如输入value,该value用于表示管理员选择输入回滚标识信息),以及在第一输入接口2中输入第一标识信息abc、在第四输入接口5中输入网络设备的标识IP1。管理设备从第二界面中读取第一标识信息abc、回滚标识信息“rollback”和网络设备的标识IP1,基于读取的信息生成的恢复报文可以表示为:“http://{IP1}{Port}:/restconf/systemInfo?conifig-id=abc&rollback”,向该网络设备发送该恢复报文。
步骤204:网络设备接收该恢复报文,从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息,将配置数据库的内容更新为第一配置信息。
在本步骤中,网络设备从该恢复报文中提取第一参数的值得到第一标识信息,以从该恢复报文中提取回滚标识信息,在该回滚标识信息的触发,从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息,将配置数据库的内容更新为第一配置信息。
例如,网络设备从该恢复报文“http://{IP1}{Port}:/restconf/systemInfo?conifig-id=abc&rollback”中提取第一参数conifig-id的值abc得到第一标识信息,以从该恢复报文中提取回滚标识信息“rollback”,在该回滚标识信息“rollback”的触发下,从标识信息与配置信息的对应关系中获取第一标识信息abc对应的第一配置信息,第一标识信息abc对应的第一配置信息为表1所示的配置数据库中保存的配置信息,将表9所示的配置数据库的内容更新为第一配置信息,得到表1所示的配置数据库,从而实现恢复出在执行第一标识信息abc所标识的配置操作之前的配置数据库。
在本申请实施例中,网络设备接收管理设备发送的配置报文,该配置报文包括第一标识信息、待执行的配置操作的操作类型和操作对象;获取配置数据库中的内容,得到第一配置信息;将第一标识信息和第一配置信息对应保存在所述标识信息与配置信息的对应关系中,然后再根据该操作对象对配置数据库执行所述操作类型应的该配置操作。管理员需要恢复出执行该配置操作前的配置数据库时,管理员只需要向管理设备输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,这样网络设备根据恢复报文中的第一标识信息,从标识信息与配置信息的对应关系获取第一标识信息对应的第一配置信息,将配置数据库更新为第一配置信息,这样不需要编辑配置数据库中发生变化的内容,提高了恢复效率。
参见图11,本申请实施例提供了一种网络设备的管理装置300,所述装置300可以部署在上述图1或图2所述实施例的网络设备中,包括:
接收单元301,用于接收管理设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识已对网络设备的配置数据库执行的第一配置操作;
处理单元302,用于从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,该操作类型是第一配置操作的类型,该操作对象是第一配置操作所操作的对象;
处理单元302,还用于根据该操作对象和该操作类型,将配置数据库由第一状态恢复 成第二状态,第一状态是在执行第一配置操作之后配置数据库处于的状态,第二状态是在执行第一配置操作之前配置数据库处于的状态。
可选的,处理单元302将配置数据库由第一状态恢复成第二状态的详细实现过程,可以参见图2所示实施例的步骤105中的相关内容。
可选的,接收单元301,还用于接收所述管理设备发送的配置报文,配置报文包括第一标识信息、第一配置操作的操作类型和操作对象;
处理单元302,还用于将第一标识信息、该操作对象和该操作类型对应保存到标识信息、操作对象与操作类型的对应关系,以及,根据该操作对象对配置数据库执行该操作类型对应的第一配置操作。
可选的,处理单元302保存第一标识信息、该操作对象和该操作类型之间的对应关系,以及,对配置数据库执行第一配置操作的详细实现过程,可以参见图2所示实施例的步骤102中的相关内容。
可选的,接收单元301,还用于接收第一试运行请求,第一试运行请求包括第一标识信息;
处理单元302,用于在第一标识信息标识的第一配置操作对应的第一试运行期间内,根据第一状态的配置数据库进行运行,第一试运行期间的起始时间是执行第一配置操作的时间,第一试运行期间的时间长度等于时长阈值;在第一试运行期间内接收到恢复报文时,从第一标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作类型和操作对象。
可选的,处理单元302试运行第一状态的配置数据库的详细实现过程,可以参见图2所示实施例的步骤103中的相关内容。
可选的,接收单元301,还用于接收第二试运行请求,第二试运行请求包括第二标识信息,第二标识信息用于标识第二配置操作,第二配置操作是该装置300已对配置数据库执行的操作;
处理单元302,还用于在第二配置操作对应的第二试运行期间内,根据第三状态的配置数据库进行运行,第二试运行期间的起始时间是执行第二配置操作的时间,第二试运行期间的时间长度等于时长阈值,第三状态是在执行第二配置操作后配置数据库处于的状态;在第二试运行期间内接收单元301接收确认报文时,确认报文包括第二标识信息,从标识信息、操作对象与操作类型的对应关系中删除包括第二标识信息的记录。
可选的,接收单元301,还用于接收第三试运行请求,第三试运行请求包括第三标识信息,第三标识信息用于标识第三配置操作,第三配置操作是该装置300已对配置数据库执行的操作;
处理单元302,还用于在第三配置操作对应的第三试运行期间内,根据第四状态的配置数据库进行运行,第三试运行期间的起始时间是执行第三配置操作的时间,第三试运行期间的时间长度等于时长阈值,第四状态是在执行第三配置操作后配置数据库处于的状态;在第三试运行期间内接收单元301未接收到包括第三标识信息的报文时,则在第三试运行期间结束时根据第三配置操作对应的操作类型和操作对象,将配置数据库由第五状态恢复成第四状态,第五状态是在执行第三配置操作之后配置数据库处于的状态。
可选的,处理单元302,用于:
根据该操作对象获取恢复信息,恢复信息用于描述在对配置数据库中执行第一配置操 作的过程配置数据库中发生变化的内容;
根据该操作类型和该恢复信息,将该配置数据库由第一状态恢复成第二状态。
可选的,处理单元302获取恢复信息以及将配置数据库由第一状态恢复成第二状态的详细实现过程,可以参见图2所示实施例的步骤105中的相关内容。
可选的,恢复报文为包括恢复标识信息和第一标识信息的报文,恢复标识信息用于标识该报文的类型为恢复报文。
在本申请实施例中,接收单元接收管理设备发送的恢复报文,由于该恢复报文包括第一标识信息,第一标识信息用于标识已对网络设备的配置数据库执行的第一配置操作。处理单元从标识信息、操作对象与操作类型的对应关系中获取第一标识信息对应的操作对象和操作类型,该操作类型是第一配置操作的类型,该操作对象是第一配置操作所操作的对象。以及处理单元根据该操作对象和操作类型,将配置数据库由第一状态恢复成第二状态,第一状态是在执行第一配置操作之后配置数据库处于的状态,第二状态是在执行第一配置操作之前配置数据库处于的状态。这样在恢复配置数据库时,管理员只需要输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,处理单元根据第一标识信息自动地恢复出第二状态的配置数据库,提高了恢复配置数据的效率。
参见图12,本申请实施例提供了一种网络设备的管理装置400,所述装置400可以部署在上述图1或图8所述实施例的网络设备中,包括:
接收单元401,用于接收管理设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识第一配置信息,第一配置信息是在执行第一配置操作前网络设备的配置数据库中保存的配置信息,第一配置操作是该装置400已对配置数据库执行的操作;
处理单元402,用于从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息;将配置数据库的内容更新为第一配置信息。
可选的,处理单元402获取第一配置信息,以及将配置数据库的内容更新为第一配置信息的的详细实现过程,可以参见图8所示实施例的步骤204中的相关内容。
可选的,接收单元401,还用于接收管理设备发送的配置报文,配置报文包括第一标识信息、第一配置操作的操作类型和操作对象;
处理单元402,还用于获取配置数据库中的内容,得到第一配置信息;将第一标识信息和第一配置信息对应保存在标识信息与配置信息的对应关系中,以及,根据该操作对象对配置数据库执行该操作类型应的第一配置操作。
可选的,处理单元402保存第一标识信息和第一配置信息之间的对应关系,以及,对配置数据库执行第一配置操作的详细实现过程,可以参见图2所示实施例的步骤202中的相关内容。
在本申请实施例中,接收单元接收管理设备发送的恢复报文,恢复报文包括第一标识信息,第一标识信息用于标识第一配置信息,第一配置信息是在执行第一配置操作前网络设备的配置数据库中保存的配置信息,第一配置操作是网络设备已对配置数据库执行的操作。处理单元从标识信息与配置信息的对应关系中获取第一标识信息对应的第一配置信息。以及处理单元将配置数据库的内容更新为第一配置信息。这样在恢复出在执行第一配置操作前的配置数据库时,管理员只需要输入第一标识信息,管理设备向网络设备发送包括第一标识信息的恢复报文,处理单元根据第一标识信息自动地恢复出在执行第一配置操作前 的配置数据库,提高了恢复配置数据的效率。
参见图13,图13所示为本申请实施例提供的一种网络设备的管理装置500示意图。该装置500包括至少一个处理器501,总线系统502,存储器503以及至少一个收发器504。
该装置500是一种硬件结构的装置,可以用于实现图11所述的装置300中的功能模块或图12所述的装置400中的功能模块。例如,本领域技术人员可以想到图11所示的装置300中的处理单元302或图12所示的装置400中的处理单元402可以通过该至少一个处理器501调用存储器503中的代码来实现,图11所示的装置300中的接收单元301或图12所示的装置400中的接收单元401可以通过该收发器504来实现。
可选的,该装置500还可用于实现上述任一实施例中采集分析设备的功能。
可选的,上述处理器501可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统502可包括一通路,在上述组件之间传送信息。
上述收发器504,用于与其他设备或通信网络通信。
上述存储器503可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器503用于存储执行本申请方案的应用程序代码,并由处理器501来控制执行。处理器501用于执行存储器503中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器501可以包括一个或多个CPU,例如图13中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置500可以包括多个处理器,例如图13中的处理器501和处理器507。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请一个实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种网络设备的管理方法,其特征在于,所述方法包括:
    网络设备接收管理设备发送的恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识已对所述网络设备的配置数据库执行的第一配置操作;
    所述网络设备从标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作对象和操作类型,所述操作类型是所述第一配置操作的类型,所述操作对象是所述第一配置操作所操作的对象;
    所述网络设备根据所述操作对象和所述操作类型,将所述配置数据库由第一状态恢复成第二状态,所述第一状态是在执行所述第一配置操作之后所述配置数据库处于的状态,所述第二状态是在执行所述第一配置操作之前所述配置数据库处于的状态。
  2. 如权利要求1所述的方法,其特征在于,所述网络设备接收管理设备发送的恢复报文之前,还包括:
    所述网络设备接收所述管理设备发送的配置报文,所述配置报文包括第一标识信息、所述第一配置操作的操作类型和操作对象;
    所述网络设备将所述第一标识信息、所述操作对象和所述操作类型对应保存到所述标识信息、操作对象与操作类型的对应关系,以及,根据所述操作对象对所述配置数据库执行所述操作类型对应的所述第一配置操作。
  3. 如权利要求2所述的方法,其特征在于,所述根据所述操作对象对所述配置数据库执行所述操作类型对应的所述第一配置操作之前,还包括:
    所述网络设备接收第一试运行请求,所述第一试运行请求包括所述第一标识信息,在所述第一标识信息标识的第一配置操作对应的第一试运行期间内,根据所述第一状态的配置数据库进行运行,所述第一试运行期间的起始时间是执行所述第一配置操作的时间,所述第一试运行期间的时间长度等于时长阈值;
    所述网络设备从第一标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作类型和操作对象,包括:
    所述网络设备在所述第一试运行期间内接收到所述恢复报文时,从第一标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作类型和操作对象。
  4. 如权利要求1至3任一项所述的方法,其特征在于,所述方法还包括:
    所述网络设备接收第二试运行请求,所述第二试运行请求包括第二标识信息,所述第二标识信息用于标识第二配置操作,所述第二配置操作是所述网络设备已对所述配置数据库执行的操作;
    所述网络设备在所述第二配置操作对应的第二试运行期间内,根据第三状态的配置数据库进行运行,所述第二试运行期间的起始时间是执行所述第二配置操作的时间,所述第二试运行期间的时间长度等于时长阈值,所述第三状态是在执行所述第二配置操作后所述配置数据库处于的状态;
    所述网络设备在所述第二试运行期间内接收确认报文时,所述确认报文包括第二标识信息,从标识信息、操作对象与操作类型的对应关系中删除包括所述第二标识信息的记录。
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:
    所述网络设备接收第三试运行请求,所述第三试运行请求包括第三标识信息,所述第三标识信息用于标识第三配置操作,所述第三配置操作是所述网络设备已对所述配置数据库执行的操作;
    所述网络设备在所述第三配置操作对应的第三试运行期间内,根据第四状态的配置数据库进行运行,所述第三试运行期间的起始时间是执行所述第三配置操作的时间,所述第三试运行期间的时间长度等于时长阈值,所述第四状态是在执行所述第三配置操作后所述配置数据库处于的状态;
    所述网络设备在所述第三试运行期间内未接收到包括所述第三标识信息的报文时,则在所述第三试运行期间结束时根据所述第三配置操作对应的操作类型和操作对象,将所述配置数据库由第五状态恢复成所述第四状态,所述第五状态是在执行所述第三配置操作之后所述配置数据库处于的状态。
  6. 如权利要求1至5任一项所述的方法,其特征在于,所述网络设备根据所述操作对象和所述操作类型,将所述配置数据库由第一状态恢复成第二状态,包括:
    所述网络设备根据所述操作对象获取恢复信息,所述恢复信息用于描述在对所述配置数据库中执行所述第一配置操作的过程所述配置数据库中发生变化的内容;
    所述网络设备根据所述操作类型和所述恢复信息,将所述配置数据库由所述第一状态恢复成所述第二状态。
  7. 如权利要求1至6任一项所述的方法,其特征在于,所述恢复报文为包括恢复标识信息和所述第一标识信息的报文,所述恢复标识信息用于标识所述报文的类型为恢复报文。
  8. 一种网络设备的管理方法,其特征在于,所述方法包括:
    网络设备接收管理设备发送的恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识第一配置信息,所述第一配置信息是在执行第一配置操作前所述网络设备的配置数据库中保存的配置信息,所述第一配置操作是所述网络设备已对所述配置数据库执行的操作;
    所述网络设备从标识信息与配置信息的对应关系中获取所述第一标识信息对应的第一配置信息;
    所述网络设备将所述配置数据库的内容更新为所述第一配置信息。
  9. 如权利要求8所述的方法,其特征在于,所述网络设备接收管理设备发送的恢复报文之前,还包括:
    所述网络设备接收所述管理设备发送的配置报文,所述配置报文包括第一标识信息、所述第一配置操作的操作类型和操作对象;
    所述网络设备获取所述配置数据库中的内容,得到所述第一配置信息;
    所述网络设备将所述第一标识信息和所述第一配置信息对应保存在所述标识信息与 配置信息的对应关系中,以及,根据所述操作对象对所述配置数据库执行所述操作类型应的第一配置操作。
  10. 一种网络设备的管理装置,其特征在于,所述装置包括:
    接收单元,用于接收管理设备发送的恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识已对所述网络设备的配置数据库执行的第一配置操作;
    处理单元,用于从标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作对象和操作类型,所述操作类型是所述第一配置操作的类型,所述操作对象是所述第一配置操作所操作的对象;
    所述处理单元,还用于根据所述操作对象和所述操作类型,将所述配置数据库由第一状态恢复成第二状态,所述第一状态是在执行所述第一配置操作之后所述配置数据库处于的状态,所述第二状态是在执行所述第一配置操作之前所述配置数据库处于的状态。
  11. 如权利要求10所述的装置,其特征在于,
    所述接收单元,还用于接收所述管理设备发送的配置报文,所述配置报文包括第一标识信息、所述第一配置操作的操作类型和操作对象;
    所述处理单元,还用于将所述第一标识信息、所述操作对象和所述操作类型对应保存到所述标识信息、操作对象与操作类型的对应关系,以及,根据所述操作对象对所述配置数据库执行所述操作类型对应的所述第一配置操作。
  12. 如权利要求11所述的装置,其特征在于,
    所述接收单元,还用于接收第一试运行请求,所述第一试运行请求包括所述第一标识信息;
    所述处理单元,用于在所述第一标识信息标识的第一配置操作对应的第一试运行期间内,根据所述第一状态的配置数据库进行运行,所述第一试运行期间的起始时间是执行所述第一配置操作的时间,所述第一试运行期间的时间长度等于时长阈值;在所述第一试运行期间内所述接收单元接收到所述恢复报文时,从第一标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作类型和操作对象。
  13. 如权利要求10至12任一项所述的装置,其特征在于,
    所述接收单元,还用于接收第二试运行请求,所述第二试运行请求包括第二标识信息,所述第二标识信息用于标识第二配置操作,所述第二配置操作是所述装置已对所述配置数据库执行的操作;
    所述处理单元,还用于在所述第二配置操作对应的第二试运行期间内,根据第三状态的配置数据库进行运行,所述第二试运行期间的起始时间是执行所述第二配置操作的时间,所述第二试运行期间的时间长度等于时长阈值,所述第三状态是在执行所述第二配置操作后所述配置数据库处于的状态;在所述第二试运行期间内所述接收单元接收确认报文时,所述确认报文包括第二标识信息,从标识信息、操作对象与操作类型的对应关系中删除包括所述第二标识信息的记录。
  14. 如权利要求10至13任一项所述的装置,其特征在于,
    所述接收单元,还用于接收第三试运行请求,所述第三试运行请求包括第三标识信息,所述第三标识信息用于标识第三配置操作,所述第三配置操作是所述装置已对所述配置数据库执行的操作;
    所述处理单元,还用于在所述第三配置操作对应的第三试运行期间内,根据第四状态的配置数据库进行运行,所述第三试运行期间的起始时间是执行所述第三配置操作的时间,所述第三试运行期间的时间长度等于时长阈值,所述第四状态是在执行所述第三配置操作后所述配置数据库处于的状态;在所述第三试运行期间内所述接收单元未接收到包括所述第三标识信息的报文时,则在所述第三试运行期间结束时根据所述第三配置操作对应的操作类型和操作对象,将所述配置数据库由第五状态恢复成所述第四状态,所述第五状态是在执行所述第三配置操作之后所述配置数据库处于的状态。
  15. 如权利要求10至14任一项所述的装置,其特征在于,所述处理单元,用于:
    根据所述操作对象获取恢复信息,所述恢复信息用于描述在对所述配置数据库中执行所述第一配置操作的过程所述配置数据库中发生变化的内容;
    根据所述操作类型和所述恢复信息,将所述配置数据库由所述第一状态恢复成所述第二状态。
  16. 如权利要求10至15任一项所述的装置,其特征在于,所述恢复报文为包括恢复标识信息和所述第一标识信息的报文,所述恢复标识信息用于标识所述报文的类型为恢复报文。
  17. 一种网络设备的管理装置,其特征在于,所述装置包括:
    接收单元,用于接收管理设备发送的恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识第一配置信息,所述第一配置信息是在执行第一配置操作前所述网络设备的配置数据库中保存的配置信息,所述第一配置操作是所述装置已对所述配置数据库执行的操作;
    处理单元,用于从标识信息与配置信息的对应关系中获取所述第一标识信息对应的第一配置信息;将所述配置数据库的内容更新为所述第一配置信息。
  18. 如权利要求17所述的装置,其特征在于,
    所述接收单元,还用于接收所述管理设备发送的配置报文,所述配置报文包括第一标识信息、所述第一配置操作的操作类型和操作对象;
    所述处理单元,还用于获取所述配置数据库中的内容,得到所述第一配置信息;将所述第一标识信息和所述第一配置信息对应保存在所述标识信息与配置信息的对应关系中,以及,根据所述操作对象对所述配置数据库执行所述操作类型应的第一配置操作。
  19. 一种网络设备的管理系统,其特征在于,所述系统包括管理设备和网络设备,
    所述管理设备,用于向所述网络设备发送恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识已对所述网络设备的配置数据库执行的第一配置操作;
    所述网络设备,用于从标识信息、操作对象与操作类型的对应关系中获取所述第一标识信息对应的操作对象和操作类型,所述操作类型是所述第一配置操作的类型,所述操作对象是所述第一配置操作所操作的对象;根据所述操作对象和所述操作类型,将所述配置数据库由第一状态恢复成第二状态,所述第一状态是在执行所述第一配置操作之后所述配置数据库处于的状态,所述第二状态是在执行所述第一配置操作之前所述配置数据库处于的状态。
  20. 一种网络设备的管理系统,其特征在于,所述系统包括:管理设备和网络设备;
    所述管理设备,用于向所述网络设备发送的恢复报文,所述恢复报文包括第一标识信息,所述第一标识信息用于标识第一配置信息,所述第一配置信息是在执行第一配置操作前所述网络设备的配置数据库中保存的配置信息,所述第一配置操作是所述网络设备已对所述配置数据库执行的操作;
    所述网络设备,用于从标识信息与配置信息的对应关系中获取所述第一标识信息对应的第一配置信息;将所述配置数据库的内容更新为所述第一配置信息。
PCT/CN2020/116938 2019-10-21 2020-09-22 网络设备的管理方法、装置及系统 WO2021077967A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911002749.9 2019-10-21
CN201911002749.9A CN112769585B (zh) 2019-10-21 2019-10-21 网络设备的管理方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2021077967A1 true WO2021077967A1 (zh) 2021-04-29

Family

ID=75620382

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116938 WO2021077967A1 (zh) 2019-10-21 2020-09-22 网络设备的管理方法、装置及系统

Country Status (2)

Country Link
CN (1) CN112769585B (zh)
WO (1) WO2021077967A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122924A (zh) * 2007-09-30 2008-02-13 华为技术有限公司 逻辑日志生成方法、数据库备份/恢复方法与系统
CN101694637A (zh) * 2009-11-06 2010-04-14 金蝶软件(中国)有限公司 一种数据库恢复的方法和系统
CN101136783B (zh) * 2007-10-15 2010-06-02 中兴通讯股份有限公司 一种网管系统配置数据的备份、恢复方法及装置
US20140250085A1 (en) * 2013-03-01 2014-09-04 Unisys Corporation Rollback counters for step records of a database
CN110347659A (zh) * 2019-06-13 2019-10-18 阿里巴巴集团控股有限公司 数据处理方法和装置、交易数据处理方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7539769B2 (en) * 2001-04-30 2009-05-26 Hewlett-Packard Development Company Automated deployment and management of network devices
CN101547122B (zh) * 2009-04-27 2011-11-23 华为终端有限公司 恢复终端配置的方法、装置及系统
CN104125089A (zh) * 2013-04-28 2014-10-29 华为技术有限公司 网络事务控制方法及执行方法及网络控制器及转发设备
CN103973487B (zh) * 2014-04-29 2018-07-24 上海上讯信息技术股份有限公司 一种基于交互式脚本的配置备份系统及配置管理方法
CN104104547B (zh) * 2014-07-24 2018-11-30 华为技术有限公司 一种网络设备配置文件的管理方法及网络控制器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122924A (zh) * 2007-09-30 2008-02-13 华为技术有限公司 逻辑日志生成方法、数据库备份/恢复方法与系统
CN101136783B (zh) * 2007-10-15 2010-06-02 中兴通讯股份有限公司 一种网管系统配置数据的备份、恢复方法及装置
CN101694637A (zh) * 2009-11-06 2010-04-14 金蝶软件(中国)有限公司 一种数据库恢复的方法和系统
US20140250085A1 (en) * 2013-03-01 2014-09-04 Unisys Corporation Rollback counters for step records of a database
CN110347659A (zh) * 2019-06-13 2019-10-18 阿里巴巴集团控股有限公司 数据处理方法和装置、交易数据处理方法和装置

Also Published As

Publication number Publication date
CN112769585B (zh) 2022-12-30
CN112769585A (zh) 2021-05-07

Similar Documents

Publication Publication Date Title
WO2022033121A1 (zh) 一种kubernetes中资源暴露方法、系统、设备以及介质
WO2017092348A1 (zh) 一种键值对数据库中的客户端配置更新方法、设备及系统
CN106506490B (zh) 一种分布式计算控制方法以及分布式计算系统
WO2020238891A1 (zh) 物理主机的租赁方法、装置、云平台及可读存储介质
US8923114B2 (en) Start-up delay for event-driven virtual link aggregation
WO2020232887A1 (zh) 容器应用的配置修改方法、装置、计算机设备及存储介质
WO2021136233A1 (zh) 业务升级的方法、装置和系统
CN106302638B (zh) 一种数据管理方法、转发设备及系统
CN111752488B (zh) 存储集群的管理方法、装置、管理节点及存储介质
US20210274020A1 (en) Communication method, client device, and server device
WO2024103716A1 (zh) 一种链路中子网管理的方法、装置、设备及可读介质
WO2021077967A1 (zh) 网络设备的管理方法、装置及系统
WO2024036990A1 (zh) 数据恢复的方法、装置、网络设备及存储介质
WO2018107838A1 (zh) 应用实体创建资源和注册方法、通信节点设备及终端设备
CN109787835B (zh) 一种会话备份方法及装置
CN110603798B (zh) 一种提供具有高可用性的弹性一致性平台的系统和方法
WO2019178839A1 (zh) 为分布式应用创建一致性快照的方法、装置和分布式系统
US10904746B2 (en) Implementation method, apparatus and system for remote access
CN108206823B (zh) 一种处理报文的方法、系统及网络设备
CN114356357A (zh) 镜像文件处理方法、装置和电子设备
JP4639112B2 (ja) リモートコピートポロジチェック方法
WO2020220986A1 (zh) 一种报文处理方法、装置及设备
Cisco 9.0.03 Version Software Release Notes Cisco StrataView Plus for AIX
WO2013127369A1 (zh) 一种微博客户端信息的通知方法及装置
CN108279994B (zh) 一种连接Citrix已发布应用异常的自动化解决方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20879199

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20879199

Country of ref document: EP

Kind code of ref document: A1