[go: up one dir, main page]

CN106921524B - Method and device for configuring command line tag - Google Patents

Method and device for configuring command line tag Download PDF

Info

Publication number
CN106921524B
CN106921524B CN201710209902.XA CN201710209902A CN106921524B CN 106921524 B CN106921524 B CN 106921524B CN 201710209902 A CN201710209902 A CN 201710209902A CN 106921524 B CN106921524 B CN 106921524B
Authority
CN
China
Prior art keywords
command line
target
instruction
tag
target command
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
CN201710209902.XA
Other languages
Chinese (zh)
Other versions
CN106921524A (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
Original Assignee
New H3C Technologies Co Ltd
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 filed Critical New H3C Technologies Co Ltd
Priority to CN201710209902.XA priority Critical patent/CN106921524B/en
Publication of CN106921524A publication Critical patent/CN106921524A/en
Application granted granted Critical
Publication of CN106921524B publication Critical patent/CN106921524B/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
    • 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/0889Techniques to speed-up the configuration process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for configuring a command line label, wherein the method comprises the following steps: receiving a label adding instruction; selecting a target command line pointed by the tag adding instruction from all the stored command lines; adding a target tag indicated by a tag addition instruction to the target command line; and storing the corresponding relation between the target label and the target command line. By applying the embodiment of the invention, the operation speed of the command line is effectively improved, and the operation efficiency is improved.

Description

Method and device for configuring command line tag
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for configuring a command line label.
Background
The configuration data of the network equipment is stored in a start configuration file in a form of a command line, the command line in the start configuration file is divided into a configuration command line and a configuration view, wherein the configuration command line is divided into an independent configuration command line or a configuration command line with mutual dependency relationship, and the configuration command line with mutual dependency relationship can be a dispersed configuration command line or a continuous adjacent configuration command line; the configuration view can comprise a plurality of configuration command lines and a plurality of configuration views to form a plurality of levels, the configuration view of the next level of the configuration view is a child configuration view of the configuration view, the configuration view of the last level of the configuration view is a parent configuration view of the configuration view, and the configuration view and all the command lines under the configuration view depend on all the parent configuration views of the configuration view.
After the network device is started, reading a command line from a start configuration file, for example, including a configuration command line and a configuration view, and loading the read command line into a memory of the network device. Therefore, the network equipment can configure each service module according to the command line in the memory, and ensure the operation of each service module.
When the command line for realizing a certain function needs to be displayed, modified, deleted and the like, the network device takes the whole starting configuration file as an object, and if the command line for realizing a certain function needs to be displayed, all the command lines in the memory are read and displayed.
The method for operating by taking the whole starting configuration file as an object is simple and direct, but has the problems that in a large-scale network device, the data volume of a command line is large, the starting configuration file can reach dozens of megabytes, and at the moment, if the whole starting configuration file is taken as an object to carry out operations such as display, modification, deletion and the like, a quite long time is consumed, so that the operating speed of the command line is slow, and the operating efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for configuring a command line tag, so as to improve the operation speed of a command line and improve the operation efficiency. The specific technical scheme is as follows:
in one aspect, an embodiment of the present invention discloses a method for configuring a command line tag, including:
receiving a label adding instruction;
selecting a target command line pointed by the tag adding instruction from all stored command lines;
adding a target label indicated by the label adding instruction to the target command line;
and storing the corresponding relation between the target label and the target command line.
On the other hand, the embodiment of the invention discloses a device for configuring a command line tag, which comprises the following components:
a storage unit for storing a command line;
a receiving unit for receiving a tag addition instruction;
the control unit selects a target command line pointed by the tag adding instruction from stored command lines and adds a target tag pointed by the tag adding instruction to the target command line; and storing the corresponding relation between the target label and the target command line in the storage unit.
In the embodiment of the invention, a tag adding instruction is received, a target command line pointed by the tag adding instruction is selected from all stored command lines, a target tag pointed by the tag adding instruction is added to the target command line, and the corresponding relation between the target tag and the target command line is stored. At this time, the operation can be performed with the tag as the object, and the command line corresponding to the target tag is operated without performing the operation with the whole startup configuration file as the object, so that the operation speed of the command line is increased, and the operation efficiency is improved. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for configuring a command line tag according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for displaying a command line according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for modifying a command line according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating a method for exporting a command line according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for importing a command line according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a method for deleting a command line according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus for configuring a command line tag according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For convenience of explanation, terms appearing in the present invention are explained below.
Starting a configuration file: the system is used for storing configuration parameters realized by a command line, and starting configuration files are stored on a storage medium of the network equipment, wherein the storage medium is a nonvolatile memory, so that the starting configuration files are prevented from being lost due to the restarting, power failure and other reasons of the network equipment;
memory: the internal memory is also called an internal memory, and is used for temporarily storing arithmetic data in the CPU and data exchanged with an external memory such as a hard disk. As long as the computer is in operation, the CPU will transfer the data to be operated to the memory for operation.
The present invention will be described in detail below with reference to specific examples.
Fig. 1 is a flowchart illustrating a flow of a method for configuring a command line tag according to an embodiment of the present invention, where the method includes:
s101: receiving a label adding instruction;
s102: selecting a target command line pointed by the tag adding instruction from all the stored command lines;
s103: adding a target tag indicated by a tag addition instruction to the target command line;
s104: and storing the corresponding relation between the target label and the target command line.
When the network device is started, all command lines and tags in a local start configuration file are loaded into a memory.
In this case, the administrator may receive a tag addition instruction, where the tag addition instruction includes an identifier of the target command line and a target tag; after receiving the tag adding instruction, the network device selects a target command line pointed by the tag adding instruction from all command lines stored in the memory, adds a target tag pointed by the tag adding instruction to the target command line, and stores the corresponding relation between the target tag and the target command line.
To facilitate distinguishing between command lines and tags, tags may be added after the command lines in a similar annotated fashion. For example, the configuration parameters implemented by a part of command lines in the startup configuration file of the network device are as follows:
Figure GDA0002806614300000041
after the network device is started, the command lines are all loaded into a memory of the network device, and if the network device receives a TAG adding instruction pointing to "signaling-protocol bgp", and in addition, a target TAG indicated by the TAG adding instruction is "TAG 1", then "TAG 1" is added after "signaling-protocol bgp" in a similar annotation form, as shown below:
signaling-protocol bgp # TAG 1// configuration view;
the method stores the signaling-protocol bgp added with the TAG 1, namely stores the TAG 1 and the corresponding relation between the TAG 1 and the signaling-protocol bgp.
In one embodiment of the invention, to save storage space of the network device, only the target command line may be tagged with a target tag.
In another embodiment of the present invention, in order to quickly operate on a target command line and a command line having a dependency relationship with the target command line, after adding a target tag to the target command line, a command line having a dependency relationship with the target command line is selected, and the target tags are added to the command lines having a dependency relationship with the target command line.
For example: if the target command line is a single independent configuration command line, directly adding a target label to the target command line; if the target command line has a plurality of configuration command lines with dependency relationship, whether continuous or scattered, adding the same target label as the target command line to the configuration command lines with dependency relationship; if the target command line is a configuration view of any hierarchy, adding the same target tag as the target command line to all parent configuration views of the target command line and all configuration command lines (including child configuration views) below the target command line; if the target command line is a configuration command line under any hierarchical configuration view, all parent configuration views of the target command line are added with the same target tag as the target command line.
In order to quickly operate the target command line and the command line having a dependency relationship with the target command line, in the command behavior example of the start configuration file shown above, after adding "TAG 1" after "signaling-protocol bgp" in a similar annotation form, three command lines "vsi vpls _ bgp", "auto-discovery bgp" and "site 3range 33default-offset 0" having a dependency relationship with "signaling-protocol bgp" are selected, and "TAG 1" is added after the three command lines in a similar annotation form, as follows:
Figure GDA0002806614300000051
it should be noted that a command line may have the maximum number of tags supported by the network device, and the relationship between different tags is "or". Still in the above example of command behavior of the startup profile, the TAGs "TAG 1" and "TAG 2" may be added after the command line "signaling-protocol bgp" at the same time, as follows:
signaling-protocol bgp # TAG 1| # TAG 2// configuration view;
here, the "TAG 1" and "TAG 2" following the "signaling-protocol bgp" are in an "OR" relationship, and the "TAG 1" and "TAG 2" do not affect each other.
Fig. 2 is a flowchart illustrating a flow of a method for displaying a command line according to an embodiment of the present invention, where the method includes:
s201: receiving a display instruction;
s202: selecting a target command line and selecting a command line which has a dependency relationship with the target command line according to a target label indicated by the display instruction and a corresponding relationship between the target label and the target command line;
s203: and displaying the target command line and the command line with the dependency relationship with the target command line.
Still in the command behavior example of the start configuration file shown above, after the TAG "TAG 1" and "TAG 2" are added after the "signaling-protocol bgp", and after the TAG "TAG 2" is added after the "pw-class vsi _ vpls _ bgp", when the network device receives a display instruction indicating "TAG 1", according to the stored corresponding relationship between the "TAG 1" and the "signaling-protocol bgp", three command lines of "signaling-protocol bgp" and "vsi vpls _ bgp", "auto-discovery bgp", and "site 3range 33default-offset 0" that have a dependent relationship with the "signaling-protocol bgp" are selected, and the selected command lines are displayed as follows:
Figure GDA0002806614300000061
when the network equipment receives a display instruction indicating 'TAG 2', three command lines of 'signaling-protocol bgp' and 'vsi vpls _ bgp', 'auto-discovery bgp' and 'site 3range 33default-offset 0' which have a dependent relationship with the 'signaling-protocol bgp' are selected according to the stored corresponding relationship between the 'TAG 2' and the 'signaling-protocol bgp';
selecting two command lines of ' pw-class vsi _ vpls _ bgp ' and ' vsi vpls _ bgp ' which has a dependent relationship with ' pw-class vsi _ vpls _ bgp ' and auto-discovery bgp ' according to the corresponding relationship of the ' TAG 2 ' and the ' pw-class vsi _ vpls _ bgp ';
the selected command line is displayed as follows:
Figure GDA0002806614300000062
in practical application, after the network device is started, the command line in the start configuration file can be loaded into the command line library in the memory to be uniformly stored, and meanwhile, an index table for the target command line is established according to the target tag. When the target command line needs to be displayed, the target command line can be quickly acquired according to the target tag in the index table.
It should be noted that the target label indicated by the display instruction may include a plurality of labels, for example, the target label indicated by the display instruction includes "TAG 1" and "TAG 2".
FIG. 3 is a flow chart illustrating a method flow for modifying a command line provided by an embodiment of the invention, the method comprising:
s301: receiving a modification instruction;
s302: determining a displayed target command line and a command line to be modified in the command lines which have a dependency relationship with the target command line according to the identification of the command line to be modified indicated by the modification instruction;
s303: modifying the command line to be modified according to the modification data indicated by the modification instruction;
s304: the modified command line is saved.
Still in the command behavior example of the startup configuration file shown above, the displayed target command behavior "signaling-protocol bgp" has all the displayed command lines:
Figure GDA0002806614300000071
if the network device receives a modification instruction indicating that the identifier of the command line to be modified is "site 3range 33default-offset 0" and the modification data is "site 3range 21default-offset 1", modifying "site 3range 33default-offset 0" according to "site 3range 21default-offset 1", and modifying the displayed command line:
Figure GDA0002806614300000072
the modified "site 3range 21default-offset 1" is saved.
Fig. 4 is a flowchart illustrating a flow of a method for exporting a command line according to an embodiment of the present invention, where the method includes:
s401: receiving a derivation instruction;
s402: selecting a target command line and selecting a command line which has a dependency relationship with the target command line according to a target label indicated by the export instruction and a corresponding relationship between the target label and the target command line;
s403: and writing the target command line and the command line which has a dependency relationship with the target command line into a first preset file pointed by the export instruction.
Still in the command behavior example of the start configuration file shown above, after the command line "signaling-protocol bgp" is added with the TAGs "TAG 1" and "TAG 2", and after the command line "sign-protocol bgp" is added with the TAG "TAG 2", when the network device receives the derivation instruction indicating "TAG 1", according to the stored correspondence between "TAG 1" and "signaling-protocol bgp", three command lines "signaling-protocol bgp" and "vsi vpls _ bgp", "auto-discovery bgp", and "site 3range 33default-offset 0" that have a dependency relationship with "signaling-protocol bgp" are selected; will be provided with
Figure GDA0002806614300000081
And exporting the first preset file pointed by the instruction.
Therefore, when other network devices need to realize the function corresponding to the command line in the first preset file, the first preset file can be directly imported without modifying the command line, and the operation speed of the command line is accelerated.
Fig. 5 is a flowchart illustrating a flow of a method for importing a command line according to an embodiment of the present invention, where the method includes:
s501: receiving an import instruction;
s502: selecting a target command line and selecting a command line with a dependency relation with the target command line according to a target label indicated by the import instruction and the corresponding relation between the target label and the target command line;
s503: and replacing the target command line corresponding to the target label and the command line with a dependency relation with the target command line according to the command line of the second preset file record pointed by the import instruction.
Still in the command behavior example of the start configuration file shown above, after adding the TAGs "TAG 1" and "TAG 2" after "signaling-protocol bgp", and after adding the TAG "TAG 2" after "pw-class vsi _ vpls _ bgp", when the network device receives an import instruction indicating "TAG 1", according to the stored corresponding relationship between "TAG 1" and "signaling-protocol bgp", three command lines of "signaling-protocol bgp" and "vsi vpls _ bgp", "auto-discovery bgp", and "site 3range 33default-offset 0" that have a dependent relationship with "signaling-protocol bgp" are selected;
replacing a target command line corresponding to the target label and a command line with a dependency relation with the target command line by a command line recorded in a second preset file pointed by the import instruction; if the command behavior recorded by the second preset file is:
vsi vpls _ bgp// configuration view
auto-discovery bgp// configuration view
signaling-protocol bgp # TAG 1// configuration view;
the command behavior of the replaced startup profile is:
Figure GDA0002806614300000091
at this time, the network device may select the target command line and the command line having a dependency relationship with the target command line, and then directly replace the selected command line with the command line in the second preset file, thereby simplifying the modification operation on the command line and accelerating the operation speed of editing the command line.
Fig. 6 is a flowchart illustrating a flow of a method for deleting a command line according to an embodiment of the present invention, where the method includes:
s601: receiving a deleting instruction;
s602: selecting a target command line according to the target label indicated by the deleting instruction and the corresponding relation between the target label and the target command line;
s603: and deleting the target label corresponding to the target command line.
When a tag is a useless tag, for example: when the command line corresponding to a tag does not change, the tag may be determined as a useless tag, and the useless tag may be deleted in order to save the storage space of the network device.
Still in the above example of the command behavior of the start configuration file, after adding the TAGs "TAG 1" and "TAG 2" after "signaling-protocol bgp" and adding the TAG "TAG 2" after "pw-class vsi _ vpls _ bgp", the correspondence between the saved TAGs and the command line is as follows:
signaling-protocol bgp # TAG 1| # TAG 2// configuration view
pw-class vsi _ vpls _ bgp # TAG 2// configure command line;
when the network equipment receives a deleting instruction indicating 'TAG 1', selecting a target command line as 'signaling-protocol bgp' according to the stored corresponding relation between 'TAG 1' and 'signaling-protocol bgp', deleting 'TAG 1' corresponding to the 'signaling-protocol bgp', wherein the corresponding relation between the stored label of 'TAG 1' and the command line is as follows:
signaling-protocol bgp # TAG 2// configuration view
pw-class vsi _ vpls _ bgp # TAG 2// configure command line.
It should be noted that the target tag indicated by the delete instruction may be a tag corresponding to one command line, or may be tags corresponding to all command lines.
It should be noted that the above operations of displaying, modifying, adding a tag, deleting a tag, and the like on the command line are all operations directly on the command line in the memory of the network device, and functions of modifying, adding a tag, and deleting a tag on the command line can be immediately implemented, but when the network device is restarted, the operations on the command line disappear.
In this case, in order to ensure that the operation on the command line does not disappear after the network device is restarted, and in order to improve the operation speed on the command line, the manager may receive a save instruction into the network device; after the network device receives the saving instruction, the network device may select the target command line according to the target tag indicated by the saving instruction and the corresponding relationship between the target tag and the target command line, and store the target command line in the start configuration file. Therefore, after the network equipment is restarted, all command lines and tags in the local startup configuration file can be loaded into the memory, and the operation of the network equipment is not influenced.
The command lines are stored according to the target tags, so that the problem that temporarily invalid command lines are lost when all the command lines in the whole memory are stored is solved; meanwhile, the command lines are stored according to the target tags, so that the problem that redundant command lines can be stored in the starting configuration file is solved; in addition, only the target command line corresponding to the target tag and the command line which has a dependency relationship with the target command line are stored, instead of storing all the command lines in the memory, so that the operation speed of the command lines is improved.
By applying the embodiment, the tag adding instruction is received, the target command line pointed by the tag adding instruction is selected from all the stored command lines, the target tag pointed by the tag adding instruction is added to the target command line, and the corresponding relation between the target tag and the target command line is stored. At this time, the operation can be performed with the tag as the object, and the command line corresponding to the target tag is operated without performing the operation with the whole startup configuration file as the object, so that the operation speed of the command line is increased, and the operation efficiency is improved.
Fig. 7 is a block diagram of an apparatus for configuring a command line tag according to an embodiment of the present invention, where the apparatus includes:
a storage unit 701 for storing a command line;
a receiving unit 702, configured to receive a tag addition instruction;
the control unit 703 selects a target command line pointed by the tag adding instruction from the stored command lines, and adds a target tag pointed by the tag adding instruction to the target command line; the correspondence between the target tag and the target command line is stored in the storage unit 701.
In other embodiments of the present invention, the receiving unit 702 is further configured to receive a display instruction;
the control unit 703 is further configured to select a target command line and a command line having a dependency relationship with the target command line according to the target tag indicated by the display instruction and the corresponding relationship between the target tag and the target command line;
in this case, the configuration device may further include:
and a display unit (not shown in fig. 7) for displaying the target command line and the command lines having a dependency relationship with the target command line.
In other embodiments of the present invention, the receiving unit 702 is further configured to receive a modification instruction;
the control unit 703 is further configured to determine, according to the identifier of the command line to be modified indicated by the modification instruction, the displayed target command line and the command line to be modified in the command lines having a dependency relationship with the target command line; modifying the command line to be modified according to the modification data indicated by the modification instruction; the modified command line is stored in the memory unit 701.
In other embodiments of the present invention, the receiving unit 702 is further configured to receive an export instruction;
the control unit 703 is further configured to select a target command line and a command line having a dependency relationship with the target command line according to the target tag indicated by the derivation instruction and the corresponding relationship between the target tag and the target command line; and writing the target command line and the command line which has a dependency relationship with the target command line into a first preset file stored in the storage unit 701 to which the export instruction points.
In other embodiments of the present invention, the receiving unit 702 is further configured to receive an import instruction;
the control unit 703 is further configured to select a target command line and a command line having a dependency relationship with the target command line according to the target tag indicated by the import instruction and the corresponding relationship between the target tag and the target command line; and replacing the target command line corresponding to the target label and the command line having a dependency relationship with the target command line according to the command line of the second preset file record stored in the storage unit 701 to which the import instruction points.
In other embodiments of the present invention, the receiving unit 702 is further configured to receive a deletion instruction;
the control unit 703 is further configured to select a target command line from the storage according to the target tag indicated by the delete instruction and the corresponding relationship between the target tag stored in the storage unit and the target command line; the target tag corresponding to the target command line is deleted from the storage unit 701.
By applying the embodiment, the tag adding instruction is received, the target command line pointed by the tag adding instruction is selected from all the stored command lines, the target tag pointed by the tag adding instruction is added to the target command line, and the corresponding relation between the target tag and the target command line is stored. At this time, the operation can be performed with the tag as the object, and the command line corresponding to the target tag is operated without performing the operation with the whole startup configuration file as the object, so that the operation speed of the command line is increased, and the operation efficiency is improved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method for configuring a command line tag, applied to a network device, the method comprising:
receiving a label adding instruction;
selecting a target command line pointed by the tag adding instruction from all stored command lines;
adding a target label indicated by the label adding instruction to the target command line;
storing the corresponding relation between the target label and the target command line;
after configuring the command line tag, the network device may further receive a corresponding command, select a target command line according to a target tag indicated by the corresponding command and a corresponding relationship between the stored target tag and the target command line, and execute the corresponding command on the selected target command line.
2. The method according to claim 1, wherein when the corresponding instruction is a display instruction, the method comprises:
receiving a display instruction;
selecting the target command line and selecting the command line with a dependency relation with the target command line according to the target label indicated by the display instruction and the corresponding relation between the target label and the target command line;
and displaying the target command line and the command line with the dependency relationship with the target command line.
3. The method of claim 2, further comprising:
receiving a modification instruction;
determining the displayed target command line and the command line to be modified in the command lines which have a dependency relationship with the target command line according to the identification of the command line to be modified pointed by the modification instruction;
modifying the command line to be modified according to modification data indicated by the modification instruction;
the modified command line is saved.
4. The method of claim 1, wherein when the corresponding instruction is a derived instruction, the method comprises:
receiving a derivation instruction;
selecting the target command line and selecting a command line which has a dependency relationship with the target command line according to the target tag indicated by the export instruction and the corresponding relationship between the target tag and the target command line;
and writing the target command line and the command line which has a dependency relationship with the target command line into a first preset file pointed by the export instruction.
5. The method of claim 4, further comprising:
receiving an import instruction;
selecting the target command line and selecting the command line with a dependency relation with the target command line according to the target label indicated by the import instruction and the corresponding relation between the target label and the target command line;
and replacing a target command line corresponding to the target label and a command line having a dependency relationship with the target command line according to the command line of the second preset file record pointed by the import instruction.
6. The method according to claim 1, wherein when the corresponding instruction is a delete instruction, the method comprises:
receiving a deleting instruction;
selecting the target command line from the stored corresponding relation between the target tag and the target command line according to the target tag indicated by the deleting instruction and the stored corresponding relation between the target tag and the target command line;
and deleting the target label corresponding to the target command line.
7. An apparatus for configuring a command line tag, applied to a network device, the apparatus comprising:
a storage unit for storing a command line;
a receiving unit for receiving a tag addition instruction;
the control unit selects a target command line pointed by the tag adding instruction from stored command lines and adds a target tag pointed by the tag adding instruction to the target command line; storing the corresponding relation between the target label and the target command line in the storage unit;
after configuring the command line tag, the network device may further receive a corresponding command, select a target command line according to a target tag indicated by the corresponding command and a corresponding relationship between the stored target tag and the target command line, and execute the corresponding command on the selected target command line.
8. The apparatus of claim 7, further comprising a display unit;
the receiving unit is further configured to receive a display instruction, where the display instruction is the corresponding instruction;
the control unit is further configured to select the target command line and select a command line having a dependency relationship with the target command line according to the target tag indicated by the display instruction and the corresponding relationship between the target tag and the target command line;
and the display unit is used for displaying the target command line and the command line which has a dependency relationship with the target command line.
9. The apparatus of claim 8,
the receiving unit is further used for receiving a modification instruction;
the control unit is further configured to determine, according to the identifier of the command line to be modified to which the modification instruction points, the target command line that has been displayed and the command line to be modified in the command lines having a dependency relationship with the target command line; modifying the command line to be modified according to modification data indicated by the modification instruction; and storing the modified command line in the storage unit.
10. The apparatus of claim 7,
the receiving unit is further configured to receive a derivation instruction, where the derivation instruction is the corresponding instruction;
the control unit is further configured to select the target command line and select a command line having a dependency relationship with the target command line according to the target tag indicated by the derivation instruction and the corresponding relationship between the target tag and the target command line; and writing the target command line and the command line which has a dependency relationship with the target command line into a first preset file stored in the storage unit pointed by the export instruction.
11. The apparatus of claim 10,
the receiving unit is further used for receiving an import instruction;
the control unit is further configured to select the target command line and select a command line having a dependency relationship with the target command line according to the target tag indicated by the import instruction and the corresponding relationship between the target tag and the target command line; and replacing a target command line corresponding to the target label and a command line having a dependency relationship with the target command line according to the command line of the second preset file record stored in the storage unit pointed by the import instruction.
12. The apparatus of claim 7,
the receiving unit is further configured to receive a deletion instruction, where the deletion instruction is the corresponding instruction;
the control unit is further configured to select the target command line from the stored correspondence between the target tag and the target command line according to the target tag indicated by the delete instruction and the correspondence between the target tag and the target command line stored in the storage unit; and deleting the corresponding relation between the target label corresponding to the target command line and the target command line from the storage unit.
CN201710209902.XA 2017-03-31 2017-03-31 Method and device for configuring command line tag Active CN106921524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710209902.XA CN106921524B (en) 2017-03-31 2017-03-31 Method and device for configuring command line tag

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710209902.XA CN106921524B (en) 2017-03-31 2017-03-31 Method and device for configuring command line tag

Publications (2)

Publication Number Publication Date
CN106921524A CN106921524A (en) 2017-07-04
CN106921524B true CN106921524B (en) 2021-12-17

Family

ID=59567103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710209902.XA Active CN106921524B (en) 2017-03-31 2017-03-31 Method and device for configuring command line tag

Country Status (1)

Country Link
CN (1) CN106921524B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090453B (en) * 2019-11-15 2022-07-08 苏州浪潮智能科技有限公司 Equipment configuration method, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6392668B1 (en) * 1999-11-12 2002-05-21 Kendara, Inc. Client-side system and method for network link differentiation
JP2008225728A (en) * 2007-03-12 2008-09-25 Sanyo Electric Co Ltd Referral letter creation support device
CN102257498A (en) * 2011-05-31 2011-11-23 华为技术有限公司 Comment generation method of configuration files and configuration file generation device
CN102651698A (en) * 2012-04-28 2012-08-29 华为技术有限公司 Network management method, network management system and network elements
CN103577072A (en) * 2012-07-26 2014-02-12 中兴通讯股份有限公司 Terminal voice assistant editing method and device
CN105187241A (en) * 2015-08-19 2015-12-23 浪潮(北京)电子信息产业有限公司 Log recording method and system based on linux kernel

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070006152A1 (en) * 2005-06-29 2007-01-04 Microsoft Corporation Software source asset management
CN104991793B (en) * 2015-06-15 2019-04-02 上海海漾软件技术有限公司 A kind of method, apparatus and system for application program subpackage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6392668B1 (en) * 1999-11-12 2002-05-21 Kendara, Inc. Client-side system and method for network link differentiation
JP2008225728A (en) * 2007-03-12 2008-09-25 Sanyo Electric Co Ltd Referral letter creation support device
CN102257498A (en) * 2011-05-31 2011-11-23 华为技术有限公司 Comment generation method of configuration files and configuration file generation device
CN102651698A (en) * 2012-04-28 2012-08-29 华为技术有限公司 Network management method, network management system and network elements
CN103577072A (en) * 2012-07-26 2014-02-12 中兴通讯股份有限公司 Terminal voice assistant editing method and device
CN105187241A (en) * 2015-08-19 2015-12-23 浪潮(北京)电子信息产业有限公司 Log recording method and system based on linux kernel

Also Published As

Publication number Publication date
CN106921524A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
KR102240557B1 (en) Method, device and system for storing data
US9292217B2 (en) Logical volume space sharing
CN108287669B (en) Date storage method, device and storage medium
CN102508784B (en) Data storage method of flash memory card in video monitoring equipment, and system thereof
CN112464625B (en) Document generation method, device, computer equipment and storage medium
CN109902255B (en) Page mixed browsing record generation method, device, equipment and storage medium
CN105677904B (en) Small documents storage method and device based on distributed file system
CN104750565A (en) NAND bad block processing method and NAND flash memory device
CN103617209A (en) File management method and device for a mobile terminal
CN101983376A (en) Access device, information recording device, information recording system, file management method, and program
CN103399781A (en) Cloud server and virtual machine management method thereof
CN111680477A (en) Method, device, computer equipment and storage medium for exporting spreadsheet file
CN112528189B (en) Data-based component packaging method, device, computer equipment and storage medium
CN109542841B (en) Method for creating data snapshot in cluster and terminal equipment
CN109491962A (en) A kind of file directory tree management method and relevant apparatus
WO2016107219A1 (en) Data recovery method and apparatus
CN110119386B (en) Data processing method, data processing apparatus, medium, and computing device
CN108205482B (en) File mount restoration methods
CN106921524B (en) Method and device for configuring command line tag
CN107148612A (en) A method and device for expanding user partitions
CN117348919A (en) Information configuration method, information configuration device, computer equipment and storage medium
US12118245B2 (en) File system improvements for zoned storage device operations
CN118689741B (en) Information management method, device, medium and program product
CN112379831B (en) Data management method, device, computer equipment and storage medium
US20170357657A1 (en) Systems and methods for implementing dynamic file systems

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