Nothing Special   »   [go: up one dir, main page]

CN111147400B - Method and device for command line configuration synchronization and electronic equipment - Google Patents

Method and device for command line configuration synchronization and electronic equipment Download PDF

Info

Publication number
CN111147400B
CN111147400B CN201911227499.9A CN201911227499A CN111147400B CN 111147400 B CN111147400 B CN 111147400B CN 201911227499 A CN201911227499 A CN 201911227499A CN 111147400 B CN111147400 B CN 111147400B
Authority
CN
China
Prior art keywords
command
backup
terminal equipment
backed
mode
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
CN201911227499.9A
Other languages
Chinese (zh)
Other versions
CN111147400A (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201911227499.9A priority Critical patent/CN111147400B/en
Publication of CN111147400A publication Critical patent/CN111147400A/en
Application granted granted Critical
Publication of CN111147400B publication Critical patent/CN111147400B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a method for command line configuration synchronization, which comprises the following steps: receiving and analyzing a command input by a user; checking whether a specified identifier is set in the command during registration, wherein the specified identifier is used for indicating that the command is backed up to opposite terminal equipment; under the condition that the command is determined to be backed up to the opposite terminal equipment, backing up the command to the opposite terminal equipment, and executing the command at the local terminal equipment; and under the condition that the command is determined not to be backed up to the opposite terminal equipment, directly executing the command at the local terminal equipment. In addition, the application also provides a corresponding device and electronic equipment. The application is simple to realize and high in efficiency.

Description

Method and device for command line configuration synchronization and electronic equipment
Technical Field
The present application relates to the field of configuration synchronization, and in particular, to a method and an apparatus for synchronization of command line configuration, and an electronic device.
Background
When the configuration is performed on the main device through the command line in the backup mode, it is usually default to synchronize all the configuration commands executed on the main device with the backup device, but some configuration commands do not need to be synchronized with the backup device, and if the configuration commands are synchronized with the backup device, the function of the service module on the backup device may be abnormal. This implementation is complex and labor intensive.
Disclosure of Invention
In view of this, the present disclosure provides a method, an apparatus, and an electronic device for command line configuration synchronization.
In a first aspect, the present application provides a method for command line configuration synchronization for a device performing configuration synchronization by a command line, the method comprising:
receiving and analyzing a command input by a user;
checking whether a specified identifier is set in the command during registration, wherein the specified identifier is used for indicating that the command is backed up to opposite terminal equipment;
under the condition that the command is determined to be backed up to the opposite terminal equipment, backing up the command to the opposite terminal equipment, and executing the command at the local terminal equipment;
and under the condition that the command is determined not to be backed up to the opposite terminal equipment, directly executing the command at the local terminal equipment.
In a second aspect, the present application provides an apparatus for command line configuration synchronization, the apparatus comprising:
the receiving module is used for receiving and analyzing a command input by a user;
the checking module is used for checking whether a specified identifier is set during the registration of the command, wherein the specified identifier is used for indicating whether the command is allowed to be backed up to the opposite terminal equipment;
the execution module is used for backing up the command to the opposite terminal equipment and executing the command at the local terminal equipment under the condition that the command is backed up to the opposite terminal equipment;
and under the condition that the command is determined not to be backed up to the opposite terminal equipment, directly executing the command at the local terminal equipment.
In a third aspect, the present application provides an electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for command line configuration synchronization in the above method embodiments.
The method and the device set a designated identifier in advance for the command, check whether the command carries the designated identifier after the local terminal device receives and analyzes the command input by the user, and determine whether the command needs to be sent to the opposite terminal device for backup on the premise of the designated identifier.
Drawings
FIG. 1 is a flow chart illustrating a method for command line configuration synchronization in accordance with an exemplary embodiment of the present application.
Fig. 2 is a flow diagram illustrating a method for specifying synchronization of a command line configuration identified as allowing backup commands in virtual switch matrix mode according to an exemplary embodiment of the present application.
FIG. 3 is a flow chart illustrating a method for specifying synchronization of command line configurations identified as allowing backup commands in dual-machine hot-standby mode according to an exemplary embodiment of the present application.
FIG. 4 is a schematic diagram of an apparatus for command line configuration synchronization according to an exemplary embodiment of the present application.
Fig. 5 is a schematic diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application 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 and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
When the configuration is performed on the main device through the command line in the backup mode, it is usually default to synchronize all the configuration commands executed on the main device with the backup device, but some configuration commands do not need to be synchronized with the backup device, and if the configuration commands are synchronized with the backup device, the function of the service module on the backup device may be abnormal. This implementation is complex and labor intensive.
Therefore, the application provides a method for setting whether the configuration command is backed up in a self-defined manner, and the method is used for configuring synchronous equipment through a command line. FIG. 1 is a flow chart illustrating a method for command line configuration synchronization according to an exemplary embodiment of the present application, as shown in FIG. 1, including the steps of:
step S101, receiving and analyzing a command input by a user;
step S102, checking whether the command is provided with a specified identifier during registration, wherein the specified identifier is used for indicating whether the command is allowed to be backed up to opposite terminal equipment;
step S103, under the condition that the command is determined to be backed up to the opposite terminal equipment, backing up the command to the opposite terminal equipment, and executing the command at the local terminal equipment;
step S104, under the condition that the command is not backed up to the opposite terminal equipment, the command is directly executed at the local terminal equipment.
When a user registers a command, the user may add related information required when registering the command, such as view information, module information, a command prototype, a command execution function, a command help function, and the like of the command, to a pre-defined cmd _ element command structure array for storing related information of the command, and add a backup _ mode member to the cmd _ element command structure array for storing a specified identifier, which is set by the user for the command to be registered, for indicating whether to allow the command to be backed up to a peer device.
If the user wants to make the command input in the command line not only execute in the local device, but also back up the command to the opposite device, the user may set a specified identification for the command indicating that the command is allowed to be backed up to the peer device when registering the command, it may also be defined in the specified identity in what mode the command can be backed up to the peer device, and the specified identification is stored in backup _ mode, if the user only wants to make the command input in the command line execute in the local terminal without backing up to the opposite terminal device, the specified identification may not be set for the command at the time of registering the command, or the set specified identification indicates that the command is not allowed to be backed up to the peer device, for example, the command is not allowed to be backed up to the opposite terminal device in the designated mode, and the designated mode can refer to a virtual switch matrix mode or a dual-machine hot standby mode and other working modes.
In step S101, when a user inputs a command through a command line for configuration, the command line framework receives the command input by the user and then parses the input command, and queries an execution program corresponding to the command by traversing the registered command structure array.
In step S102, with respect to the execution program corresponding to the command queried in step S101, it is first checked whether a designation flag is set in the execution program. When step S103 is executed, it is assumed that the check result of step S102 is used as a premise, and as for a manner of determining whether to execute the command backup to the peer device, there may be a plurality of implementation manners:
for example, in step S103, if it is checked that the command input by the user is provided with the specified identifier at the time of registration, it is determined that the command needs to be backed up to the peer device.
For another example, in step S103, if it is checked that the command input by the user is provided with the specified identifier, it is further required to continuously check whether the backup environments of the devices at the two ends meet the preset condition, and when the preset condition is met, it is determined to perform the backup of the command to the device at the opposite end. For example, a check is made to determine if there is an anomaly in the network, if there is an anomaly in the inter-device communication, or if the versions between the devices are consistent, etc.
Since the backup environments required when the device operates in different modes may be different, the preset conditions set in the different modes may also be different. For example:
the specific identifier set for the command by the user when registering the command may include multiple types of specific identifiers, where the different types of specific identifiers indicate whether the command is allowed to be backed up to the peer device in different modes.
In an embodiment, if the device supports both a VSM mode and a dual-computer hot-standby mode, the designated identifier may include an identifier that allows the command to be backed up to the peer device in a Virtual Switch Matrix (VSM) mode and an identifier that allows the command to be backed up to the peer device in a dual-computer hot-standby mode.
Taking the VSM mode and the dual-computer backup mode as examples, preset conditions required to be met by respective backup environments in the two modes are described one by one.
If the specified identifier is an identifier that allows a backup command in VSM mode, then further checking whether the current backup context meets preset conditions that need to be met for backup of such a device while in operating mode includes, but is not limited to, the following:
(1) checking whether a virtual switching matrix mode of the local terminal equipment is enabled;
the precondition for backing up the command to the opposite terminal device in the virtual switch matrix mode is to ensure that the local terminal device has already started the virtual switch matrix mode.
(2) Checking whether the local terminal equipment is a main equipment in the virtual switching matrix;
in the virtual switch matrix mode, a command is usually backed up from the main member device to other standby member devices, so that it is necessary to determine whether the local device is the main device, and if not, a command for initiating backup to other devices is not necessary.
(3) It is checked whether the state of the other standby devices in the virtual switching matrix is the startup complete state.
If the other devices in the virtual switch matrix mode are not started, the backup instruction of the main device cannot be received, and the backup data cannot be acquired, so that the backup failure is caused.
Therefore, only when the virtual switch matrix mode of the local device is started, the local device is the main device in the virtual switch matrix, and the other standby devices in the virtual switch matrix are in the starting completion state, the current backup environment is determined to meet the backup requirement, the command input by the user can be backed up to the opposite device and executed on the local device, otherwise, the command input by the user is not backed up to the opposite device, and the command is directly executed on the local device.
In an embodiment, if the specified identifier is an identifier that allows the command to be backed up to the peer device in the dual-server hot-standby mode, further checking whether the current backup environment meets a preset condition that needs to be met by the backup of the device in the working mode, where the specific content that needs to be checked includes, but is not limited to, the following:
(1) checking whether the local terminal equipment starts a dual-computer hot standby mode;
the precondition of the command to the opposite terminal device backup in the dual-computer hot-standby mode is to ensure that the local terminal device has already started the dual-computer hot-standby mode.
(2) And checking whether the local terminal equipment is the main equipment in the dual-computer hot standby mode.
In the dual-computer hot standby mode, a command is usually backed up from the main device to the standby device, so that whether the local device is the main device needs to be determined, and if the local device is not the main device, a backup command does not need to be initiated to other devices.
Therefore, only when the local terminal device is checked to have enabled the dual-computer hot-standby mode and the local terminal device is the main device in the dual-computer hot-standby mode at the same time, it is determined that the current backup environment meets the backup requirement, and the command input by the user can be backed up to the opposite terminal device and executed at the local terminal device. Otherwise, the command input by the user is not backed up to the opposite terminal equipment, and the command is directly executed on the local terminal equipment.
There are many possibilities for determining not to execute the command backup to the peer device in step S104, and when the scheme disclosed in the present application is used, the scheme may be adaptively adjusted or changed according to the actual application requirements. For example, an example where the peer does not execute the command may be any one or more of the following:
for example, the command is not provided with the specified identifier at the time of registration; or
The designated identifier indicates that the command is not allowed to be backed up to the opposite terminal device in a designated mode, such as a VSM mode or a dual-computer hot-standby mode.
In addition, although the command is provided with a specified identifier, the specified identifier allows the command to be backed up to the opposite terminal in a certain specified mode, but the backup environment of the devices at the two terminals does not meet the preset condition. Also, the preset conditions may be different in different operation modes, such as:
if the specified identifier indicates that the command is allowed to be backed up to the peer device in the VSM mode, the preset condition may refer to the preset condition in the VSM mode, and the reason why the preset condition is not met may be: the virtual switching matrix mode of the local terminal equipment is not started, or the local terminal equipment is not the main equipment in the virtual switching matrix, or the standby equipment state in the virtual switching matrix is not the starting completion state.
And when the specified identifier indicates that the command is allowed to be backed up to the peer device in the dual-server hot-standby mode, the preset condition may refer to the preset condition in the dual-server hot-standby mode described above. The reason why the preset condition is not satisfied may be: the local terminal device does not start the dual-computer hot-standby mode, or the local terminal device is not the main device in the dual-computer hot-standby mode.
In an embodiment, the method for synchronizing the command input by the user to the peer device may be to establish a socket connection with a command line process of the peer device, send the backup command to the peer device through the socket connection, and obtain an execution result of the peer device on the backup command.
For the case that a device only supports VSM mode, fig. 2 is a flowchart of a method for specifying synchronization of a command line configuration identified as allowing backup commands in VSM mode according to an exemplary embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
step S201: receiving and analyzing a command input by a user;
step S202: checking whether a command input by a user sets a specified identifier for indicating to back up the command to opposite terminal equipment during registration, if so, executing a step S203, otherwise, executing a step S206;
step S203: checking whether the specified identification is the specified identification which allows the command to be backed up in the virtual switch matrix mode, if so, executing the step S204, otherwise, executing the step S206;
step S204: checking whether the current backup environment meets the backup requirement, if so, executing step S205, otherwise, executing step S206;
step S205: backing up the command to the opposite terminal device and executing step S206;
step S206: and executing the command at the local terminal equipment.
In the flowchart shown in fig. 2, when it is checked that the command sets the specified identifier of the command that allows backup in the VSM mode during registration, the local device determines that the command needs to be backed up to the opposite device, and finally determines whether to back up the command to the opposite device after further checking whether the backup environment meets the requirement. If the command is checked not to set the designated identifier during registration, it is determined that the command does not need to be backed up to the opposite terminal device, and the command can be directly executed at the local terminal device.
If the specified identification is not the specified identification allowing the command to be backed up in the VSM mode, the command cannot be backed up to the opposite terminal equipment in the VSM mode, and the command is directly executed on the local terminal equipment.
Checking whether the current backup environment meets the backup requirement in a VSM mode, mainly checking whether the VSM mode of local equipment is started, whether the local equipment is a main device in the VSM and whether the states of other standby devices in the VSM are starting completion states, and if the VSM mode of the local equipment is started, the local equipment is a main device in the VSM and the states of other standby devices in the VSM are starting completion states, judging that the current backup environment meets the backup requirement; and if the current backup environment does not meet the backup requirement, directly executing the command on the local terminal equipment.
When the current backup environment meets the backup requirement, backing up the command to the opposite terminal device, and executing the command at the local terminal device, wherein the specific way of backing up the command to the opposite terminal device may be to send the backup command to the opposite terminal device and obtain the execution result of the opposite terminal device on the backup command.
For a situation that a certain device only supports the dual-device hot-standby mode, fig. 3 is a flowchart of a method for specifying an identifier indicating a command line configuration synchronization allowing a command to be backed up in the dual-device hot-standby mode, as shown in fig. 3, including the following steps:
step S301: receiving and analyzing a command input by a user;
step S302: checking whether a command input by a user sets a specified identifier for indicating to back up the command to opposite terminal equipment during registration, if so, executing a step S303, otherwise, executing a step S306;
step S303: checking whether the designated backup identifier is an identifier for allowing a backup command in a dual-computer hot-standby mode, if so, executing a step S304, otherwise, executing a step S306;
step S304: checking whether the current backup environment meets the backup requirement, if so, executing step S305, otherwise, executing step S306;
step S305: backing up the command to the opposite terminal equipment and executing the step S306;
step S306: and executing the command at the local terminal equipment.
In the flowchart shown in fig. 3, after receiving a command input by a user, a local device parses the command, checks whether a specified identifier for instructing to backup the command to an opposite device is set in the command during registration, determines that the command needs to be backed up to the opposite device when checking that the specified identifier is set in the command during registration, determines that the command does not need to be backed up to the opposite device if checking that the specified identifier is not set in the command during registration, and may directly execute the command at the local device.
And when checking that the command sets a specified identifier during registration, checking whether the specified identifier is the specified identifier indicating that the backup command in the dual-computer hot standby mode is allowed. If the specified identification is a specified identification of a dual-computer hot standby mode, further checking whether the backup environment in the mode meets the requirement; if the specified identification is not the one allowing the dual-computer hot-standby mode backup command, the command cannot be backed up to the opposite terminal device in the dual-computer hot-standby mode, and the command is directly executed on the local terminal device.
Checking whether the current backup environment meets the backup requirement, mainly checking whether a dual-computer hot-standby mode of the local terminal equipment is started, whether the local terminal equipment is a main equipment in dual-computer hot standby and whether the states of other standby equipment in dual-computer hot standby are starting completion states, and judging that the current backup environment meets the backup requirement if the dual-computer hot-standby mode of the local terminal equipment is started, the local terminal equipment is the main equipment in dual-computer hot standby and the states of other standby equipment in dual-computer hot standby are starting completion states; and if the current backup environment does not meet the backup requirement, directly executing the command on the local terminal equipment.
When the current backup environment meets the backup requirement, backing up the command to the opposite terminal device, and executing the command at the local terminal device, wherein the specific way of backing up the command to the opposite terminal device may be to send the backup command to the opposite terminal device and obtain the execution result of the opposite terminal device on the backup command.
It is easy to understand that if a device supports both the VMS mode and the dual-server hot-standby mode, after receiving and parsing a command input by a user, it may check whether a specific identifier of a backup command allowed in the VSM mode or a specific identifier of a backup command allowed in the dual-server hot-standby mode is set in the command input by the user during registration, and if one of the specific identifiers is set, the present solution may be implemented with reference to the flow in the corresponding mode shown in fig. 2 or fig. 3.
Corresponding to the foregoing embodiments of the method for command line configuration synchronization, the present application also provides embodiments of an apparatus for command line configuration synchronization.
Fig. 4 is a schematic diagram of an apparatus for command line configuration synchronization according to an exemplary embodiment of the present application, as shown in fig. 4, including:
a receiving module 401, configured to receive and analyze a command input by a user;
a checking module 402, configured to check whether a specified identifier is set in the command during registration, where the specified identifier is used to indicate whether to allow the command to be backed up to a peer device;
an executing module 403, configured to backup the command to the peer device and execute the command at the local device, if it is determined that the command is backed up to the peer device;
and under the condition that the command is determined not to be backed up to the opposite terminal equipment, directly executing the command at the local terminal equipment.
In one embodiment, the determining, by the execution module 403, not to execute the command to backup to the peer device includes:
the command is not provided with the specified identification during registration; or
The appointed identification indicates that the command is not allowed to be backed up to the opposite terminal device in an appointed mode, and the appointed mode comprises a virtual switch matrix mode or a dual-machine hot standby mode.
In one embodiment, the determining, by the execution module 403, to execute the backup of the command to the peer device includes:
the command is provided with an appointed identification, and the backup environments of the two-end equipment meet preset conditions.
In an embodiment, the specified identifier is an identifier that allows the command to be backed up to the peer device in the virtual switch matrix mode, and the preset condition includes: the method comprises the following steps that a virtual switching matrix mode of local end equipment is started, the local end equipment is main equipment in a virtual switching matrix, and the state of standby equipment in the virtual switching matrix is a starting completion state;
the specified identifier is an identifier allowing to backup the command to the opposite terminal device in the dual-computer hot standby mode, and the preset condition includes: the local terminal device is started to be in the dual-computer hot-standby mode, and the local terminal device is the main device in the dual-computer hot-standby mode.
In addition, in an embodiment, the determining, by the execution module 403, not to execute the command to backup the peer device may further include:
the command is provided with an appointed identification, but the backup environment of the two-end equipment does not accord with the preset condition.
In one embodiment, the step of backing up the command to the peer device by the execution module 403 includes:
and establishing socket connection with a command progress of the opposite terminal equipment, sending a backup command to the opposite terminal equipment and acquiring an execution result of the backup command.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the device for command line configuration synchronization can be applied to electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 5, a hardware structure diagram of an electronic device where a device for configuring and synchronizing a command line is located in the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the electronic device where the device is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Wherein the non-volatile memory is configured to store the processor-executable instructions, and the processor is configured to execute the instructions to implement the method for command line configuration synchronization according to any of the above embodiments.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (7)

1. A method for command line configuration synchronization for a device performing configuration synchronization via a command line, the method comprising:
receiving and analyzing a command input by a user;
checking whether the command is provided with a specified identifier, wherein the specified identifier is used for indicating whether the command is allowed to be backed up to a peer device, and the specified identifier is set by a user when the command is registered;
under the condition that the designated identification is set in the command and the backup environments of the two end devices meet the preset conditions, backing up the command to the opposite end device and executing the command on the local end device;
and under the condition that the command is determined not to be backed up to the opposite terminal equipment based on the specified identification, directly executing the command at the local terminal equipment.
2. The method according to claim 1, wherein the specified identifier is an identifier that allows the command to be backed up to the peer device in the virtual switch matrix mode, and the preset condition includes: the method comprises the following steps that a virtual switching matrix mode of local end equipment is started, the local end equipment is main equipment in a virtual switching matrix, and the state of standby equipment in the virtual switching matrix is a starting completion state; or
The specified identifier is an identifier allowing to backup the command to the opposite terminal device in the dual-computer hot standby mode, and the preset condition includes: the local terminal device is started to be in the dual-computer hot-standby mode, and the local terminal device is the main device in the dual-computer hot-standby mode.
3. The method of claim 2, wherein the determining not to perform the backup of the command to the peer device comprises:
the command is provided with the specified identification, but the backup environments of the two-end equipment do not accord with the preset condition.
4. The method of claim 1, wherein the determining not to perform the backup of the command to the peer device comprises:
the command is not provided with the specified identification during registration; or
The appointed identification indicates that the command is not allowed to be backed up to the opposite terminal device in an appointed mode, and the appointed mode comprises a virtual switch matrix mode or a dual-machine hot standby mode.
5. The method of claim 1, wherein backing up the command to the peer device comprises:
and establishing socket connection with a command progress of the opposite terminal equipment, sending a backup command to the opposite terminal equipment and acquiring an execution result of the backup command.
6. An apparatus for command line configuration synchronization, the apparatus comprising:
the receiving module is used for receiving and analyzing a command input by a user;
the checking module is used for checking whether the command is provided with a specified identifier, wherein the specified identifier is used for indicating whether the command is allowed to be backed up to the opposite terminal equipment, and the specified identifier is set by a user when the command is registered;
the execution module is used for backing up the command to the opposite terminal equipment and executing the command on the local terminal equipment under the condition that the command is provided with the specified identification and the backup environments of the two terminal equipment meet the preset condition;
and under the condition that the command is determined not to be backed up to the opposite terminal equipment based on the specified identification, directly executing the command at the local terminal equipment.
7. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of command line configuration synchronization of any of claims 1-5.
CN201911227499.9A 2019-12-04 2019-12-04 Method and device for command line configuration synchronization and electronic equipment Active CN111147400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911227499.9A CN111147400B (en) 2019-12-04 2019-12-04 Method and device for command line configuration synchronization and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911227499.9A CN111147400B (en) 2019-12-04 2019-12-04 Method and device for command line configuration synchronization and electronic equipment

Publications (2)

Publication Number Publication Date
CN111147400A CN111147400A (en) 2020-05-12
CN111147400B true CN111147400B (en) 2022-03-01

Family

ID=70517616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911227499.9A Active CN111147400B (en) 2019-12-04 2019-12-04 Method and device for command line configuration synchronization and electronic equipment

Country Status (1)

Country Link
CN (1) CN111147400B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930460B (en) * 2020-08-12 2023-10-24 深圳市友华通信技术有限公司 Configuration method and device of general embedded CLI component

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7003692B1 (en) * 2002-05-24 2006-02-21 Cisco Technology, Inc. Dynamic configuration synchronization in support of a “hot” standby stateful switchover
CN103036668A (en) * 2012-12-11 2013-04-10 上海斐讯数据通信技术有限公司 Rack-mounted equipment tab configuration synchronization method based on a command line
CN105786646A (en) * 2016-02-25 2016-07-20 北京金山安全软件有限公司 Data backup method and device and electronic equipment
CN106209480A (en) * 2016-09-05 2016-12-07 杭州迪普科技有限公司 Synchronize the method and device of configuration information
CN106453586A (en) * 2016-10-31 2017-02-22 宇龙计算机通信科技(深圳)有限公司 Message synchronizing method, device and system
CN106789304A (en) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 Network equipments configuration synchronous method and device
CN106850255A (en) * 2016-12-20 2017-06-13 曙光信息产业(北京)有限公司 A kind of implementation method of multi-computer back-up
CN109739622A (en) * 2018-12-29 2019-05-10 杭州迪普科技股份有限公司 Active and standby master control configuration and synchronization method and device based on frame type equipment
CN110505072A (en) * 2019-09-27 2019-11-26 连尚(新昌)网络科技有限公司 For backing up method, terminal device and the computer-readable medium of chat record

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7003692B1 (en) * 2002-05-24 2006-02-21 Cisco Technology, Inc. Dynamic configuration synchronization in support of a “hot” standby stateful switchover
CN103036668A (en) * 2012-12-11 2013-04-10 上海斐讯数据通信技术有限公司 Rack-mounted equipment tab configuration synchronization method based on a command line
CN105786646A (en) * 2016-02-25 2016-07-20 北京金山安全软件有限公司 Data backup method and device and electronic equipment
CN106209480A (en) * 2016-09-05 2016-12-07 杭州迪普科技有限公司 Synchronize the method and device of configuration information
CN106453586A (en) * 2016-10-31 2017-02-22 宇龙计算机通信科技(深圳)有限公司 Message synchronizing method, device and system
CN106850255A (en) * 2016-12-20 2017-06-13 曙光信息产业(北京)有限公司 A kind of implementation method of multi-computer back-up
CN106789304A (en) * 2016-12-29 2017-05-31 杭州迪普科技股份有限公司 Network equipments configuration synchronous method and device
CN109739622A (en) * 2018-12-29 2019-05-10 杭州迪普科技股份有限公司 Active and standby master control configuration and synchronization method and device based on frame type equipment
CN110505072A (en) * 2019-09-27 2019-11-26 连尚(新昌)网络科技有限公司 For backing up method, terminal device and the computer-readable medium of chat record

Also Published As

Publication number Publication date
CN111147400A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN109510742B (en) Server network card remote test method, device, terminal and storage medium
WO2017185954A1 (en) Method, host, and system for implementing usb device management
CN106648685B (en) Intelligent terminal system application processing method and device and intelligent terminal
CN111669284B (en) OpenStack automatic deployment method, electronic device, storage medium and system
CN108809683B (en) Method and device for deploying cloud application system
CN111190823A (en) UI automation test method, electronic device and computer readable storage medium
CN104615598A (en) Migration processing method and device of metadata server
CN109635561A (en) A kind of method, apparatus that BIOS with BMC password setting is synchronous, terminal and storage medium
CN115469964A (en) Method and device for determining mapping relation between block device and virtual machine disk character
US20240264914A1 (en) Method and device for recovering self-test exception of server component, system and medium
CN111147400B (en) Method and device for command line configuration synchronization and electronic equipment
CN111966530A (en) Disaster recovery switching method and device for application system, computer equipment and storage medium
CN109067735B (en) Dynamic configuration method of communication protocol, wireless communication device and intelligent equipment
CN112328297B (en) Method and device for upgrading Android system running compatibly on Linux
CN108234174B (en) Management method and device of virtual network function
CN112099902A (en) Network adapter configuration method and device of virtual machine, electronic device and storage medium
JP2006113754A (en) Software update device and method
CN113391931B (en) Remote control method and device based on Bluetooth, computer equipment and storage medium
KR20210113595A (en) Anomaly handling method, terminal device and storage medium
CN113282516A (en) Method and device for processing test case result
CN110109707B (en) Terminal starting method and device and terminal
CN112379952A (en) Method for implementing cross-process callback
CN113824620A (en) Partition switching method, device, vehicle and storage medium
US20150195366A1 (en) Switching device, non-transitory computer readable medium and zoning setting method

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