CN109361553B - Configuration rollback method and device - Google Patents

Configuration rollback method and device Download PDF

Info

Publication number
CN109361553B
CN109361553B CN201811454743.0A CN201811454743A CN109361553B CN 109361553 B CN109361553 B CN 109361553B CN 201811454743 A CN201811454743 A CN 201811454743A CN 109361553 B CN109361553 B CN 109361553B
Authority
CN
China
Prior art keywords
configuration
rollback
data
session
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811454743.0A
Other languages
Chinese (zh)
Other versions
CN109361553A (en
Inventor
李佳璇
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
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 New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN201811454743.0A priority Critical patent/CN109361553B/en
Publication of CN109361553A publication Critical patent/CN109361553A/en
Application granted granted Critical
Publication of CN109361553B publication Critical patent/CN109361553B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • 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/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0859Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The present disclosure provides a configuration rollback method and device, relating to the technical field of communication, wherein the method comprises the following steps: the method comprises the steps of obtaining rollback data from a configuration rollback database corresponding to a configuration session, wherein the configuration session comprises configuration instructions, the configuration instructions are used for updating the configuration data, the configuration rollback database is used for storing rollback data corresponding to the configuration session, head deletion processing is conducted on the rollback data to obtain rollback sub-data, and the configuration data is restored according to the rollback sub-data and the receiving time of the configuration instructions corresponding to the rollback sub-data. By acquiring rollback data corresponding to the configuration instruction triggering the rollback condition from different configuration databases corresponding to different configuration sessions and recovering the configuration data in the network device according to the acquired rollback data, the situation that the configuration data configured for each configuration session is recovered is avoided, the time spent on configuration rollback is reduced, and the efficiency of configuring the network device is improved.

Description

Configuration rollback method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a configuration rollback method and apparatus.
Background
NETCONF (Network Configuration Protocol) is a Network management Protocol based on XML, and provides a programmable method for configuring and managing Network devices, and a user can log in NETCONF in various ways and configure the Network devices after logging in.
In the related art, a plurality of users may log in NETCONF, each user may configure a network device, a module in the network device, or an entry in the module in a session manner, and a temporary configuration database may store corresponding configuration rollback data according to a plurality of sessions. When a certain user triggers configuration rollback in the configuration process, the network device can recover the network device configured by the session corresponding to the user according to the configuration rollback data, and recover the network device configured by the session corresponding to other users.
However, if the table entry in the network device, the module in the network device, or the module configured by a certain user is different from the table entries in the network devices, the modules in the network devices, or the modules configured by other users, the table entries in the network devices, the modules in the network devices, or the modules configured by other users still can be recovered, so that other users need to perform configuration again, which causes a problem of low efficiency in configuring the network devices.
Disclosure of Invention
The present disclosure is directed to provide a configuration rollback method and apparatus for overcoming the above-mentioned shortcomings in the prior art.
One of the objects of the present disclosure provides a configuration rollback method, the method comprising:
obtaining rollback data from a configuration rollback database corresponding to a configuration session, wherein the configuration session comprises a configuration instruction, and the configuration instruction is used for updating the configuration data, and the configuration rollback database is used for storing rollback data corresponding to the configuration session;
performing header deletion processing on the rollback data to obtain rollback sub data;
and restoring the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data.
Further, before the obtaining rollback data from the configuration rollback database corresponding to the configuration session, the method further includes:
receiving a configuration session sent by a terminal, wherein the configuration session is generated by the terminal according to an operation triggered by a user;
updating the configuration data according to the configuration instruction in the configuration session;
the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
and if the configuration instruction triggers a rollback condition, acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
Further, the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
acquiring a function identifier in the configuration instruction, wherein the function identifier is used for indicating whether a lightweight configuration rollback function is started or not;
if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction;
adding the rollback data into a configuration rollback database corresponding to the configuration session;
and acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
Further, the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
judging whether the configuration session and other sessions meet a cross condition;
if the configuration session and the other sessions meet the crossing condition, storing configuration instructions included in the other sessions;
acquiring the rollback data from a configuration rollback database corresponding to the configuration session;
or, if the configuration session and the other session do not satisfy the crossing condition, obtaining the rollback data from a configuration rollback database corresponding to the configuration session, where the configuration instructions included in the other session are not stored.
Further, after the restoring the configuration data according to the rollback sub-data, the method further includes:
and updating the recovered configuration data according to the configuration instructions included in the other sessions.
Another object of the present disclosure is to provide a configuration rollback apparatus, comprising:
an obtaining module, configured to obtain rollback data from a configuration rollback database corresponding to a configuration session, where the configuration session includes a configuration instruction, and the configuration instruction is used to update configuration data, and the configuration rollback database is used to store rollback data corresponding to the configuration session;
the processing module is used for carrying out header deletion processing on the rollback data to obtain rollback sub data;
and the recovery module is used for recovering the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data.
Further, the apparatus further comprises:
the terminal comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a configuration session sent by the terminal, and the configuration session is generated by the terminal according to an operation triggered by a user;
the first updating module is used for updating the configuration data according to the configuration instruction in the configuration session;
the obtaining module is specifically configured to obtain the rollback data from a configuration rollback database corresponding to the configuration session if the configuration instruction triggers a rollback condition.
Further, the obtaining module is specifically configured to obtain a function identifier in the configuration instruction, where the function identifier is used to indicate whether a lightweight configuration rollback function is started; if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction; adding the rollback data into a configuration rollback database corresponding to the configuration session; and acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
Further, the obtaining module is specifically configured to determine whether the configuration session and the other sessions meet a crossing condition; if the configuration session and the other sessions meet the crossing condition, storing configuration instructions included in the other sessions; acquiring the rollback data from a configuration rollback database corresponding to the configuration session; or, if the configuration session and the other session do not satisfy the crossing condition, obtaining the rollback data from a configuration rollback database corresponding to the configuration session, where the configuration instructions included in the other session are not stored.
Further, the apparatus further comprises:
and the second updating module is used for updating the recovered configuration data according to the configuration instructions included in the other sessions.
The beneficial effects of this disclosure are:
according to the configuration rollback method and the configuration rollback device provided by the embodiment of the disclosure, rollback data is obtained from the configuration rollback database corresponding to the configuration session, header deletion processing is performed on the rollback data to obtain rollback sub-data, and finally, according to the receiving time of the configuration instruction corresponding to the rollback sub-data, the configuration data is restored according to the rollback sub-data. By acquiring rollback data corresponding to the configuration instruction triggering the rollback condition from different configuration databases corresponding to different configuration sessions and recovering the configuration data in the network device according to the acquired rollback data, the situation that the configuration data configured for each configuration session is recovered is avoided, the time spent on configuration rollback is reduced, and the efficiency of configuring the network device is improved.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present disclosure and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings may be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram of a network structure involved in a configuration rollback method provided by the present disclosure;
fig. 2 is a schematic flowchart of a configuration rollback method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a configuration rollback method according to another embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a configuration rollback method according to another embodiment of the present disclosure;
fig. 5 is a schematic diagram of a configuration rollback apparatus provided in an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a configuration rollback apparatus provided in another embodiment of the present disclosure;
fig. 7 is a schematic diagram of a configuration rollback apparatus provided in a further embodiment of the present disclosure;
fig. 8 is a schematic diagram of a configuration rollback apparatus provided in an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure.
Fig. 1 is a schematic diagram of a network structure involved in a configuration rollback method provided by the present disclosure; as shown in fig. 1, the network structure involved in the configuration rollback method may include: a network device 101 and a terminal 102.
The network device 101 and the terminal 102 are connected by a link.
Specifically, the terminal 102 may obtain a configuration instruction input by each user according to an input operation triggered by each user, so as to form a configuration session corresponding to a plurality of users according to the plurality of configuration instructions, and send the plurality of configuration sessions to the network device 101, so as to configure each module and entry of the network device 101.
Accordingly, the network device 101 may receive each configuration session sent by the terminal 102, and configure the configuration data of the network device according to each configuration instruction in each configuration session, so as to update the configuration data.
After updating the configuration data according to each configuration instruction, the network device 101 may determine whether each configuration instruction triggers a rollback condition according to a preset rollback condition. If the network device 101 updates the configuration data according to a certain configuration instruction, the updated configuration data triggers a rollback condition, that is, the configuration instruction triggers the rollback condition, the network device 101 may obtain corresponding rollback data according to the configuration rollback database corresponding to the configuration session to which the configuration instruction belongs, so as to recover the configuration data configured by the configuration instruction according to the rollback data, and further recover only the configuration data corresponding to the configuration session to which the configuration instruction belongs, thereby avoiding a situation of recovering the configuration data corresponding to each configuration session.
It should be noted that, if a plurality of configuration sessions configure the same module or modules associated with each other in the network device 101, if a configuration instruction in any one of the configuration sessions triggers a corresponding rollback condition, the network device 101 needs to store the configuration instructions in the other configuration sessions, and after the configuration rollback of the network device 101 is completed, the configuration data after the rollback can be configured again according to the stored configuration instructions of the other configuration sessions, so that the reconfiguration of the configuration data in the network device 101 is completed quickly.
In addition, in practical applications, the module or the entry of the network device 101 in the embodiment of the present disclosure may be an application for implementing different functions, an application for assisting the network device 101 to run, or other types of applications, which is not limited in the embodiment of the present disclosure.
Fig. 2 is a schematic flowchart of a configuration rollback method according to an embodiment of the present disclosure, which is applied to the network device shown in fig. 1, and the method may include:
step 201, obtaining rollback data from a configuration rollback database corresponding to the configuration session.
The configuration session may include configuration instructions for updating configuration data. For example, a plurality of configuration instructions may be included in a configuration session, each configuration instruction being used to update configuration data. Correspondingly, the configuration rollback database is used for storing the rollback data corresponding to the configuration session.
In the process of configuring the network device by the terminal, if the configuration data configured by the network device according to any one of the configuration instructions in the configuration session triggers the rollback condition, it may be determined that the configuration instruction triggers the rollback condition and the configuration data of the network device needs to be rolled back, that is, the configuration data of the network device is restored to the state before configuration.
Therefore, before rolling back the configuration data of the network device, the network device needs to acquire the roll back data generated according to the configuration instruction, so that in the subsequent step, the configuration data of the network device can be recovered according to the roll back data.
Specifically, the network device may determine, according to a configuration session to which a configuration instruction triggering a rollback condition belongs, a configuration database corresponding to the configuration session, and acquire pre-generated and stored rollback data from the configuration database.
The rollback data is generated according to each configuration instruction in the configuration session sent by the terminal. Moreover, the rollback data may be generated in a linked list form in a plug-in manner according to each configuration instruction in the configuration session, or may be generated in other manners.
It should be noted that, in the process of configuring the network device, if an edge-configuration (configuration editing) instruction included in the configuration session indicates that a configuration error occurs, a rolling-on-error (configuration rollback) operation is executed, and if a rollback condition is triggered by configuration data configured according to the configuration instruction, that is, a configuration error occurs, the network device may obtain rollback data from a configuration database corresponding to the configuration session, and complete recovery of the configuration data.
Step 202, performing header deletion processing on the rollback data to obtain the rollback data.
The rollback sub-data is used for recovering configuration data of the network device.
After the network device obtains the rollback data, the network device needs to process the obtained rollback data to obtain rollback sub-data, so that the network device can recover the configuration data according to the obtained rollback sub-data.
The rollback data is stored in a linked list form in a head-on method, that is, the header of the rollback data is the data corresponding to the configuration instruction that is finally sent. Therefore, the network device may process the rollback data in a header deletion manner, and obtain information corresponding to each node in the rollback data, thereby obtaining a plurality of rollback sub-data.
It should be noted that, the configuration instructions may include configuration instructions for modifying the configuration data and configuration instructions for creating the configuration data. Therefore, the rollback sub-data obtained by the network device may correspond to different configuration instructions, and the network device may perform different operations according to the different rollback sub-data corresponding to the different configuration instructions.
For example, when the configuration instruction is used to modify the configuration data, the rollback sub-data corresponding to the configuration instruction may instruct the network device to modify the configuration data, so that the modified configuration data is consistent with the configuration data before the configuration instruction is executed. However, if the configuration instruction is used to add new configuration data, the rollback sub-data corresponding to the configuration instruction may instruct the network device to delete the configuration data added according to the configuration instruction.
And step 203, restoring the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data.
After the network device obtains the rollback sub-data, the network device may sort the rollback sub-data according to the receiving time of the configuration instruction corresponding to the received rollback sub-data and the reverse order of the receiving time, so as to recover the configuration data of the network device according to the sorted rollback sub-data, so that the configuration data of the network device is recovered to the state before the configuration session is received.
Specifically, the network device may first determine a configuration instruction corresponding to each rollback sub-data, search for a receiving time corresponding to each configuration instruction, rank the rollback sub-data corresponding to each configuration instruction according to the receiving time corresponding to each configuration instruction and according to a reverse order of the receiving times, that is, rank each rollback sub-data according to a sequence from back to front, and finally restore the configuration data according to different rollback sub-data according to the ranked sequence.
The network device may restore the configuration data according to one rollback sub-data in the process of restoring the configuration data according to each rollback sub-data, and may obtain the next rollback sub-data after the restoration is completed, thereby gradually restoring the configuration data.
For example, the network device performs an adding operation on the configuration data according to the first configuration instruction, and then performs a modifying operation on the configuration data according to the second configuration instruction, so that in the configuration rollback process, the network device may replace the modified configuration data according to rollback sub data corresponding to the second configuration instruction, and replace the modified configuration data with the configuration data before modification; the network device may further obtain rollback sub-data corresponding to the first configuration instruction, and delete data added according to the first configuration instruction in the configuration data according to the rollback sub-data, so that the configuration data of the network device is restored to a state before the configuration instruction is received.
To sum up, in the configuration rollback method provided in the embodiment of the present disclosure, the rollback data is obtained from the configuration rollback database corresponding to the configuration session, the header deletion processing is performed on the rollback data, so as to obtain the rollback sub-data, and finally, the configuration data is restored according to the receiving time to which the configuration instruction corresponding to the rollback sub-data belongs. By acquiring rollback data corresponding to the configuration instruction triggering the rollback condition from different configuration databases corresponding to different configuration sessions and recovering the configuration data in the network device according to the acquired rollback data, the situation that the configuration data configured for each configuration session is recovered is avoided, the time spent on configuration rollback is reduced, and the efficiency of configuring the network device is improved.
Fig. 3 is a flowchart of a configuration rollback method according to another embodiment of the present disclosure, which is applied to the network device shown in fig. 1, and the method may include:
step 301, receiving a configuration session sent by a terminal.
The configuration session is generated by the terminal according to an operation triggered by a user, and the configuration session may include a configuration instruction, where the configuration instruction is used to update configuration data.
In the process of configuring the network device, a plurality of users may establish a plurality of configuration sessions on the terminal, and the terminal may generate different configuration instructions in different configuration sessions according to information input by the users, thereby sending different configuration sessions including different configuration instructions to the network device.
Accordingly, the network device may receive each configuration session sent by the terminal, so that in the subsequent step, the network device may perform configuration update on the configuration data of the network device according to the configuration instruction in each configuration session.
Specifically, the terminal may receive an operation triggered by each user, establish a different configuration session according to the operation triggered by each user, and receive, in an interface of each session, a configuration instruction input by the user, so as to send the configuration session including each configuration instruction to the network device, and then the network device may receive each configuration session sent by the terminal.
Step 302, acquiring a function identifier in the configuration instruction.
The function identifier is used to indicate whether the lightweight configuration rollback function is turned on, and the function identifier may be boolean (boolean) data or other types of data, which is not limited in this embodiment of the disclosure.
After receiving each configuration instruction in the configuration session, the network device may perform configuration update on the configuration data of the network device according to each configuration instruction. However, after the network device configures the configuration data according to the configuration instruction, a rollback condition may be triggered, which may cause the configuration data to be rolled back.
In the process of rollback of the configuration data, the configuration data needs to be restored according to the rollback data generated in advance. Therefore, after acquiring the configuration instruction of the configuration session, the network device needs to acquire the function identifier in the configuration instruction from the specified field in the configuration instruction, so that in the subsequent step, it can be determined whether rollback data needs to be generated according to the function identifier.
For example, the function identifier may take a value of true or false, and when the function identifier takes a value of true, it indicates that the lightweight configuration rollback function is started, and in the configuration rollback process, only rollback is performed on each configuration instruction in the configuration session to which the configuration instruction belongs, and rollback data corresponding to the configuration instruction needs to be generated, and the generated rollback data is added to the configuration rollback database corresponding to the configuration session; however, if the function identifier takes a value of false, which indicates that the lightweight configuration rollback function is not started, the configuration instructions in each configuration session need to be rolled back in the configuration rollback process.
And 303, if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction.
Corresponding to step 302, if the function identifier in a certain configuration instruction indicates that the lightweight configuration rollback function is turned on, the network device may generate rollback data according to the configuration instruction, so that in a subsequent step, the network device may add the generated rollback data to the configuration rollback database corresponding to the configuration session.
In practical application, a user may input a plurality of configuration instructions in a configuration session, and the network device may generate rollback data in a chain table form by using a plug-in method according to a sequence of executing each configuration instruction.
In addition, since the network device needs to generate the rollback data according to each configuration instruction, the network device may generate the rollback data corresponding to a certain configuration instruction after acquiring the configuration instruction, and then acquire the next configuration instruction, thereby continuing to generate the rollback data.
Of course, the network device may also receive a plurality of configuration instructions, and generate rollback data corresponding to each configuration instruction according to the sequence of receiving each configuration instruction.
Step 304, add the rollback data to the configuration rollback database corresponding to the configuration session.
Because the generated rollback data is stored in the configuration rollback database corresponding to the configuration session, after the network device generates the rollback data according to the configuration instruction, the generated rollback data may be stored in the configuration rollback database corresponding to the configuration session to which the configuration instruction belongs.
It should be noted that, because the rollback data may be generated by using a plug-in method, in the process of adding the rollback data to the rollback database, the rollback data in the rollback database may be continuously updated according to each configuration instruction in the configuration session, so as to generate the rollback data corresponding to each configuration instruction.
Step 305, updating the configuration data according to at least one configuration instruction.
For each configuration instruction, after the network device generates rollback data according to the configuration instruction, the configuration data of the network device can be updated according to the action indicated by the configuration instruction, so that the configuration data is updated according to each configuration instruction in the configuration session.
Corresponding to step 303, the network device may not only generate rollback data for each configuration instruction, but also perform different operations on the configuration data for each configuration instruction, thereby updating the configuration data. For example, the network device may perform operations such as adding, replacing, creating, or deleting on the configuration data according to the operation indicated by the configuration instruction, so as to configure the configuration data.
Therefore, the network device may update the configuration data according to a configuration instruction, after the update is completed, the network device needs to determine whether the updated configuration data triggers a rollback condition, and if not, the network device may update the configuration data according to the next configuration instruction; however, if the rollback condition is triggered, the network device needs to execute step 306 to perform configuration rollback on the configuration data.
After updating the configuration data according to any one configuration instruction, the network device needs to determine whether the updated configuration data triggers a rollback condition, that is, determine whether the configuration instruction triggers the rollback condition, so as to determine whether the rollback data needs to be acquired according to a determination result.
Specifically, the network device may first determine, according to an operation indicated by the configuration instruction, a manner in which the configuration data is updated, so as to select different determination conditions according to different configuration manners, and finally determine whether the configuration data updated according to the configuration instruction will trigger the rollback condition, that is, determine whether the configuration instruction will trigger the rollback condition.
For example, when the operation indicated by the configuration instruction is an add, replace, or create operation, the network device may determine whether the identifiers of two identical rules configured in an ACL (Access Control List ) module are different, and if the identifiers are different, it indicates that the configured configuration data triggers a rollback condition; the terminal can also judge whether the values configured by the strongly-related attribute columns in the ACL module conflict, and if the values conflict, the configured configuration data can trigger a rollback condition; the terminal can also judge whether the configured main board entering memory threshold meets a preset threshold value, so as to determine that the configured configuration data can trigger a rollback condition.
Further, when the operation indicated by the configuration instruction is a delete operation, the terminal may determine whether a specific value is specified for the parameter value of the attribute column, and if a specific value is specified, it may be determined that the configured configuration data triggers a rollback condition.
Therefore, after determining whether the configuration instruction triggers the rollback condition, the network device may perform different operation steps according to the determination result: if the configuration instruction does not trigger the rollback condition, the configuration data can be updated according to other configuration instructions; however, if the configuration instruction triggers a rollback condition, steps 306-308 may be performed.
It should be noted that, if the network device does not trigger the rollback condition after the configuration data is updated according to each configuration instruction in a certain configuration session, the network device may delete the rollback data corresponding to each configuration instruction in the configuration session, so as to avoid the network device from storing redundant data.
Step 306, if the configuration instruction triggers the rollback condition, obtaining rollback data from the temporary configuration rollback database corresponding to the configuration session.
Wherein the configuration session comprises at least one configuration instruction for updating configuration data.
If the lightweight configuration rollback function is started and the configuration instruction triggers the rollback condition, it may be determined that the network device needs to recover the configuration data. Therefore, the network device needs to obtain the rollback data from the configuration rollback database corresponding to the configuration session, so as to recover only the configuration data corresponding to the configuration session to which the configuration instruction belongs in the subsequent step, and avoid affecting the configuration data corresponding to other configuration sessions.
It should be noted that, if the network device cannot determine whether the lightweight configuration rollback function is started according to the function identifier in step 302, the network device may also obtain rollback data from the temporary configuration rollback database corresponding to the configuration session to which the configuration instruction belongs. That is, if the configuration instruction triggers the rollback condition, the network device may obtain the rollback data from the temporary configuration rollback database corresponding to the configuration instruction.
Since the process of obtaining the rollback data in step 306 is similar to the process of obtaining the rollback data in step 201, it is not described herein again.
And 307, performing header deletion processing on the rollback data to obtain the rollback sub-data.
And 308, restoring the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data.
The process from step 307 to step 308 is similar to the process from step 202 to step 203, and is not described herein again.
To sum up, in the configuration rollback method provided in the embodiment of the present disclosure, the rollback data is obtained from the configuration rollback database corresponding to the configuration session, the header deletion processing is performed on the rollback data, so as to obtain the rollback sub-data, and finally, the configuration data is restored according to the receiving time to which the configuration instruction corresponding to the rollback sub-data belongs. By acquiring rollback data corresponding to the configuration instruction triggering the rollback condition from different configuration databases corresponding to different configuration sessions and recovering the configuration data in the network device according to the acquired rollback data, the situation that the configuration data configured for each configuration session is recovered is avoided, the time spent on configuration rollback is reduced, and the efficiency of configuring the network device is improved.
Fig. 4 is a flowchart of a configuration rollback method according to another embodiment of the present disclosure, which is applied to the network device shown in fig. 1, and the method may include:
step 401, determining whether the configuration session and the other sessions satisfy a crossing condition.
The configuration session may include at least one configuration instruction, and the configuration instruction is used for updating configuration data.
Since multiple users may configure the same module or the same entry of the network device during the process of configuring the network device through different sessions, multiple users may also configure modules or entries that are associated with or mutually exclusive from each other. If a configuration session input by a user triggers a rollback condition, the network device may affect configuration data corresponding to other sessions during the configuration rollback of the configured module or entry.
Therefore, before the network device acquires the rollback data, it needs to determine whether the configuration session to which the configuration instruction triggering the rollback condition belongs satisfies the intersection condition, and if the configuration session and the other sessions satisfy the intersection condition, step 402 may be executed, but if the configuration session and the other sessions do not satisfy the intersection condition, step 404 may be executed, so that different operations may be executed according to the determination result to perform configuration rollback on the network device.
Specifically, the network device may determine, according to the configuration session to which the configuration instruction triggering the rollback condition belongs, a target module or a target entry that needs to be configured for the configuration session, and then search, according to the target module or the target entry, whether the configuration instruction configuring the target module or the target entry is included in the other sessions. Meanwhile, the indirect target module or the indirect target table entry associated or exclusive with the target module or the target table entry may be determined, and then whether the other sessions include a configuration session for configuring the indirect target module or the indirect target table entry is searched, so as to obtain a determination result.
If the other sessions include a configuration session for configuring the target module or the target entry, and/or the other sessions include a configuration session for configuring the indirect target module or the indirect target entry, it indicates that the configuration session satisfies the crossing condition, and it is necessary to recover the configuration data configured according to the configuration session to which the configuration instruction belongs and the other sessions, and step 402 may be executed; otherwise, the configuration session does not satisfy the crossing condition, only the configuration data configured according to the configuration session to which the configuration instruction belongs needs to be recovered, and the configuration data configured according to other sessions does not need to be recovered, and step 404 may be executed.
For example, the configuration session to which the configuration instruction triggering the rollback condition belongs needs to configure the first module, and the first configuration session in the other sessions also configures the first module, so that the first module may be the target module. Moreover, if the first module is associated with the second module and the first module is exclusive of the third module, the second module and the third module may be used as indirect target modules, so as to find a configuration session for configuring the second module and the third module in other sessions.
Step 402, if the configuration session and the other sessions meet the crossing condition, storing the configuration instructions included in the other sessions.
If the network device determines that the configuration session meets the crossing condition, the configuration instruction of the other session determined in step 401 may be stored, so that in the subsequent step, the network device may perform configuration update on the configuration data of the network device again according to the stored configuration instruction of the other session, and complete reconfiguration of the network device quickly.
For example, corresponding to the example in step 402, if the configuration session and the first configuration session satisfy the crossing condition, the network device may store, in the storage space corresponding to the first configuration session, the configuration instructions in the first configuration session according to the receiving time of the configuration instructions in the first configuration session, in a reverse order, that is, from back to front, and complete the storage of the configuration instructions in the first configuration session.
Step 403, obtaining rollback data from the configuration rollback database corresponding to the configuration session.
The process of obtaining the rollback data in step 403 is similar to the process of obtaining the rollback data in step 201, and is not described herein again.
And step 404, if the configuration session and other sessions do not meet the crossing condition, obtaining rollback data from a temporary configuration rollback database corresponding to the configuration session.
Wherein configuration instructions comprised by other sessions are not stored.
Because the configuration session to which the configuration instruction belongs and other sessions do not meet the intersection condition, that is, the data configured by other sessions are not affected in the process of rolling back the data configured by the configuration session, after the configuration data is rolled back according to the rolled back data, the data configured by other sessions do not need to be configured again according to the configuration instruction in other sessions, and the configuration instructions included by other sessions also do not need to be stored.
The process of acquiring the rollback data in step 404 is similar to the process of acquiring the rollback data in step 201, and is not described herein again.
And step 405, performing header deletion processing on the rollback data to obtain the rollback sub-data.
And step 406, restoring the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data.
Since the process from step 405 to step 406 is similar to the process from step 202 to step 203, it is not repeated herein.
Step 407, updating the recovered configuration data according to the configuration instructions included in other sessions.
In the process of recovering the configuration data, the configuration data corresponding to the configuration session to which the configuration instruction belongs is recovered, the corresponding configuration data can be configured not only through the configuration session to which the configuration instruction belongs, but also through the configuration instructions of other sessions, and the configuration instructions of other sessions do not trigger a rollback condition, but the configuration data configured through the configuration instructions of other sessions are also recovered.
Therefore, after recovering the configuration data, the network device may reconfigure the configuration data according to the configuration instruction stored in step 402, so that the configuration data of other session configurations is restored to the state before configuration rollback.
Specifically, the network device may update the recovered configuration data according to the pre-stored multiple configuration instructions of other sessions and the receiving time corresponding to each configuration instruction, and according to the sequence from front to back, and after updating the configuration data according to each configuration instruction, complete the update of the recovered configuration data.
In summary, the configuration rollback method provided in the embodiment of the present disclosure determines whether the configuration session and the other sessions meet the intersection condition before the network device performs configuration rollback, and stores at least one configuration instruction included in the other sessions if the configuration session and the other sessions meet the intersection condition, so that after the configuration data is rolled back, the configuration update of the configuration data can be quickly completed according to the stored configuration instruction of the other sessions, and the efficiency of configuring the network device is improved.
Fig. 5 is a schematic diagram of a configuration rollback apparatus according to an embodiment of the present disclosure, and as shown in fig. 5, the apparatus may specifically include:
an obtaining module 501, configured to obtain rollback data from a configuration rollback database corresponding to a configuration session, where the configuration session includes a configuration instruction, and the configuration instruction is used to update configuration data, where the configuration rollback database is used to store rollback data corresponding to the configuration session;
a processing module 502, configured to perform header deletion processing on the rollback data to obtain rollback sub data;
the recovery module 503 is configured to recover the configuration data according to the rollback sub-data according to the receiving time to which the configuration instruction corresponding to the rollback sub-data belongs.
The configuration rollback device provided by the embodiment of the present disclosure obtains rollback data from a configuration rollback database corresponding to a configuration session, performs header deletion processing on the rollback data to obtain rollback sub-data, and finally restores the configuration data according to the rollback sub-data according to the receiving time to which a configuration instruction corresponding to the rollback sub-data belongs. By acquiring rollback data corresponding to the configuration instruction triggering the rollback condition from different configuration databases corresponding to different configuration sessions and recovering the configuration data in the network device according to the acquired rollback data, the situation that the configuration data configured for each configuration session is recovered is avoided, the time spent on configuration rollback is reduced, and the efficiency of configuring the network device is improved.
Optionally, referring to fig. 6, the apparatus may further include:
a receiving module 504, configured to receive a configuration session sent by a terminal, where the configuration session is generated by the terminal according to an operation triggered by a user;
a first updating module 505, configured to update the configuration data according to the configuration instruction in the configuration session;
the obtaining module 501 is specifically configured to, if the configuration instruction triggers a rollback condition, obtain the rollback data from the configuration rollback database corresponding to the configuration session.
Optionally, the obtaining module 501 is specifically configured to obtain a function identifier in the configuration instruction, where the function identifier is used to indicate whether a lightweight configuration rollback function is started; if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction; adding the rollback data into a configuration rollback database corresponding to the configuration session; and acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
Optionally, the obtaining module 501 is specifically configured to determine whether the configured session and another session meet a crossing condition; if the configuration session and the other sessions meet the crossing condition, storing configuration instructions included in the other sessions; obtaining the rollback data from a configuration rollback database corresponding to the configuration session; or, if the configuration session and the other session do not satisfy the intersection condition, obtaining the rollback data from a configuration rollback database corresponding to the configuration session, wherein the configuration instructions included in the other session are not stored.
Optionally, referring to fig. 7, the apparatus may further include:
a second updating module 506, configured to update the recovered configuration data according to the configuration instruction included in the other session.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 8 is a schematic diagram of a configuration rollback apparatus provided in an embodiment of the present disclosure, which may be integrated in a terminal device or a chip of the terminal device, where the terminal may be a computing device with an image processing function.
The device includes: memory 801, processor 802.
The memory 801 is used for storing programs, and the processor 802 calls the programs stored in the memory 801 to execute the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present disclosure also provides a program product, e.g. a computer readable storage medium, comprising a program which, when executed by a processor, is adapted to perform the above-described method embodiments.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (english: processor) to execute some steps of the methods according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (6)

1. A configuration rollback method, the method comprising:
obtaining rollback data from a configuration rollback database corresponding to a configuration session, wherein the configuration session comprises a configuration instruction, and the configuration instruction is used for updating the configuration data, and the configuration rollback database is used for storing rollback data corresponding to the configuration session;
performing header deletion processing on the rollback data to obtain rollback sub data;
restoring the configuration data according to the rollback sub data according to the receiving time of the configuration instruction corresponding to the rollback sub data;
the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
presetting a rollback condition, and if the configuration instruction triggers the rollback condition, acquiring the rollback data from a configuration rollback database corresponding to the configuration session;
the restoring the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data includes:
according to the receiving time of the configuration instruction corresponding to the rollback sub-data and the reverse sequence of the receiving time, sorting the rollback sub-data corresponding to each configuration instruction, and recovering the configuration data according to the rollback sub-data;
the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
judging whether the configuration session and other sessions meet a cross condition;
if the configuration session and the other sessions meet the crossing condition, storing configuration instructions included in the other sessions;
acquiring the rollback data from a configuration rollback database corresponding to the configuration session;
or, if the configuration session and the other sessions do not satisfy the crossing condition, obtaining the rollback data from a configuration rollback database corresponding to the configuration session, wherein the configuration instructions included in the other sessions are not stored;
after the restoring the configuration data according to the rollback sub-data, the method further includes:
and updating the recovered configuration data according to the configuration instructions included in the other sessions.
2. The method of claim 1, wherein before obtaining rollback data from a configuration rollback database corresponding to a configuration session, the method further comprises:
receiving a configuration session sent by a terminal, wherein the configuration session is generated by the terminal according to an operation triggered by a user;
updating the configuration data according to the configuration instruction in the configuration session;
the obtaining rollback data from the configuration rollback database corresponding to the configuration session includes:
and if the configuration instruction triggers a rollback condition, acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
3. The method of claim 2, wherein the obtaining rollback data from a configuration rollback database corresponding to the configuration session comprises:
acquiring a function identifier in the configuration instruction, wherein the function identifier is used for indicating whether a lightweight configuration rollback function is started or not;
if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction;
adding the rollback data into a configuration rollback database corresponding to the configuration session;
and acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
4. A configuration rollback apparatus, characterized in that the apparatus comprises:
an obtaining module, configured to obtain rollback data from a configuration rollback database corresponding to a configuration session, where the configuration session includes a configuration instruction, and the configuration instruction is used to update configuration data, and the configuration rollback database is used to store rollback data corresponding to the configuration session;
the processing module is used for carrying out header deletion processing on the rollback data to obtain rollback sub data;
the recovery module is used for recovering the configuration data according to the rollback sub-data according to the receiving time of the configuration instruction corresponding to the rollback sub-data;
the acquisition module is specifically configured to: presetting a rollback condition, and if the configuration instruction triggers the rollback condition, acquiring the rollback data from a configuration rollback database corresponding to the configuration session;
the recovery module is specifically configured to: according to the receiving time of the configuration instruction corresponding to the rollback sub-data and the reverse sequence of the receiving time, sorting the rollback sub-data corresponding to each configuration instruction, and recovering the configuration data according to the rollback sub-data;
an obtaining module, configured to determine whether the configured session and the other sessions meet a crossing condition; if the configuration session and the other sessions meet the crossing condition, storing configuration instructions included in the other sessions; acquiring the rollback data from a configuration rollback database corresponding to the configuration session; or, if the configuration session and the other sessions do not satisfy the crossing condition, obtaining the rollback data from a configuration rollback database corresponding to the configuration session, wherein the configuration instructions included in the other sessions are not stored;
the apparatus also includes a second update module;
and the second updating module is used for updating the recovered configuration data according to the configuration instructions included in the other sessions.
5. The apparatus of claim 4, further comprising:
the terminal comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a configuration session sent by the terminal, and the configuration session is generated by the terminal according to an operation triggered by a user;
the first updating module is used for updating the configuration data according to the configuration instruction in the configuration session;
the obtaining module is specifically configured to obtain the rollback data from a configuration rollback database corresponding to the configuration session if the configuration instruction triggers a rollback condition.
6. The apparatus according to claim 4, wherein the obtaining module is specifically configured to obtain a function identifier in the configuration instruction, where the function identifier is used to indicate whether a lightweight configuration rollback function is turned on; if the function identifier indicates that the lightweight configuration rollback function is started, generating rollback data corresponding to the configuration session according to the configuration instruction; adding the rollback data into a configuration rollback database corresponding to the configuration session; and acquiring the rollback data from a configuration rollback database corresponding to the configuration session.
CN201811454743.0A 2018-11-30 2018-11-30 Configuration rollback method and device Active CN109361553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811454743.0A CN109361553B (en) 2018-11-30 2018-11-30 Configuration rollback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811454743.0A CN109361553B (en) 2018-11-30 2018-11-30 Configuration rollback method and device

Publications (2)

Publication Number Publication Date
CN109361553A CN109361553A (en) 2019-02-19
CN109361553B true CN109361553B (en) 2022-04-08

Family

ID=65330622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811454743.0A Active CN109361553B (en) 2018-11-30 2018-11-30 Configuration rollback method and device

Country Status (1)

Country Link
CN (1) CN109361553B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817869B (en) * 2019-04-12 2023-05-19 华为技术有限公司 Network configuration recovery method and related equipment thereof
CN112532415B (en) * 2019-09-19 2022-05-17 华为技术有限公司 Configuration change method and related device
CN116389262B (en) * 2023-06-02 2023-08-18 新华三技术有限公司 Configuration rollback method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102111293A (en) * 2010-12-23 2011-06-29 华为技术有限公司 Configuration event processing method and device
CN102420703A (en) * 2011-11-29 2012-04-18 华为技术有限公司 Configuration backspace method and equipment
CN102521007A (en) * 2011-11-30 2012-06-27 烽火通信科技股份有限公司 Network management system object concurrency editing method based on affair scheduling
CN102664746A (en) * 2010-12-14 2012-09-12 微软公司 Globally sound and consistent configuration management for distributed datacenter components
CN105703941A (en) * 2015-12-31 2016-06-22 山石网科通信技术有限公司 Method and device for processing configuration transaction
CN105939217A (en) * 2016-03-23 2016-09-14 杭州迪普科技有限公司 Configuration rollback method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7974218B2 (en) * 2007-04-20 2011-07-05 Cisco Technology, Inc. Intersection-based configuration management
JP5471666B2 (en) * 2010-03-19 2014-04-16 富士通株式会社 Network management apparatus, network management method, and network management program
US8549354B2 (en) * 2011-05-23 2013-10-01 International Business Machines Corporation Managing rollback in a transactional memory environment
CN103096353B (en) * 2011-11-02 2018-02-16 中兴通讯股份有限公司 A kind of northbound data configuration and self-organizing network configuration coordination processing method and system
US10938653B2 (en) * 2015-04-21 2021-03-02 Arista Networks, Inc. System and method of updating a network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102664746A (en) * 2010-12-14 2012-09-12 微软公司 Globally sound and consistent configuration management for distributed datacenter components
CN102111293A (en) * 2010-12-23 2011-06-29 华为技术有限公司 Configuration event processing method and device
CN102420703A (en) * 2011-11-29 2012-04-18 华为技术有限公司 Configuration backspace method and equipment
CN102521007A (en) * 2011-11-30 2012-06-27 烽火通信科技股份有限公司 Network management system object concurrency editing method based on affair scheduling
CN105703941A (en) * 2015-12-31 2016-06-22 山石网科通信技术有限公司 Method and device for processing configuration transaction
CN105939217A (en) * 2016-03-23 2016-09-14 杭州迪普科技有限公司 Configuration rollback method and device

Also Published As

Publication number Publication date
CN109361553A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
TWI740901B (en) Method and device for performing data recovery operation
CN109361553B (en) Configuration rollback method and device
CN107832406B (en) Method, device, equipment and storage medium for removing duplicate entries of mass log data
US11481440B2 (en) System and method for processing metadata to determine an object sequence
CN111984829A (en) Vue-based tree asynchronous loading method, device, equipment and medium
CN109408711B (en) Data filtering method and device, electronic equipment and storage medium
CN113568693A (en) Form rendering method and form rendering system
CN112115313A (en) Regular expression generation method, regular expression data extraction method, regular expression generation device, regular expression data extraction device, regular expression equipment and regular expression data extraction medium
CN106713032B (en) A kind of method and device for realizing network management service management
CN105719072B (en) System and method for associating multi-segment component transactions
CN104486448A (en) Data processing method and device
CN113821249A (en) Project development configuration method and device, electronic equipment and readable storage medium
CN107679107B (en) Graph database-based power grid equipment reachability query method and system
CN108664255B (en) Software upgrading method and device
CN111488195B (en) Virtual machine cloning method, device, equipment and computer readable storage medium
CN113296760A (en) Method for generating model code, computer device and readable storage medium
US20150186564A1 (en) Network device and call simulation tool
CN113806309B (en) Metadata deleting method, system, terminal and storage medium based on distributed lock
US20170139969A1 (en) Method for filtering and analyzing big data, electronic device, and non-transitory computer-readable storage medium
CN112286733B (en) Method, device and equipment for determining backup data recovery time and storage medium
CN110555158A (en) mutually exclusive data processing method and system, and computer readable storage medium
CN115168291A (en) Hierarchical directory implementation method and device, electronic equipment and storage medium
CN111078669B (en) Processing method, device and equipment based on name resolution tree and storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN111597255A (en) Data disaster recovery processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant