CN110990052B - Configuration preservation method and device - Google Patents
Configuration preservation method and device Download PDFInfo
- Publication number
- CN110990052B CN110990052B CN201911205711.1A CN201911205711A CN110990052B CN 110990052 B CN110990052 B CN 110990052B CN 201911205711 A CN201911205711 A CN 201911205711A CN 110990052 B CN110990052 B CN 110990052B
- Authority
- CN
- China
- Prior art keywords
- configuration
- value
- configuration data
- bit
- memory
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a configuration preservation method and device. A configuration preservation method, comprising: receiving a restarting command; checking the current value of each bit in the established bitmap, and outputting prompt information whether to store configuration data when the current value of at least one bit is a first value, wherein the first value is used for indicating that the configuration data corresponding to the bit is changed; when the user selects to save the configuration data, all the configuration data stored in the memory are automatically saved to the designated configuration file. By the method, whether the configuration data in the memory is stored in the configuration file can be effectively determined according to the selection of the user before the equipment is restarted, so that the configuration data loss caused by the fact that the user forgets to store the configuration data in the memory is avoided.
Description
Technical Field
The present application relates to the field of network technologies, and in particular, to a configuration storage method and device.
Background
In order to improve the configuration efficiency when configuring a network device, the configuration is often performed through a command line, and a part of common configuration data is stored in a memory.
However, since the data stored in the memory belongs to the data which is easy to lose, if the device is restarted, all the configuration data stored in the memory is lost, so that the device cannot recover the configuration before restarting, and a serious network problem is generated.
Thus if the device is configured via the command line and part of the configuration data is stored in the memory, a worker is required to manually save the configuration data in the memory to the configuration file before restarting the device. This increases the workload of the staff and it happens sometimes that the configuration data in the memory is not saved to the configuration file due to negligence of the staff, resulting in total loss of the configuration data in the memory after the device is restarted.
Disclosure of Invention
The application provides a configuration saving method and a configuration saving device, which are used for automatically saving configuration data in a memory into a configuration file before equipment is restarted.
The technical scheme provided by the application comprises the following steps:
in a first aspect, the present application provides a configuration saving method, including:
receiving a restarting command;
checking the current value of each bit in the established bitmap, and outputting prompt information whether to store configuration data when the current value of at least one bit is a first value, wherein the first value is used for indicating that the configuration data corresponding to the bit is changed;
when the user selects to save the configuration data, all the configuration data stored in the memory are automatically saved to the designated configuration file.
In a second aspect, the present application provides a configuration saving device, comprising:
the receiving module is used for receiving a restarting command;
the output module is used for checking the current value of each bit in the established bitmap, and outputting prompt information whether to store configuration data or not when the current value of at least one bit is a first value, wherein the first value is used for indicating that the configuration data corresponding to the bit is changed;
and the storage module is used for automatically storing all the configuration data stored in the memory to a designated configuration file when the user selects to store the configuration data.
After a restarting command is received, the application determines that the configuration data in the memory is changed according to the current value of each bit in the established bitmap, and automatically saves the configuration data stored in the memory to the configuration file when the user selects to save the configuration data. Therefore, the automatic storage of the configuration data in the memory before restarting the equipment is realized, and the loss of the configuration data caused by the fact that the user forgets to store the configuration data in the memory is effectively avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a configuration preservation method provided by the application;
FIG. 2 is a schematic diagram of a bitmap according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating implementation of step 103 according to an embodiment of the present application;
FIG. 4 is a flow chart of setting the current value of a bit according to an embodiment of the present application;
FIG. 5 is a block diagram of a configuration preservation device provided by the present application;
FIG. 6 is a block diagram of another configuration preservation device according to the present application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
When configuring a network device via a command line, a portion of the configuration data is typically stored in memory. However, since the configuration data stored in the memory after the device is restarted is lost, the device cannot recover the configuration before the device is restarted, and even a significant network problem occurs, a worker is required to manually input a write file command and the like to store the configuration data in the memory into the configuration file in the nonvolatile storage medium before the device is restarted.
The workload of the staff is increased by the mode, and the situation that the staff forgets to store the configuration data in the memory into the configuration file is unavoidable, so that the configuration data in the memory is lost after the equipment is restarted.
After receiving the restart command, the configuration data in the memory is automatically saved into the configuration file according to whether the configuration data corresponding to each bit in the established bitmap is changed or not.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in detail with reference to the accompanying drawings and specific embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a configuration saving method provided by the present application. As an embodiment, the flow shown in fig. 1 may be applied to a network device, such as a switch, or the like. As shown in fig. 1, the process may include the steps of:
step 101, a restart command is received.
The restart command is used to instruct the device to restart, and as an embodiment, the restart command may be a reboot command input by a user and received through a command line, or may be a command input by a user through other manners and used to instruct the device to restart.
Step 102, checking the current value of each bit in the established bitmap, and outputting prompt information of whether to store configuration data when the current value of at least one bit is a first value, wherein the first value is used for indicating that the configuration data corresponding to the bit is changed.
According to step 101, the device needs to be restarted according to the restart command of the user, so before restarting, in order to ensure that the configuration data that is not saved to the configuration file and is present in the memory is not lost due to restarting, it is first necessary to check whether the configuration information that is not saved is present in the memory.
In order to quickly and accurately determine whether the configuration data that is not saved to the configuration file is stored in the memory of the device, that is, whether the configuration data in the memory has been changed, step 102 uses a bitmap to represent the change of the configuration data. Since the value of each bit in the bitmap is usually 0 or 1, the first value in step 102 may be set to 0 or 1, for example, the first value may be set to 1, and a current value of 1 for a bit indicates that the configuration data corresponding to the bit has been changed. The application is not limited to the value of the first value.
As an embodiment, the change of the configuration data refers to the change of the configuration data in the memory corresponding to the bit, where the change may be addition, modification, deletion, etc. of the configuration data.
In one example, a network device to which the configuration preservation method provided by the present application is applied is virtualized into a plurality of logical devices through an operating system level virtual environment (OS-Level Virtual Context, OVC) technology.
The OVC technology is a virtualization technology capable of virtualizing one physical device into a plurality of logical devices according to the memory size of the physical device. And a plurality of logic devices on the same physical device after the OVC virtualization respectively have independent hardware, software, forwarding table items, a management plane, a log and the like, and the operation of each logic device is not affected. For convenience of description, a logical device obtained after OVC virtualization will be hereinafter referred to as an OVC device.
In general, the plurality of OVC devices obtained by virtualizing the same physical device have different numbers, and as an embodiment, each bit of the bitmap in step 102 may correspond to a number of one OVC device, where the current value of the bit is a first value, which indicates that configuration data in the memory of the OVC device identified by the number corresponding to the bit is changed.
Therefore, the current value of at least one bit in the established bitmap is the first value, which can indicate that the configuration data in the memory of at least one OVC device in the network device is changed, so that prompt information about whether to save the configuration data can be output to the user, so as to prompt the user that the configuration data which is not saved exists in the current memory, and enable the user to select whether to save the configuration data to the designated configuration file. The specified profile herein may be specified by the user or may be a default profile for the system.
The content of the output hint information may be "System configuration has been modified.save? (Y/N) (system configuration has been changed, is it saved (yes/no)) ". The content of the prompt information output to the user is not particularly limited in the present application.
To facilitate an understanding of this step 102, a simple example is given below:
assuming that one network device is virtualized into 8 OVC devices through the OVC technology, the numbers of the OVC devices are respectively: 0. 1, 2, 3, 4, 5, 6, 7. The bitmap established in the network device is shown with reference to fig. 2, wherein each bit of the bitmap is marked below with the number of the OVC device corresponding to that bit. The current value of each bit is also shown by way of example in fig. 2 for ease of understanding.
Taking the example that the first value is 1, according to fig. 2, the current value of the bitmap with two bits is 1, that is, the current value with two bits is the first value, so that it can be determined that there is unsaved configuration data in the network device, and prompt information about whether to save the configuration data is output to the user.
As an embodiment, for the number of the OVC device corresponding to each bit with the current value of 1, prompt information including the number of the OVC device may be output to the user, so as to respectively confirm, for the OVC device with changed configuration data in each memory, whether to save the configuration data in the memory of the OVC device.
As an embodiment, if the current values of all bits in the established bitmap are not the first values, it is indicated that the configuration data corresponding to each bit in the bitmap is not changed, so that the device restart operation can be directly executed according to the restart command received in step 101.
As one example, the bitmap in step 102 may be built into the non-volatile storage medium of the network device rather than into memory to ensure that the bitmap does not need to be re-built after the device is restarted.
And step 103, when the user selects to save the configuration data, all the configuration data stored in the memory are automatically saved to a designated configuration file.
As an embodiment, the method for monitoring the user to select to save the configuration data may be to receive the confirmation information returned by the user for the prompt information sent to the user in step 102.
In the step 102, the content of the output prompt message is "System configuration has been modified.save? (Y/N) "for example, if the user input of" Y (Yes) "is received after the prompt message is output, it can be determined that the user has selected to save the configuration data; if "N (no)" input by the user is received, it may be determined that the user has selected not to save the configuration data.
For a network device that is virtualized as a plurality of OVC devices, when configuration data is actually saved, the OVC device that changes configuration data for each memory can let the user select which OVC device's configuration data to save.
For example, if in step 102, for each OVC device number corresponding to the bit with the current value of 1, a prompt message including the OVC device number is output to the user, then it may be determined whether to automatically save all configuration data stored in the OVC memory to a specified configuration file according to the monitored selection of each OVC device by the user.
For another example, after it is further monitored in step 103 that the user selects to save the configuration data, the number of the OVC device corresponding to the bit with the current value of 1 may be further output, so that the user may select to save the configuration data of the OVC device corresponding to at least one number.
In practical application, in step 103, all configuration data stored in the memory are automatically saved to the designated configuration file in various implementations, one of which is shown in the following example, and will not be described herein.
As an embodiment, after all the configuration data stored in the memory is automatically saved to the designated configuration file, information indicating that the configuration data is saved successfully may also be returned to the user.
For example, "Save the configuration file successfully-! (successfully save configuration file |) ", which indicates that all configuration data stored in the memory has been successfully saved to the specified configuration file.
As an embodiment, if it is detected that the user chooses not to save the configuration data, the device restart operation is directly performed according to the restart command received in step 101.
Thus, the flow shown in fig. 1 is completed.
Through the flow shown in fig. 1, when the configuration data is stored in the memory according to the current value of each bit in the bitmap before the equipment is restarted, the user is prompted whether to save the configuration data in the memory, and when the user selects to save, the configuration data in the memory is automatically saved into the configuration file, so that the loss of the configuration data caused by forgetting to save the configuration data in the memory by the user is effectively avoided.
In practical application, the information about whether the configuration data is changed can be represented by using a bitmap, or other modes, such as using an entry, etc., and the principle is similar to that of the bitmap, which should also be regarded as the protection scope of the present application.
The restarting of the device according to the flow shown in fig. 1 is performed manually, and in the actual working process of the device, the restarting may be performed due to factors such as power failure, so that in order to reduce the loss of the changed configuration data in the memory caused by the restarting, as an embodiment, on the basis of the flow shown in fig. 1, a timed backup may also be performed, that is, according to a preset time period, whether the current value of at least one bit in the bitmap is the first value is checked, and if so, the configuration data in the memory is automatically backed up to the designated configuration file. And after each backup, changing the current value of the corresponding bit in the bitmap from the first value to the second value. The user can choose whether to make the equipment perform the timing backup according to the actual demand.
An example of how all the configuration data stored in the memory is automatically saved to the specified configuration file in step 103 is described below with reference to fig. 3:
referring to fig. 3, fig. 3 is a flowchart of step 103 provided in an embodiment of the present application. The flow shown in fig. 3 is performed on the basis of the detection of the user selection of save configuration data in step 103 described above. As shown in fig. 3, the process includes:
step 301, for the bit whose current value is the first value, determining configuration data corresponding to the bit in the memory.
If the network device applying the method provided by the application is virtualized as a plurality of OVC devices, as an embodiment, determining the configuration data corresponding to the bit in the memory is determining the configuration data of the OVC device corresponding to the bit. The OVC device identified by the number may be determined according to the OVC device number corresponding to the bit.
For the sake of understanding the present embodiment, taking the bitmap established in the network device as the bitmap shown in fig. 2 as an example, that is, the network device is virtualized into 8 OVC devices, and the numbers of the OVC devices are shown in fig. 2. Assuming that the first value is 1, according to fig. 2, the OVC device numbers corresponding to the bit of the current value of 1 can be determined as 0 and 2, respectively, so that the OVC devices with numbers 0 and 2 and the configuration data in the memory thereof can be determined. That is, the configuration data in the memories of the OVC devices numbered 0 and 2 are changed, and it is necessary to save them to a designated configuration file.
Step 302, automatically saving the configuration data corresponding to the bit determined in the memory to a designated configuration file, and changing the current value of the bit from the first value to the second value after the saving is completed.
For one embodiment, the configuration data in memory may be saved to a specified configuration file by executing a specific command, such as executing a write file command. Specifically, for each OVC device determined in step 301, a write file command may be sent to a command line process under the OVC device, so that the OVC device executes the write file command, and the configuration data in the memory is saved to a specified configuration file.
After the storage of the configuration data is completed, changing the current value of the bit with the current value being the first value into the second value so as to indicate that the configuration data corresponding to the bit is stored in the designated configuration file, and avoiding repeated storage of the configuration data corresponding to the bit.
The second value in this step 302 may be set to one of 0 or 1, but needs to be different from the first value, that is, if the first value is set to 1, the second value is set to 0; if the first value is set to 0, the second value is set to 1.
For the sake of understanding the present step 302, still taking the bitmap shown in fig. 2 as an example, if the first value is 1, for the OVC device with number 0 and number 2 determined according to step 301, after the configuration data in the memory of the OVC device is automatically saved to the specified configuration file, the current values of bit bits corresponding to the number 0 and number 2 of the OVC device are changed from 1 to 0.
As an embodiment, after all the configuration data stored in the memory are automatically saved to the designated configuration file, the device restart operation is performed according to the restart command received in step 101.
Thus, the flow shown in fig. 3 is completed.
By the flow shown in fig. 3, when the user selects to save the configuration data, the configuration data stored in the memory is automatically saved to the designated configuration file.
How to check whether the configuration data which is not saved to the configuration file is stored in the memory according to the established bitmap before executing the restart command is described above. As an embodiment, to facilitate checking whether the configuration data not stored in the memory is stored in the configuration file, the current value of the bit in the bitmap may be set according to the storage location of the configuration data generated by the received configuration command. Described below by way of example in connection with fig. 4:
referring to fig. 4, fig. 4 is a flow chart of setting a current value of a bit according to an embodiment of the present application. As shown in fig. 4, the process may include the steps of:
step 401, a configuration command is received.
As one embodiment, the configuration command herein is a configuration command input by a user through a command line.
Step 402, when receiving a trigger from the outside for running the configuration command, if the first flag of the target command structure matched with the configuration command is found in the established command structure body to be a third value, where the third value is used to indicate that the configuration data associated with the configuration command is stored in the memory, then the bit corresponding to the configuration data is found in the bitmap, and the current value of the bit is set to be the first value.
As an embodiment, the "trigger for executing the configuration command" refers to an operation of pressing the enter after the user inputs the command in the command line, and is used to instruct the device to start executing the currently input configuration command.
Upon receiving the trigger, the network device searches the established command structure for a command structure matching the configuration command, and then checks whether the first flag in the command structure is a third value. As one embodiment, the command structure herein is a command line structure array for recording view information, module information, command prototypes, command execution functions, command help functions, etc. of commands when registering a command line. A first flag is added to the array of command line structures to indicate whether the configuration data associated with the command is stored in memory.
The value of the first flag of each command structure in the command line structure may be set according to whether the configuration data associated with the command matching each command structure is stored in the memory when the command is actually applied.
For example, when the command 1 exists, the staff member can know that the configuration data associated with the command 1 is usually stored in the memory according to the practical application, and then the first flag of the command structure matched with the command 1 in the command structure body can be set to be a third value, which indicates that the configuration data associated with the command 1 is stored in the memory.
In another example, if there is a command 2, the staff member can know that the configuration data associated with the command 2 is usually stored directly in the configuration file according to the practical application situation, and then the first flag of the command structure matched with the command 2 in the command structure body can be set to a fourth value, which indicates that the configuration data associated with the command 2 is not stored in the memory.
The third value may be set to 0 or 1 or other values, if the third value is set to 1, when the first flag of the target command structure matched with the configuration command is found in the established command structure body to be 1, the bit corresponding to the configuration data is found in the bitmap, and the current value of the bit is set to the first value. The third value has no necessarily linking in value with the first value.
The fourth value needs to be different from the third value. That is, assuming that the fourth value and the third value can only take values from 1 and 0, if the third value is 1, the fourth value is 0; if the third value is 0, the fourth value is 1.
If the first mark of the target command structure matched with the configuration command is a third value, searching that the current value of the bit corresponding to the configuration data in the bitmap is a second value, and changing the current value of the bit from the second value to the first value; if the current value of the bit corresponding to the configuration data in the bitmap is the first value, the current value of the bit is kept unchanged.
As one embodiment, if the first flag of the target command structure matched with the configuration command is found in the established command structure body to be the fourth value, which indicates that the configuration data associated with the command is stored in the configuration file, the configuration operation is executed in the configuration file according to the configuration command. The configuration operation herein may be a delete, modify, add, etc. operation on the configuration data.
Step 403, after all the configuration data stored in the memory are automatically saved to the designated configuration file, the current value of the bit is changed from the first value to the second value.
This step 403 is similar to the above step 302 in implementation, so a detailed description is omitted here.
Thus, the flow shown in fig. 4 is completed.
Through the flow shown in fig. 4, it is realized that according to the command structure matched in the command structure body by the received configuration command, whether the configuration data associated with the command is stored in the memory is directly determined, and when it is determined that the configuration data associated with the command is stored in the memory, bit corresponding to the configuration data in the bitmap is set to the first value.
The method provided by the application is described above, and the device provided by the application is described below:
referring to fig. 5, fig. 5 is a block diagram of a configuration storage device provided by the present application. As shown in fig. 5, the apparatus includes a receiving module 501, an outputting module 502, and a saving module 503.
In one example, the receiving module 501 is configured to receive a restart command;
the output module 502 is configured to check a current value of each bit in the established bitmap, and output a prompt message whether to store configuration data when the current value of at least one bit is a first value, where the first value is used to indicate that the configuration data corresponding to the bit is changed;
and the saving module 503 is configured to automatically save all the configuration data stored in the memory to the designated configuration file when it is detected that the user selects to save the configuration data.
As an embodiment, the receiving module automatically saves all configuration data stored in the memory to a specified configuration file, including:
aiming at a bit with the current value being the first value, determining configuration data corresponding to the bit in a memory;
and automatically storing the configuration data corresponding to the bit determined in the memory to a designated configuration file, and changing the current value of the bit from the first value to the second value after the storage is completed.
As an embodiment, as shown in fig. 6, the apparatus further includes:
and a restarting module 504, configured to execute the device restarting operation according to the restarting command after the saving module automatically saves all the configuration data stored in the memory to the designated configuration file.
In one embodiment, the restart module 504 is further configured to execute the device restart operation according to the restart command when the current value of all bits in the established bitmap is not the first value.
As an embodiment, the receiving module 501 is further configured to receive a configuration command;
the apparatus further comprises: the bit setting module 505, when receiving a trigger from the outside for running the configuration command, searches the bitmap for a bit corresponding to the configuration data if the first flag of the target command structure matched with the configuration command is a third value in the established command structure, where the third value is used to indicate that the configuration data associated with the configuration command is stored in the memory, and sets the current value of the bit as the first value;
the saving module 503 is further configured to automatically save all configuration data stored in the memory to a specified configuration file, and then change the current value of the bit from the first value to the second value.
As an embodiment, the bit setting module 505 is specifically configured to perform a configuration operation in the configuration file according to the configuration command when the first flag of the target command structure matched with the configuration command is found as the fourth value in the established command structure.
It should be understood that the restart module 504 and the bit setting module 505 may be configured in the device as two modules with independent functions, as shown in fig. 6, or may be configured in the device separately and separately, and thus the configuration shown in fig. 6 should not be construed as limiting the embodiment described in the present disclosure.
The implementation process of the functions and actions of each module in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative and the components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed across multiple network modules. The modules can be selected according to actual needs to achieve the purposes of the scheme of the specification. Those of ordinary skill in the art will understand and implement the present application without undue burden.
Referring to fig. 7, fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the application. The electronic device may include a processor 701, a memory 702, and a communication bus 703. The processor 701 and the memory 702 perform communication with each other through a communication bus 703. Wherein the memory 702 has stored thereon a computer program; the processor 701 can execute the configuration save method described above by executing the program stored on the memory 702.
The memory 702 referred to herein may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, or the like. For example, the memory 702 may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
Embodiments of the present application also provide a machine-readable storage medium, such as memory 702 in fig. 7, storing a computer program executable by processor 701 in the electronic device shown in fig. 7 to implement the configuration preservation method described above.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Moreover, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (10)
1. A configuration preservation method, the method comprising:
receiving a restarting command;
checking the current value of each bit in the established bitmap, and outputting prompt information whether to store configuration data when the current value of at least one bit is a first value, wherein the bit of the bitmap corresponds to the number of the OVC equipment one by one, and the first value is used for indicating the change of the configuration data in the memory of the OVC equipment identified by the number corresponding to the bit;
when the user selects to save the configuration data, all the configuration data stored in the memory are automatically saved to the designated configuration file.
2. The method of claim 1, wherein automatically saving all configuration data stored in the memory to the specified configuration file comprises:
aiming at a bit with the current value being the first value, determining configuration data corresponding to the bit in a memory;
and automatically storing the configuration data corresponding to the bit determined in the memory to a designated configuration file, and changing the current value of the bit from the first value to the second value after the storage is completed.
3. The method of claim 1, wherein after automatically saving all configuration data stored in the memory to the specified configuration file, the method further comprises:
and executing equipment restarting operation according to the restarting command.
4. The method of claim 1, wherein when the current value of all bits in the established bitmap is not the first value, the method further comprises:
and executing equipment restarting operation according to the restarting command.
5. The method according to claim 1, characterized in that the method further comprises:
receiving a configuration command;
when receiving a trigger from the outside for running the configuration command, if a first mark of a target command structure matched with the configuration command is searched in an established command structure body to be a third value, wherein the third value is used for indicating that configuration data associated with the configuration command is stored in a memory, a bit corresponding to the configuration data is searched in the bitmap, and the current value of the bit is set to be a first value;
and after all the configuration data stored in the memory are automatically stored into the designated configuration file, changing the current value of the bit from the first value to the second value.
6. The method according to claim 5, characterized in that the method further comprises:
and if the first mark of the target command structure matched with the configuration command is found to be a fourth value in the established command structure, executing configuration operation in the configuration file according to the configuration command.
7. A configuration preservation device, the device comprising:
the receiving module is used for receiving a restarting command;
the device comprises an output module, a configuration data storage module and a configuration data storage module, wherein the output module is used for checking the current value of each bit in an established bitmap, outputting prompt information whether to store the configuration data when the current value of at least one bit is a first value, wherein the bit of the bitmap corresponds to the number of the OVC device one by one, and the first value is used for indicating the configuration data in the memory of the OVC device identified by the number corresponding to the bit to change;
and the storage module is used for automatically storing all the configuration data stored in the memory to a designated configuration file when the user selects to store the configuration data.
8. The apparatus of claim 7, wherein the saving module automatically saves all configuration data stored in the memory to a specified configuration file, comprising:
aiming at a bit with the current value being the first value, determining configuration data corresponding to the bit in a memory;
and automatically storing the configuration data corresponding to the bit determined in the memory to a designated configuration file, and changing the current value of the bit from the first value to the second value after the storage is completed.
9. The apparatus of claim 7, wherein the apparatus further comprises:
and the restarting module is used for executing equipment restarting operation according to the restarting command after automatically storing all the configuration data stored in the memory to the designated configuration file.
10. The apparatus of claim 7, wherein the receiving module is further configured to receive a configuration command, the apparatus further comprising:
the bit setting module is used for searching a bit corresponding to the configuration data in the bitmap and setting the current value of the bit as a first value if the first mark of the target command structure matched with the configuration command is searched in the established command structure body to be a third value when receiving the trigger from the outside for running the configuration command, wherein the third value is used for indicating that the configuration data associated with the configuration command is stored in the memory;
the storage module is further configured to automatically store all configuration data stored in the memory to a specified configuration file, and then change the current value of the bit from the first value to the second value.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911205711.1A CN110990052B (en) | 2019-11-29 | 2019-11-29 | Configuration preservation method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911205711.1A CN110990052B (en) | 2019-11-29 | 2019-11-29 | Configuration preservation method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110990052A CN110990052A (en) | 2020-04-10 |
| CN110990052B true CN110990052B (en) | 2023-09-26 |
Family
ID=70088682
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911205711.1A Active CN110990052B (en) | 2019-11-29 | 2019-11-29 | Configuration preservation method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110990052B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112910978B (en) * | 2021-01-26 | 2022-07-01 | 杭州迪普科技股份有限公司 | Method and system for synchronizing network configuration data |
| CN115904509A (en) * | 2022-10-26 | 2023-04-04 | 杭州迪普科技股份有限公司 | Method and device for processing restart command of network equipment |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6096094A (en) * | 1997-10-03 | 2000-08-01 | National Instruments Corporation | Configuration manager for configuring a data acquisition system |
| CN101286886A (en) * | 2008-06-05 | 2008-10-15 | 杭州华三通信技术有限公司 | Method and device to recover configuring information of network appliance |
| CN104796801A (en) * | 2015-05-08 | 2015-07-22 | 上海斐讯数据通信技术有限公司 | ONU (optical network unit) configuration sending method and ONU configuration sending system based on multiple tasks |
| WO2017124933A1 (en) * | 2016-01-18 | 2017-07-27 | 阿里巴巴集团控股有限公司 | Information processing method, device and system |
| CN108604992A (en) * | 2016-05-26 | 2018-09-28 | 华为技术有限公司 | System and method for software-defined switching between lightweight virtual machines using host kernel resources |
| CN109976798A (en) * | 2019-02-02 | 2019-07-05 | 杭州迪普科技股份有限公司 | A kind of reminding method and device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8141041B2 (en) * | 2008-01-07 | 2012-03-20 | International Business Machines Corporation | Automated configuration updater and method for code builder |
| US8078906B2 (en) * | 2008-08-21 | 2011-12-13 | Infinidat, Ltd. | Grid storage system and method of operating thereof |
| CN110413200B (en) * | 2018-04-28 | 2023-06-09 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for data synchronization |
-
2019
- 2019-11-29 CN CN201911205711.1A patent/CN110990052B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6096094A (en) * | 1997-10-03 | 2000-08-01 | National Instruments Corporation | Configuration manager for configuring a data acquisition system |
| CN101286886A (en) * | 2008-06-05 | 2008-10-15 | 杭州华三通信技术有限公司 | Method and device to recover configuring information of network appliance |
| CN104796801A (en) * | 2015-05-08 | 2015-07-22 | 上海斐讯数据通信技术有限公司 | ONU (optical network unit) configuration sending method and ONU configuration sending system based on multiple tasks |
| WO2017124933A1 (en) * | 2016-01-18 | 2017-07-27 | 阿里巴巴集团控股有限公司 | Information processing method, device and system |
| CN108604992A (en) * | 2016-05-26 | 2018-09-28 | 华为技术有限公司 | System and method for software-defined switching between lightweight virtual machines using host kernel resources |
| CN109976798A (en) * | 2019-02-02 | 2019-07-05 | 杭州迪普科技股份有限公司 | A kind of reminding method and device |
Non-Patent Citations (1)
| Title |
|---|
| 网络配置数据存储与恢复的研究与应用;蒋玉玲;谭佳慧;;计算技术与自动化(第02期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110990052A (en) | 2020-04-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102023908B (en) | Method and device for backing up boot program | |
| US20120191960A1 (en) | Booting computing devices | |
| US8756474B2 (en) | Method for initiating a refresh operation in a solid-state nonvolatile memory device | |
| US20140123121A1 (en) | Rack and method thereof for simultaneously updating basic input output systems | |
| US11106443B2 (en) | Operating system installation | |
| US8726087B2 (en) | System and method for curing a read inability state in a memory device | |
| JP2015508929A5 (en) | ||
| CN110990052B (en) | Configuration preservation method and device | |
| CN109582332B (en) | System upgrading method and device for Internet camera | |
| CN102722394A (en) | Start upgrading method of embedded equipment | |
| CN105138430A (en) | Embedded operating system backup and restoration method and device | |
| CN116909607A (en) | Program upgrading method, program upgrading device, computer equipment, storage medium and program product | |
| WO2021103745A1 (en) | Method for protectively desiging boot program | |
| CN104866388B (en) | Data processing method and device | |
| CN106156626A (en) | A kind of method and apparatus of security of system upgrading | |
| WO2021012170A1 (en) | Firmware booting method and device, and computer-readable storage medium | |
| US8074018B2 (en) | Disk array apparatus, and control method and control program recording medium | |
| CN110795155B (en) | System starting method and device, electronic equipment and storage medium | |
| CN113076225A (en) | External storage medium detection method, device and equipment and storage medium | |
| CN103150222A (en) | Method and device for restoring embedded system from abnormal state | |
| CN102402447A (en) | Equipment starting method and equipment | |
| JP2002297207A (en) | Backup processor | |
| CN115509825A (en) | Data processing method and device, NFC chip and computer readable storage medium | |
| US9424186B2 (en) | Method and apparatus for controlling memory startup | |
| CN112597131A (en) | Distributed script control method and related device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |