WO2016180089A1 - Method and apparatus for configuring switch, mobile terminal, and switch - Google Patents

Method and apparatus for configuring switch, mobile terminal, and switch Download PDF

Info

Publication number
WO2016180089A1
WO2016180089A1 PCT/CN2016/077140 CN2016077140W WO2016180089A1 WO 2016180089 A1 WO2016180089 A1 WO 2016180089A1 CN 2016077140 W CN2016077140 W CN 2016077140W WO 2016180089 A1 WO2016180089 A1 WO 2016180089A1
Authority
WO
WIPO (PCT)
Prior art keywords
command line
user
command
switch
configuration
Prior art date
Application number
PCT/CN2016/077140
Other languages
French (fr)
Chinese (zh)
Inventor
袁仁东
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016180089A1 publication Critical patent/WO2016180089A1/en

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/34Signalling channels for network management communication

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, an apparatus, a mobile terminal, and a switch for configuring a switch.
  • the network configuration method of the switch device is as follows: 1. After logging in to the switch using the serial port protocol or remote login Telnet protocol, configure the switch in the command line. 2. Use the MIB (Management Information Base) browser to manage the switch through the SNMP (Simple Network Management Protocol) protocol. 3. The switch receives the configuration request sent by the web browser through the embedded web server and performs corresponding operations.
  • MIB Management Information Base
  • SNMP Simple Network Management Protocol
  • the technical problem to be solved by the present invention is to provide a method, a device, a mobile terminal and a switch for configuring a switch, which solves the problem that the existing switch network configuration method cannot manage the switch through the mobile terminal.
  • an embodiment of the present invention provides a method for configuring a switch, which is applied to a mobile terminal, and the configuration method includes:
  • each command line management protocol data packet includes at least one command line code and a command corresponding to each command line code Row name
  • the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the configuration corresponding to the command line code selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. command.
  • the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
  • the command line management protocol data packet is parsed, and if a valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, which specifically includes:
  • the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line selected by the user according to the mapping relationship between the preset command line encoding and the configuration command.
  • the corresponding configuration command of the code includes:
  • the command line management protocol data packet further includes a command line name length
  • the command line name corresponding to the valid command line code is obtained, specifically:
  • the command line name corresponding to the valid command line code is obtained according to the length of the command line name.
  • the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line selected by the user according to the mapping relationship between the preset command line encoding and the configuration command.
  • the corresponding configuration command of the code includes:
  • the configuration method further includes:
  • the switch is prompted to verify the verification of the user information.
  • an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a mobile terminal, where the configuration apparatus includes:
  • a first sending module configured to send user input information input by the user to the switch
  • a first receiving module configured to receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each The command line name corresponding to the command line code;
  • a parsing module configured to parse each of the command line management protocol data packets, if a valid life is parsed If the line is encoded, the command line name corresponding to the valid command line code is obtained;
  • a display module configured to display a command line name corresponding to the valid command line code to the user, and obtain a command line name selected by the user;
  • a second sending module configured to send a command line code corresponding to the command line name selected by the user to the switch, and obtain, execute, and select a user according to a mapping relationship between the command line encoding and the configuration command by the switch.
  • the command line encodes the corresponding configuration command.
  • the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
  • parsing module specifically includes:
  • a first verification module configured to separately verify the protocol identifier and the CRC
  • a first acquiring module configured to acquire a command line code included in each of the command line protocol information if the protocol identifier and the CRC are both verified;
  • the second obtaining module is configured to obtain a command line name corresponding to the valid command line code if a valid command line code is obtained.
  • the second sending module specifically includes:
  • a first sending submodule configured to send a command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, where the switch identifies the protocol and the The CRC is separately verified, and when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
  • an embodiment of the present invention further provides a mobile terminal, including: a configuration apparatus of a switch as described above.
  • an embodiment of the present invention further provides a method for configuring a switch, which is applied to a switch, where the configuration method includes:
  • command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet, and the mobile terminal will parse the valid data.
  • the command line name corresponding to the command line code is displayed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
  • the step of returning, to the mobile terminal, the command line management protocol data packet including the command line code corresponding to the command line code and the command line code according to the verification result includes:
  • a valid command line code if the user verification information is verified
  • the command line encodes a command line management protocol packet corresponding to the command line name. Otherwise, the command line management protocol packet containing the invalid command line code and the command line code corresponding to the command line code is returned to the mobile terminal.
  • the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
  • the step of receiving the command line code selected by the user sent by the mobile terminal includes:
  • the obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, before acquiring and executing the configuration command corresponding to the command line encoding selected by the user, includes:
  • the obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, the obtaining and executing the configuration command corresponding to the command line encoding selected by the user further includes:
  • the execution result is returned to the mobile terminal.
  • an embodiment of the present invention further provides a device for configuring a switch, which is applied to a switch, where the configuration device includes:
  • a second receiving module configured to receive user verification information sent by the mobile terminal
  • a verification module configured to verify the user verification information according to the pre-stored user information, and obtain a verification result
  • a returning module configured to return, to the mobile terminal, a command line management protocol data packet including a command line code corresponding to a command line code according to the verification result;
  • a third receiving module configured to receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet by the mobile terminal
  • the terminal displays the command line name corresponding to the valid command line code that is parsed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
  • an execution module configured to acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
  • the return module includes:
  • the mobile terminal returns, to the mobile terminal, a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name, otherwise, The mobile terminal returns a command line management protocol packet containing an invalid command line code and a command line name corresponding to the command line code.
  • the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
  • the third receiving module includes:
  • a first receiving submodule configured to receive, by the mobile terminal, a command line selected by the user A code, the protocol identifier, and the CRC.
  • the configuration device further includes:
  • a third check module configured to perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, according to a mapping relationship between a preset command line encoding and a configuration command And acquiring and executing a configuration command corresponding to the command line code selected by the user.
  • an embodiment of the present invention further provides a switch, including: a configuration apparatus of a switch as described above.
  • the configuration method of the switch in the embodiment of the present invention firstly sends user authentication information input by the user to the switch; and then receives at least one command line management protocol data packet returned by the switch after verifying the user verification information, and each command line management protocol data packet Contains at least one command line code and a command line name corresponding to each command line code; parses each command line management protocol packet, and if valid command line code is parsed, obtains the parsed valid command line code Corresponding command line name; display the command line name corresponding to the valid command line code to the user, and obtain the command line name selected by the user; send the command line code corresponding to the command line name selected by the user to the switch, and the switch A mapping relationship between the preset command line encoding and the configuration command, and acquiring and executing a configuration command corresponding to the command line encoding acquired by the user. Therefore, the management function of the switch is realized by the mobile terminal, which facilitates the use of the user and improves the practicability.
  • FIG. 1 is a first flowchart of a method for configuring a switch according to the present invention
  • FIG. 2 is a first schematic structural diagram of a device for configuring a switch according to the present invention
  • FIG. 3 is a second flowchart of a method for configuring a switch according to the present invention.
  • FIG. 4 is a second schematic structural diagram of a device for configuring a switch according to the present invention.
  • FIG. 5 is a schematic diagram of a network topology of a method for configuring a switch according to the present invention.
  • FIG. 6 is a schematic diagram of a first embodiment of a command line management protocol of a method for configuring a switch according to the present invention
  • FIG. 7 is a schematic diagram of a second embodiment of a command line management protocol of a method for configuring a switch according to the present invention.
  • FIG. 8 is a schematic diagram of a third embodiment of a command line management protocol of a method for configuring a switch according to the present invention.
  • FIG. 9 is a schematic diagram of a fourth embodiment of a command line management protocol according to a method for configuring a switch according to the present invention.
  • FIG. 10 is a schematic diagram of a fifth embodiment of a command line management protocol of a method for configuring a switch according to the present invention.
  • FIG. 11 is a schematic flowchart of a specific embodiment of a method for configuring a switch according to the present invention.
  • FIG. 12 is a schematic diagram of a software module implementation of a device for configuring a switch according to the present invention.
  • the configuration method of the switch in the embodiment of the present invention enables the device based on the mobile terminal, such as a mobile phone or a tablet computer, to manage the switch.
  • the method of the embodiment of the present invention does not use the telnet protocol, and provides a visual management interface, which facilitates user management of the switch.
  • the SNMP protocol needs to apply for a globally unique management node ID number, and configure the ID number on the MIB file and the switch end.
  • the method in the embodiment of the present invention does not need to apply for any SNMP-like management ID number, the command line.
  • the mapping from name to command line encoding is transparent to the user and is convenient for the user.
  • the server Compared with the WEB configuration mode, the server generally consumes more resources.
  • the method in the embodiment of the present invention does not need the support of the embedded WEB server at the switch end, thereby saving resource consumption.
  • a method for configuring a switch according to an embodiment of the present invention is applied to a mobile terminal, where the configuration method includes:
  • Step 101 Send user authentication information input by the user to the switch.
  • the user authentication information may include a username and a password.
  • the user can create a user name and password on the switch in advance, and the switch verifies the user name and password sent by the terminal according to the pre-created user name and password.
  • Step 102 Receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each command line code. The corresponding command line name.
  • the command line encoding is the identifier of the configuration command and is unique.
  • Step 103 Parse each of the command line management protocol data packets, and if a valid command line code is parsed, obtain a command line name corresponding to the valid command line code.
  • Step 104 Display the command line name corresponding to the valid command line code to the user, and obtain the command line name selected by the user.
  • step 105 the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line code selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. Corresponding configuration commands.
  • the configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • the mobile terminal and the switch can provide IP communication service support through the wireless router to implement communication between the mobile terminal and the switch.
  • the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
  • step of step 103 above specifically includes:
  • Step 1031 Perform verification on the protocol identifier and the CRC respectively.
  • Step 1032 If the protocol identifier and the CRC are both verified, obtain a command line code included in each of the command line management protocol data packets.
  • Step 1033 If a valid command line code is obtained, obtain a command line name corresponding to the valid command line code.
  • the protocol identifier is an identifier of the command line management protocol and is unique.
  • the value of the CRC is calculated by the CRC algorithm from all fields of the command line management protocol.
  • the protocol identifier in the protocol data packet it can be determined whether the obtained protocol data packet is a command line management protocol data packet, so that when the obtained data packet is a command line management protocol data packet, follow-up actions. And by verifying the CRC in the protocol packet, it can be determined whether the obtained packet has an error during the transmission. When the CRC check is passed, it can be judged that the obtained data packet has no error during the transmission process; otherwise, it is judged that the acquired data packet has an error during the transmission process. Therefore, by verifying the protocol identifier and the CRC separately, the accuracy and validity of the data received by the terminal are ensured.
  • step 105 specifically include:
  • step 1051 the command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC are sent to the switch, and the switch identifies the protocol identifier and the CRC respectively. And when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to a mapping relationship between the preset command line encoding and the configuration command.
  • the protocol identifier and the CRC are returned to the switch together with the command line code selected by the user, and the switch performs subsequent operations on the protocol identifier and the CRC check, thereby ensuring the accuracy and validity of the data received by the switch. .
  • the command line management protocol data packet may further include a command line name length
  • step 103 if the valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, specifically:
  • Step 1034 If a valid command line code is parsed, obtain a command line name corresponding to the valid command line code according to the command line name length.
  • the command line name can be accurately parsed by the command line name length to display the command line name to the user for user selection, which improves the processing accuracy.
  • a command line management protocol data packet includes multiple (N, N is an integer greater than 1) command line encoding and command line encoding corresponding to the command line name
  • the command line management The protocol packet can also contain the number of command lines.
  • the command line name corresponding to the valid command line code and the command line code can be parsed according to the number of command lines.
  • the command line code may also be added to the data returned by the terminal to the switch. Number to facilitate the parsing of multiple command line encodings by the switch.
  • the step of the foregoing step 105 specifically includes:
  • Step 1052 Fill a command line encoding field corresponding to the command name selected by the user into a command line encoding field in the command line management protocol data packet, and length the command line name in the command line management protocol data packet. The value is set to an invalid value;
  • Step 1053 Return the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, perform mapping according to a preset command line coding and configuration command. Relationship, obtain and execute a configuration command corresponding to the command line code selected by the user.
  • the switch only needs to execute the corresponding configuration command according to the command line code selected by the user, and does not need to use the command line name. Therefore, the command line name length value can be set to an invalid value by the above step 1052, thereby avoiding redundant data. Transmission saves resources.
  • the command line management protocol data packet may further include a reserved field, and is initialized to an invalid value, for the command line management protocol data packet to implement an extended function.
  • the command line management protocol data packet may further include a packet length, which is convenient for the terminal or the switch to parse the command line management protocol data packet.
  • the format of the command line management protocol data packet sent by the switch to the mobile terminal may be as shown in Figure 6-8, and the format of the command line management protocol data packet sent by the mobile terminal to the switch may be as shown in Figure 6-10.
  • the command line management protocol data packet sent by the mobile terminal to the switch may not include the command line name, and may also include the command line name. When the command line name is included, the command line name length value may be set to an invalid value.
  • command line management protocol data packet is merely an example. Any format of the command line management protocol data packet that can implement the terminal to switch management function can be applied to the specific embodiment of the present invention, and not one by one. For example.
  • the configuration method may further include:
  • Step 106 If only the invalid command line code is parsed, the switch is prompted to verify that the user verification information fails.
  • the user may be prompted to re-enter the verification information and the like, which is convenient for the user to use.
  • the following takes the format of the command line management protocol packet shown in FIG. 6 as an example.
  • the configuration method of the switch of the present invention is as follows:
  • the command line management protocol data packet of the embodiment of the present invention includes: command line code 601, length 4 bytes; protocol identifier 602, length 2 bytes; command line name length 603,
  • the length of the command line name is in bytes, and its length is 2 bytes;
  • the command line name 604, the length of the command line name 604 is identified by the command line name length 603 field field; the reserved field 605, initialized to 0, the length It is 2 bytes; CRC 606, initialized to 0, and has a length of 2 bytes.
  • the data in the data packet is stored in units of 4 bytes, in order to ensure the efficiency of data processing, if the length of the command name 604 field is not 0, the modulo remainder is not 0, and 1-3 words are filled.
  • the 0 of the section has its length modulo remainder of 4 to zero.
  • the configuration method of the switch in this embodiment of the present invention includes:
  • Step 1101 the switch maps all configuration commands to command line encoding, and encodes and matches the command line.
  • the set command is saved according to the mapping relationship.
  • step 1102 the switch saves the user name and password created by the user on the switch.
  • Step 1103 The user name and password input by the user are sent by the mobile terminal to the switch.
  • Step 1104 The switch verifies the username and password sent by the mobile terminal according to the saved username and password, and obtains the verification result.
  • Step 1105 If the verification result shows that the verification is passed, the switch sends the command line code of all the configuration commands to the mobile terminal by using multiple command line management protocol data packets, and the command line management protocol data packet is encapsulated as shown in FIG. 6; otherwise, the sending is performed.
  • a command line management protocol packet is sent to the mobile terminal, and the command line code 601 field of the command line management protocol packet is set to all zeros.
  • Step 1106 The received command line management protocol data packet is parsed one by one by the mobile terminal, and the parsing process is: verifying the protocol identifier 602 and the CRC 606, if the protocol identifier 602 and the CRC 606 are both verified and valid.
  • the command line code 601 obtains the command line name 604 according to the command line name length 603, and records the valid command line code 601 and the corresponding command line name 604.
  • Step 1107 if the mobile terminal only parses a message with the command line code 601 all 0, the user is prompted to verify the failure; otherwise, the mobile terminal generates a visual configuration list according to the recorded command line code and the corresponding command line name, The command line name corresponding to a valid command line code is displayed to the user.
  • step 1108 the user selects the name of the command line to be configured.
  • Step 1109 The mobile terminal adds the command line code corresponding to the command name selected by the user to the command line code 601 field of the command line management protocol data packet, adds the protocol identifier 602, sets the command line name length 603 to 0, and initializes the reserved field 605. It is 0 and the value of CRC 606 is calculated.
  • Step 1110 The command line management protocol data packet of the above step 1109 is sent by the mobile terminal to the switch.
  • Step 1111 The switch checks the CRC 606 and the protocol identifier 602 in the received data packet. If the check succeeds, the mapping between the command line code and the configuration command saved in the foregoing step 1101 is performed, and the command selected by the user is obtained. The line corresponds to the corresponding configuration command.
  • step 1112 the switch executes a configuration command corresponding to the command line code selected by the user.
  • Step 1113 The switch returns the execution result to the mobile terminal.
  • the configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a mobile terminal, where the configuration apparatus includes:
  • a first sending module configured to send user input information input by the user to the switch
  • a first receiving module configured to receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each The command line name corresponding to the command line code;
  • a parsing module configured to parse each of the command line management protocol data packets, if a valid life is parsed If the line is encoded, the command line name corresponding to the valid command line code is obtained;
  • a display module configured to display a command line name corresponding to the valid command line code to the user, and obtain a command line name selected by the user;
  • a second sending module configured to send a command line code corresponding to the command line name selected by the user to the switch, and obtain, execute, and select a user according to a mapping relationship between the command line encoding and the configuration command by the switch.
  • the command line encodes the corresponding configuration command.
  • the configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • the user authentication information may include a username and a password.
  • the user can create a user name and password on the switch in advance, and the switch verifies the user name and password sent by the terminal according to the pre-created user name and password.
  • the first sending module may be implemented by a connection management module of the mobile terminal; the first receiving module and the second sending module may be implemented by a communication protocol module of the mobile terminal;
  • the module is configured by a command structure of the mobile terminal; the display module can be implemented by a human interface module of the mobile terminal.
  • connection management module is used for user and password verification and connection state maintenance between the switch and the mobile terminal;
  • command structure configuration module is used to implement mapping of the switch configuration command to the command line code, and the command line code to the command line name.
  • the communication protocol module is responsible for information exchange between the mobile terminal device and the switch;
  • the switch management human-machine interface module provides a visual graphical interface on the mobile terminal, which makes the management of the switch more convenient.
  • the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
  • parsing module specifically includes:
  • a first verification module configured to separately verify the protocol identifier and the CRC
  • a first acquiring module configured to acquire a command line code included in each of the command line protocol information if the protocol identifier and the CRC are both verified;
  • the second obtaining module is configured to obtain a command line name corresponding to the valid command line code if a valid command line code is obtained.
  • the second sending module specifically includes:
  • a first sending submodule configured to send a command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, where the switch identifies the protocol and the The CRC is separately verified, and when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
  • the command line management protocol data packet may further include a command line name length
  • parsing module specifically includes:
  • the third obtaining module is configured to obtain a command line name corresponding to the valid command line code according to the length of the command line name if the valid command line code is parsed.
  • the second sending module specifically includes:
  • a padding module configured to fill a command line encoding field corresponding to the command name selected by the user into a command line encoding field in the command line management protocol data packet, and length the command line name in the command line management protocol data packet The value is set to an invalid value
  • a second sending submodule configured to return the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, according to a preset command line encoding
  • the mapping relationship with the configuration command acquires and executes a configuration command corresponding to the command line code selected by the user.
  • the prompting module is configured to prompt the switch to fail verification of the user verification information if only invalid command line coding is parsed.
  • the configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • configuration device of the switch is a device corresponding to the configuration method of the switch, and all the implementation manners in the foregoing method embodiments are applicable to the embodiment of the device, and the same technical effects can be achieved.
  • the configuration of the switch of the embodiment of the present invention is applied to the mobile terminal. Therefore, the embodiment of the present invention further provides a mobile terminal, including: the configuration device of the switch as described in the foregoing embodiment.
  • the implementation examples of the configuration device of the switch are applicable to the embodiment of the mobile terminal, and the same technical effects can be achieved.
  • the mobile terminal of the present invention may be a mobile electronic device such as a mobile phone or a tablet computer.
  • an embodiment of the present invention further provides a method for configuring a switch, which is applied to a switch, and the configuration method includes:
  • Step 301 Receive user authentication information sent by the mobile terminal.
  • Step 302 Verify the user verification information according to the pre-stored user information, and obtain a verification result.
  • Step 303 Return, according to the verification result, a command line management protocol data packet including a command line code corresponding to the command line code and the command line code to the mobile terminal;
  • Step 304 Receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet, and the mobile terminal will parse out
  • the command line name corresponding to the valid command line code is displayed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
  • Step 305 Acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
  • the configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • step of step 303 specifically includes:
  • Step 3031 If the user verification information is verified, return a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name to the mobile terminal, otherwise, return to the mobile terminal.
  • the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
  • the step of receiving the command line code selected by the user sent by the mobile terminal includes:
  • Step 3041 Receive, by the mobile terminal, a command line code selected by the user, the protocol identifier, and the CRC.
  • the method may further include:
  • Step 3051 Perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, obtain and execute according to a mapping relationship between a preset command line encoding and a configuration command.
  • the configuration command corresponding to the command line code selected by the user.
  • the protocol identifier is an identifier of the command line management protocol and is unique.
  • the value of the CRC is calculated by the CRC algorithm from all fields of the command line management protocol.
  • the protocol identifier in the protocol data packet it can be determined whether the obtained protocol data packet is a command line management protocol data packet, so that when the obtained data packet is a command line management protocol data packet, follow-up actions. And by verifying the CRC in the protocol packet, it can be determined whether the obtained packet has an error during the transmission. When the CRC check is passed, it can be judged that the obtained data packet has no error during the transmission process; otherwise, it is judged that the acquired data packet has an error during the transmission process. Therefore, by verifying the protocol identifier and the CRC separately, the accuracy and validity of the data received by the switch are ensured.
  • the step 305 may further include:
  • Step 306 returning an execution result to the mobile terminal.
  • the user can obtain the execution result in time to perform subsequent operations according to the execution result, which is convenient for the user to use, and improves the practicability and convenience.
  • the configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a switch, and the configuration apparatus includes:
  • a second receiving module configured to receive user verification information sent by the mobile terminal
  • a verification module configured to verify the user verification information according to the pre-stored user information, and obtain a verification result fruit
  • a returning module configured to return, to the mobile terminal, a command line management protocol data packet including a command line code corresponding to a command line code according to the verification result;
  • a third receiving module configured to receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet by the mobile terminal
  • the terminal displays the command line name corresponding to the valid command line code that is parsed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
  • an execution module configured to acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
  • the configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • the second receiving module and the verification module may be implemented by a connection management module of the switch; the return module and the third receiving module may be implemented by a communication protocol module of the switch; The command structure configuration module and the command execution module of the switch are implemented.
  • connection management module is used for user and password verification and connection state maintenance between the switch and the mobile terminal;
  • command structure configuration module is used to implement mapping of the switch configuration command to the command line code, and the command line code to the command line name. Mapping;
  • the communication protocol module is responsible for information exchange between the mobile terminal device and the switch;
  • the command execution module is responsible for executing the received command on the switch.
  • the returning module includes:
  • the mobile terminal returns, to the mobile terminal, a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name, otherwise, The mobile terminal returns a command line management protocol packet containing an invalid command line code and a command line name corresponding to the command line code.
  • the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
  • the third receiving module includes:
  • a first receiving submodule configured to receive, by the mobile terminal, the command line code selected by the user, the protocol identifier, and the CRC.
  • the configuration device further includes:
  • a third check module configured to perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, according to a mapping relationship between a preset command line encoding and a configuration command And acquiring and executing a configuration command corresponding to the command line code selected by the user.
  • the configuring device further includes:
  • a second returning module configured to return an execution result to the mobile terminal.
  • the configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
  • configuration device of the switch is a device corresponding to the configuration method of the switch, and all the implementation manners in the foregoing method embodiments are applicable to the embodiment of the device, and the same technical effects can be achieved.
  • the embodiment of the present invention further provides a switch, including: a configuration device of the switch as described in the foregoing embodiment.
  • the implementation examples of the configuration device of the switch are applicable to the embodiment of the switch, and the same technical effects can be achieved.
  • the present invention is applicable to a network configuration of a switch device, and is used to implement management of a switch by a mobile terminal device.

Landscapes

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

Abstract

The present invention relates to the field of communications. Provided are a method and apparatus for configuring a switch, a mobile terminal and the switch, so as to solve the problem of failing to manage a switch by means of a mobile terminal in the prior art. The method comprises: sending user verification information to a switch; receiving command line management protocol data packets returned after the switch verifies the user verification information, the command line management protocol data packets comprising command line codes and corresponding command line names; parsing the command line management protocol data packets to obtain command line names corresponding to effective command line codes; displaying, to a user, the command line names corresponding to the effective command line codes, and obtaining a command line name selected by the user; and sending, to the switch, a command line code that is corresponding to the command line name and that is selected by the user, so that the switch executes, according to a mapping relationship between command line codes and configuration commands, a configuration command corresponding to the command line code selected by the user. In the solution of the present invention, a switch is managed by means of a mobile terminal.

Description

一种交换机的配置方法、装置、移动终端及交换机Configuration method, device, mobile terminal and switch of switch 技术领域Technical field
本发明涉及通信领域,特别涉及一种交换机的配置方法、装置、移动终端及交换机。The present invention relates to the field of communications, and in particular, to a method, an apparatus, a mobile terminal, and a switch for configuring a switch.
背景技术Background technique
通常交换机设备的网络配置方法有以下三种:1.使用串口协议或远程登录Telnet协议登录交换机后,以命令行的方式对交换机进行配置。2.使用MIB(Management Information Base,管理信息库)浏览器通过SNMP(Simple Network Management Protocol,简单网络管理协议)协议对交换机进行管理。3.交换机通过嵌入式网页服务器接收网页浏览器发出的配置请求并进行相应的操作。Generally, the network configuration method of the switch device is as follows: 1. After logging in to the switch using the serial port protocol or remote login Telnet protocol, configure the switch in the command line. 2. Use the MIB (Management Information Base) browser to manage the switch through the SNMP (Simple Network Management Protocol) protocol. 3. The switch receives the configuration request sent by the web browser through the embedded web server and performs corresponding operations.
随着移动设备的发展,便携式移动终端已经成为日常办公用品。但是,上述三种方法都无法或无法有效地通过移动终端设备对交换机进行管理。With the development of mobile devices, portable mobile terminals have become everyday office supplies. However, none of the above three methods can effectively or efficiently manage the switch through the mobile terminal device.
发明内容Summary of the invention
本发明要解决的技术问题是提供一种交换机的配置方法、装置、移动终端及交换机,解决现有交换机网络配置方法无法通过移动终端对交换机进行管理的问题。The technical problem to be solved by the present invention is to provide a method, a device, a mobile terminal and a switch for configuring a switch, which solves the problem that the existing switch network configuration method cannot manage the switch through the mobile terminal.
为解决上述技术问题,本发明的实施例提供一种交换机的配置方法,应用于移动终端,所述配置方法包括:To solve the above technical problem, an embodiment of the present invention provides a method for configuring a switch, which is applied to a mobile terminal, and the configuration method includes:
向交换机发送用户输入的用户验证信息;Sending user authentication information input by the user to the switch;
接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;Receiving at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and a command corresponding to each command line code Row name
对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称;Parsing each of the command line management protocol data packets, and if a valid command line code is parsed, obtaining a command line name corresponding to the valid command line code;
将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;Displaying the command line name corresponding to the valid command line code to the user, and obtaining the command line name selected by the user;
将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。The command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the configuration corresponding to the command line code selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. command.
其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
相应地,所述对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称,具体包括:Correspondingly, the command line management protocol data packet is parsed, and if a valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, which specifically includes:
对所述协议标识和所述CRC分别进行校验; Performing verification on the protocol identifier and the CRC respectively;
若所述协议标识和所述CRC均校验通过,则获取每个所述命令行管理协议数据包中包含的命令行编码;And if the protocol identifier and the CRC are both verified, obtaining a command line code included in each of the command line management protocol data packets;
若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。If a valid command line code is obtained, the command line name corresponding to the valid command line code is obtained.
其中,所述将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令,具体包括:The command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. The corresponding configuration command of the code includes:
将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。Transmitting the command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, and verifying, by the switch, the protocol identifier and the CRC, respectively. When the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
其中,所述命令行管理协议数据包中还包含命令行名称长度;The command line management protocol data packet further includes a command line name length;
相应地,所述若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称,具体为:Correspondingly, if the valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, specifically:
若解析出有效的命令行编码,则根据所述命令行名称长度,获取所述有效的命令行编码对应的命令行名称。If a valid command line code is parsed, the command line name corresponding to the valid command line code is obtained according to the length of the command line name.
其中,所述将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令,具体包括:The command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. The corresponding configuration command of the code includes:
将与用户选取的命令名称对应的命令行编码填充到所述命令行管理协议数据包中的命令行编码域,并将所述命令行管理协议数据包中的命令行名称长度值设为无效值;Filling a command line encoding field corresponding to the command name selected by the user into the command line encoding field in the command line management protocol data packet, and setting the command line name length value in the command line management protocol data packet to an invalid value ;
将填充后的所述命令行管理协议数据包返回给所述交换机,由所述交换机对所述命令行管理协议数据包进行解析后,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。Returning the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, according to a mapping relationship between a preset command line encoding and a configuration command, And executing a configuration command corresponding to the command line code selected by the user.
其中,所述对每个所述命令行管理协议数据包进行解析之后,所述配置方法还包括:After the parsing of each of the command line management protocol data packets, the configuration method further includes:
若只解析出无效的命令行编码,则提示所述交换机对所述用户验证信息的验证失败。If only the invalid command line code is parsed, the switch is prompted to verify the verification of the user information.
为解决上述技术问题,本发明的实施例还提供一种交换机的配置装置,应用于移动终端,所述配置装置包括:To solve the above technical problem, an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a mobile terminal, where the configuration apparatus includes:
第一发送模块,用于向交换机发送用户输入的用户验证信息;a first sending module, configured to send user input information input by the user to the switch;
第一接收模块,用于接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;a first receiving module, configured to receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each The command line name corresponding to the command line code;
解析模块,用于对每个所述命令行管理协议数据包进行解析,若解析出有效的命 令行编码,则获取所述有效的命令行编码对应的命令行名称;a parsing module, configured to parse each of the command line management protocol data packets, if a valid life is parsed If the line is encoded, the command line name corresponding to the valid command line code is obtained;
显示模块,用于将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;a display module, configured to display a command line name corresponding to the valid command line code to the user, and obtain a command line name selected by the user;
第二发送模块,用于将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a second sending module, configured to send a command line code corresponding to the command line name selected by the user to the switch, and obtain, execute, and select a user according to a mapping relationship between the command line encoding and the configuration command by the switch. The command line encodes the corresponding configuration command.
其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
相应地,所述解析模块具体包括:Correspondingly, the parsing module specifically includes:
第一校验模块,用于对所述协议标识和所述CRC分别进行校验;a first verification module, configured to separately verify the protocol identifier and the CRC;
第一获取模块,用于若所述协议标识和所述CRC均校验通过,则获取每个所述命令行协议信息中包含的命令行编码;a first acquiring module, configured to acquire a command line code included in each of the command line protocol information if the protocol identifier and the CRC are both verified;
第二获取模块,用于若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。The second obtaining module is configured to obtain a command line name corresponding to the valid command line code if a valid command line code is obtained.
其中,所述第二发送模块具体包括:The second sending module specifically includes:
第一发送子模块,用于将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a first sending submodule, configured to send a command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, where the switch identifies the protocol and the The CRC is separately verified, and when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
为解决上述技术问题,本发明的实施例还提供一种移动终端,包括:如上所述的交换机的配置装置。In order to solve the above technical problem, an embodiment of the present invention further provides a mobile terminal, including: a configuration apparatus of a switch as described above.
为解决上述技术问题,本发明的实施例还提供一种交换机的配置方法,应用于交换机,所述配置方法包括:To solve the above technical problem, an embodiment of the present invention further provides a method for configuring a switch, which is applied to a switch, where the configuration method includes:
接收移动终端发送的用户验证信息;Receiving user authentication information sent by the mobile terminal;
根据预存的用户信息对所述用户验证信息进行验证,得到验证结果;Verifying the user verification information according to the pre-stored user information, and obtaining a verification result;
根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包;And returning, to the mobile terminal, a command line management protocol data packet including a command line name corresponding to the command line code and the command line code, according to the verification result;
接收所述移动终端发送的用户选取的命令行编码,所述用户选取的命令行编码为所述移动终端对所述命令行管理协议数据包进行解析,由所述移动终端将解析出的有效的命令行编码对应的命令行名称显示给用户,并由所述移动终端获取的用户选取的命令行名称所对应的命令行编码;Receiving a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet, and the mobile terminal will parse the valid data. The command line name corresponding to the command line code is displayed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And obtaining, according to a preset mapping relationship between the command line encoding and the configuration command, a configuration command corresponding to the command line code selected by the user.
其中,所述根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包的步骤包括:The step of returning, to the mobile terminal, the command line management protocol data packet including the command line code corresponding to the command line code and the command line code according to the verification result includes:
若所述用户验证信息验证通过,则向所述移动终端返回包含有效的命令行编码及 命令行编码对应的命令行名称的命令行管理协议数据包,否则,向所述移动终端返回包含无效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包。Returning, to the mobile terminal, a valid command line code if the user verification information is verified The command line encodes a command line management protocol packet corresponding to the command line name. Otherwise, the command line management protocol packet containing the invalid command line code and the command line code corresponding to the command line code is returned to the mobile terminal.
其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
所述接收所述移动终端发送的用户选取的命令行编码的步骤包括:The step of receiving the command line code selected by the user sent by the mobile terminal includes:
接收所述移动终端一并发送的所述用户选取的命令行编码、所述协议标识和所述CRC。Receiving, by the mobile terminal, the command line code selected by the user, the protocol identifier, and the CRC.
其中,所述根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令之前还包括:The obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, before acquiring and executing the configuration command corresponding to the command line encoding selected by the user, includes:
对所述协议标识和所述CRC分别进行校验,若所述协议标识和所述CRC均校验通过,则根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And verifying the protocol identifier and the CRC respectively, if the protocol identifier and the CRC are both verified, obtaining and executing the user selection according to a mapping relationship between a preset command line encoding and a configuration command. The command line encodes the corresponding configuration command.
其中,所述根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令之后还包括:The obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, the obtaining and executing the configuration command corresponding to the command line encoding selected by the user, further includes:
将执行结果返回给所述移动终端。The execution result is returned to the mobile terminal.
为解决上述技术问题,本发明的实施例还提供一种交换机的配置装置,应用于交换机,所述配置装置包括:In order to solve the above technical problem, an embodiment of the present invention further provides a device for configuring a switch, which is applied to a switch, where the configuration device includes:
第二接收模块,用于接收移动终端发送的用户验证信息;a second receiving module, configured to receive user verification information sent by the mobile terminal;
验证模块,用于根据预存的用户信息对所述用户验证信息进行验证,得到验证结果;a verification module, configured to verify the user verification information according to the pre-stored user information, and obtain a verification result;
返回模块,用于根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包;a returning module, configured to return, to the mobile terminal, a command line management protocol data packet including a command line code corresponding to a command line code according to the verification result;
第三接收模块,用于接收所述移动终端发送的用户选取的命令行编码,所述用户选取的命令行编码为所述移动终端对所述命令行管理协议数据包进行解析,由所述移动终端将解析出的有效的命令行编码对应的命令行名称显示给用户,并由所述移动终端获取的用户选取的命令行名称所对应的命令行编码;a third receiving module, configured to receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet by the mobile terminal The terminal displays the command line name corresponding to the valid command line code that is parsed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
执行模块,用于根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And an execution module, configured to acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
其中,所述返回模块包括:The return module includes:
返回子模块,用于若所述用户验证信息验证通过,则向所述移动终端返回包含有效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包,否则,向所述移动终端返回包含无效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包。Returning to the submodule, if the user verification information is verified, returning, to the mobile terminal, a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name, otherwise, The mobile terminal returns a command line management protocol packet containing an invalid command line code and a command line name corresponding to the command line code.
其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
所述第三接收模块包括:The third receiving module includes:
第一接收子模块,用于接收所述移动终端一并发送的所述用户选取的命令行编 码、所述协议标识和所述CRC。a first receiving submodule, configured to receive, by the mobile terminal, a command line selected by the user A code, the protocol identifier, and the CRC.
其中,所述配置装置还包括:The configuration device further includes:
第三校验模块,用于对所述协议标识和所述CRC分别进行校验,若所述协议标识和所述CRC均校验通过,则根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。a third check module, configured to perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, according to a mapping relationship between a preset command line encoding and a configuration command And acquiring and executing a configuration command corresponding to the command line code selected by the user.
为解决上述技术问题,本发明的实施例还提供一种交换机,包括:如上所述的交换机的配置装置。To solve the above technical problem, an embodiment of the present invention further provides a switch, including: a configuration apparatus of a switch as described above.
本发明的上述技术方案的有益效果如下:The beneficial effects of the above technical solution of the present invention are as follows:
本发明实施例的交换机的配置方法,首先向交换机发送用户输入的用户验证信息;然后接收交换机对用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;对每个命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取解析出的有效的命令行编码对应的命令行名称;将有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;将与用户选取的命令行名称对应的命令行编码发送给交换机,由交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户获取的命令行编码对应的配置命令。从而通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration method of the switch in the embodiment of the present invention firstly sends user authentication information input by the user to the switch; and then receives at least one command line management protocol data packet returned by the switch after verifying the user verification information, and each command line management protocol data packet Contains at least one command line code and a command line name corresponding to each command line code; parses each command line management protocol packet, and if valid command line code is parsed, obtains the parsed valid command line code Corresponding command line name; display the command line name corresponding to the valid command line code to the user, and obtain the command line name selected by the user; send the command line code corresponding to the command line name selected by the user to the switch, and the switch A mapping relationship between the preset command line encoding and the configuration command, and acquiring and executing a configuration command corresponding to the command line encoding acquired by the user. Therefore, the management function of the switch is realized by the mobile terminal, which facilitates the use of the user and improves the practicability.
附图说明DRAWINGS
图1为本发明的交换机的配置方法的第一流程图;1 is a first flowchart of a method for configuring a switch according to the present invention;
图2为本发明的交换机的配置装置的第一结构示意图;2 is a first schematic structural diagram of a device for configuring a switch according to the present invention;
图3为本发明的交换机的配置方法的第二流程图;3 is a second flowchart of a method for configuring a switch according to the present invention;
图4为本发明的交换机的配置装置的第二结构示意图;4 is a second schematic structural diagram of a device for configuring a switch according to the present invention;
图5为本发明的交换机的配置方法的网络拓扑示意图;5 is a schematic diagram of a network topology of a method for configuring a switch according to the present invention;
图6为本发明的交换机的配置方法的命令行管理协议第一实施例的示意图;6 is a schematic diagram of a first embodiment of a command line management protocol of a method for configuring a switch according to the present invention;
图7为本发明的交换机的配置方法的命令行管理协议第二实施例的示意图;7 is a schematic diagram of a second embodiment of a command line management protocol of a method for configuring a switch according to the present invention;
图8为本发明的交换机的配置方法的命令行管理协议第三实施例的示意图;8 is a schematic diagram of a third embodiment of a command line management protocol of a method for configuring a switch according to the present invention;
图9为本发明的交换机的配置方法的命令行管理协议第四实施例的示意图;9 is a schematic diagram of a fourth embodiment of a command line management protocol according to a method for configuring a switch according to the present invention;
图10为本发明的交换机的配置方法的命令行管理协议第五实施例的示意图;10 is a schematic diagram of a fifth embodiment of a command line management protocol of a method for configuring a switch according to the present invention;
图11为本发明的交换机的配置方法一具体实施例的流程示意图;11 is a schematic flowchart of a specific embodiment of a method for configuring a switch according to the present invention;
图12为本发明的交换机的配置装置的软件模块实施示意图。FIG. 12 is a schematic diagram of a software module implementation of a device for configuring a switch according to the present invention.
具体实施方式detailed description
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。 The technical problems, the technical solutions, and the advantages of the present invention will be more clearly described in the following description.
本发明实施例的交换机的配置方法,使得基于移动终端的设备,如:手机、平板电脑等设备,可以对交换机进行管理。相比于Telnet协议管理模式,本发明实施例的方法不使用telnet协议,并提供了可视化管理界面,方便了用户对交换机的管理。相比于SNMP协议,SNMP协议需要申请全球唯一的管理节点ID号,并将该ID号配置在MIB文件和交换机端,本发明实施例的方法无需申请任何类似于SNMP协议管理ID号,命令行名称到命令行编码的映射对用户是透明的,方便了用户的使用。相比于WEB配置模式,通常此类服务器消耗的资源较多,本发明实施例的方法在交换机端无需嵌入式WEB服务器的支持,节省了资源消耗。The configuration method of the switch in the embodiment of the present invention enables the device based on the mobile terminal, such as a mobile phone or a tablet computer, to manage the switch. Compared with the Telnet protocol management mode, the method of the embodiment of the present invention does not use the telnet protocol, and provides a visual management interface, which facilitates user management of the switch. Compared with the SNMP protocol, the SNMP protocol needs to apply for a globally unique management node ID number, and configure the ID number on the MIB file and the switch end. The method in the embodiment of the present invention does not need to apply for any SNMP-like management ID number, the command line. The mapping from name to command line encoding is transparent to the user and is convenient for the user. Compared with the WEB configuration mode, the server generally consumes more resources. The method in the embodiment of the present invention does not need the support of the embedded WEB server at the switch end, thereby saving resource consumption.
如图1所示,本发明实施例的交换机的配置方法,应用于移动终端,所述配置方法包括:As shown in FIG. 1 , a method for configuring a switch according to an embodiment of the present invention is applied to a mobile terminal, where the configuration method includes:
步骤101,向交换机发送用户输入的用户验证信息。Step 101: Send user authentication information input by the user to the switch.
这里,所述用户验证信息可以包括用户名和密码。用户可预先在交换机上创建用户名和密码,由交换机根据预先创建的用户名和密码对终端发送过来的用户名和密码进行验证。Here, the user authentication information may include a username and a password. The user can create a user name and password on the switch in advance, and the switch verifies the user name and password sent by the terminal according to the pre-created user name and password.
步骤102,接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称。Step 102: Receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each command line code. The corresponding command line name.
这里,命令行编码是配置命令的标识,具有唯一性。Here, the command line encoding is the identifier of the configuration command and is unique.
步骤103,对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。Step 103: Parse each of the command line management protocol data packets, and if a valid command line code is parsed, obtain a command line name corresponding to the valid command line code.
步骤104,将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称。Step 104: Display the command line name corresponding to the valid command line code to the user, and obtain the command line name selected by the user.
步骤105,将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。In step 105, the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the command line code selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. Corresponding configuration commands.
本发明实施例的交换机的配置方法,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
其中,如图5所示,移动终端与交换机之间可通过无线路由器为二者提供IP通信业务支持,来实现移动终端与交换机之间的通讯。As shown in FIG. 5, the mobile terminal and the switch can provide IP communication service support through the wireless router to implement communication between the mobile terminal and the switch.
本发明的具体实施例中,所述命令行管理协议数据包中还可以包含协议标识和循环冗余校验码CRC;In a specific embodiment of the present invention, the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
相应地,上述步骤103的步骤具体包括:Correspondingly, the step of step 103 above specifically includes:
步骤1031,对所述协议标识和所述CRC分别进行校验;Step 1031: Perform verification on the protocol identifier and the CRC respectively.
步骤1032,若所述协议标识和所述CRC均校验通过,则获取每个所述命令行管理协议数据包中包含的命令行编码; Step 1032: If the protocol identifier and the CRC are both verified, obtain a command line code included in each of the command line management protocol data packets.
步骤1033,若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。Step 1033: If a valid command line code is obtained, obtain a command line name corresponding to the valid command line code.
这里,协议标识是命令行管理协议的标识,具有唯一性。而CRC的值由命令行管理协议的所有字段根据CRC算法计算得出。Here, the protocol identifier is an identifier of the command line management protocol and is unique. The value of the CRC is calculated by the CRC algorithm from all fields of the command line management protocol.
此时,通过对协议数据包中的协议标识进行校验,可判断获取到的协议数据包是否为命令行管理协议数据包,以在获取到的数据包为命令行管理协议数据包时,进行后续操作。且通过对协议数据包中的CRC进行校验,可判断获取到的数据包在传输过程中是否出现错误。在CRC校验通过时,可判断获取到的数据包在传输过程中没有出错,否则,判断获取到的数据包在传输过程中出现了错误。从而通过对协议标识和CRC分别进行校验,保证了终端接收数据的准确性和有效性。At this time, by verifying the protocol identifier in the protocol data packet, it can be determined whether the obtained protocol data packet is a command line management protocol data packet, so that when the obtained data packet is a command line management protocol data packet, Follow-up actions. And by verifying the CRC in the protocol packet, it can be determined whether the obtained packet has an error during the transmission. When the CRC check is passed, it can be judged that the obtained data packet has no error during the transmission process; otherwise, it is judged that the acquired data packet has an error during the transmission process. Therefore, by verifying the protocol identifier and the CRC separately, the accuracy and validity of the data received by the terminal are ensured.
进一步的,上述步骤105的步骤具体包括:Further, the steps of step 105 above specifically include:
步骤1051,将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。In step 1051, the command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC are sent to the switch, and the switch identifies the protocol identifier and the CRC respectively. And when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to a mapping relationship between the preset command line encoding and the configuration command.
此时,通过将协议标识和CRC同用户选取的命令行编码一并返回给交换机,并由交换机对协议标识和CRC校验后才进行后续操作,同样保证了交换机接收数据的准确性和有效性。At this time, the protocol identifier and the CRC are returned to the switch together with the command line code selected by the user, and the switch performs subsequent operations on the protocol identifier and the CRC check, thereby ensuring the accuracy and validity of the data received by the switch. .
本发明的具体实施例中,所述命令行管理协议数据包中还可以包含命令行名称长度;In a specific embodiment of the present invention, the command line management protocol data packet may further include a command line name length;
相应地,上述步骤103的步骤中,所述若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称,具体为:Correspondingly, in the step of the foregoing step 103, if the valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, specifically:
步骤1034,若解析出有效的命令行编码,则根据所述命令行名称长度,获取所述有效的命令行编码对应的命令行名称。Step 1034: If a valid command line code is parsed, obtain a command line name corresponding to the valid command line code according to the command line name length.
此时,通过命令行名称长度可准确解析出命令行名称,以将命令行名称显示给用户,供用户选择,提高了处理的准确性。At this time, the command line name can be accurately parsed by the command line name length to display the command line name to the user for user selection, which improves the processing accuracy.
其中,如图8所示,当一个命令行管理协议数据包中包含多个(N个,N为大于1的整数)命令行编码及命令行编码对应的命令行名称时,所述命令行管理协议数据包中还可以包含命令行个数。此时,上述步骤13中,可根据命令行个数,解析出有效的命令行编码及命令行编码对应的命令行名称。且,如图10所示,上述步骤15中,当用户选取了多个命令行编码(M个,M为大于1的整数)时,也可在终端向交换机返回的数据中添加命令行编码个数,以方便交换机对多个命令行编码的解析。Wherein, as shown in FIG. 8, when a command line management protocol data packet includes multiple (N, N is an integer greater than 1) command line encoding and command line encoding corresponding to the command line name, the command line management The protocol packet can also contain the number of command lines. At this time, in the above step 13, the command line name corresponding to the valid command line code and the command line code can be parsed according to the number of command lines. Moreover, as shown in FIG. 10, in the above step 15, when the user selects multiple command line codes (M, M is an integer greater than 1), the command line code may also be added to the data returned by the terminal to the switch. Number to facilitate the parsing of multiple command line encodings by the switch.
其中,上述步骤105的步骤具体包括:The step of the foregoing step 105 specifically includes:
步骤1052,将与用户选取的命令名称对应的命令行编码填充到所述命令行管理协议数据包中的命令行编码域,并将所述命令行管理协议数据包中的命令行名称长度 值设为无效值;Step 1052: Fill a command line encoding field corresponding to the command name selected by the user into a command line encoding field in the command line management protocol data packet, and length the command line name in the command line management protocol data packet. The value is set to an invalid value;
步骤1053,将填充后的所述命令行管理协议数据包返回给所述交换机,由所述交换机对所述命令行管理协议数据包进行解析后,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。Step 1053: Return the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, perform mapping according to a preset command line coding and configuration command. Relationship, obtain and execute a configuration command corresponding to the command line code selected by the user.
此时,交换机只需根据用户选取的命令行编码就可执行对应的配置命令,无需使用命令行名称,因此,通过上述步骤1052可将命令行名称长度值设为无效值,避免了多余数据的传输,节省了资源。At this time, the switch only needs to execute the corresponding configuration command according to the command line code selected by the user, and does not need to use the command line name. Therefore, the command line name length value can be set to an invalid value by the above step 1052, thereby avoiding redundant data. Transmission saves resources.
本发明的具体实施例中,所述命令行管理协议数据包中还可以包含保留字段,并初始化为无效值,供所述命令行管理协议数据包实现扩展功能。且所述命令行管理协议数据包中还可以包含报文长度,方便终端或交换机对所述命令行管理协议数据包进行解析的操作。In a specific embodiment of the present invention, the command line management protocol data packet may further include a reserved field, and is initialized to an invalid value, for the command line management protocol data packet to implement an extended function. The command line management protocol data packet may further include a packet length, which is convenient for the terminal or the switch to parse the command line management protocol data packet.
其中,交换机发送给移动终端的命令行管理协议数据包的格式可如图6-8所示,而移动终端发送给交换机的命令行管理协议数据包的格式可如图6-10所示。其中,移动终端发送给交换机的命令行管理协议数据包可不包含命令行名称,也可包含命令行名称,当包含命令行名称时,可将命令行名称长度值设为无效值。The format of the command line management protocol data packet sent by the switch to the mobile terminal may be as shown in Figure 6-8, and the format of the command line management protocol data packet sent by the mobile terminal to the switch may be as shown in Figure 6-10. The command line management protocol data packet sent by the mobile terminal to the switch may not include the command line name, and may also include the command line name. When the command line name is included, the command line name length value may be set to an invalid value.
当然,上述命令行管理协议数据包的格式仅仅是举例说明,任何可以实现终端对交换机管理作用的命令行管理协议数据包的格式均能应用到本发明的具体实施例中,在此不一一举例。Certainly, the format of the foregoing command line management protocol data packet is merely an example. Any format of the command line management protocol data packet that can implement the terminal to switch management function can be applied to the specific embodiment of the present invention, and not one by one. For example.
进一步的,上述步骤103中,所述对所述命令行管理协议数据包进行解析之后,所述配置方法还可以包括:Further, in the foregoing step 103, after the parsing the command line management protocol data packet, the configuration method may further include:
步骤106,若只解析出无效的命令行编码,则提示所述交换机对所述用户验证信息的验证失败。Step 106: If only the invalid command line code is parsed, the switch is prompted to verify that the user verification information fails.
此时,通过提示交换机对用户验证信息的验证失败,可提示用户进行重新输入验证信息等操作,方便了用户的使用。At this time, by prompting the switch to fail the verification of the user verification information, the user may be prompted to re-enter the verification information and the like, which is convenient for the user to use.
下面以图6所示的命令行管理协议数据包的格式为例,对本发明的交换机的配置方法举例说明如下:The following takes the format of the command line management protocol packet shown in FIG. 6 as an example. The configuration method of the switch of the present invention is as follows:
如图6所示,本发明实施例的命令行管理协议数据包中包含:命令行编码601,长度为4个字节;协议标识602,长度为2个字节;命令行名称长度603,以字节为单位标识命令行名称的长度,其自身长度为2个字节;命令行名称604,命令行名称604的长度由命令行名称长度603字段域标识;保留字段605,初始化为0,长度为2个字节;CRC 606,初始化为0,长度为2个字节。其中,由于数据包中的数据以4个字节为单位进行保存,因此为了保证数据处理的高效性,如果命令名称604字段的长度对4取模余数不为0,则填充1-3个字节的0,使其长度对4取模余数为0。As shown in FIG. 6, the command line management protocol data packet of the embodiment of the present invention includes: command line code 601, length 4 bytes; protocol identifier 602, length 2 bytes; command line name length 603, The length of the command line name is in bytes, and its length is 2 bytes; the command line name 604, the length of the command line name 604 is identified by the command line name length 603 field field; the reserved field 605, initialized to 0, the length It is 2 bytes; CRC 606, initialized to 0, and has a length of 2 bytes. Wherein, since the data in the data packet is stored in units of 4 bytes, in order to ensure the efficiency of data processing, if the length of the command name 604 field is not 0, the modulo remainder is not 0, and 1-3 words are filled. The 0 of the section has its length modulo remainder of 4 to zero.
如图11所示,本发明实施例的交换机的配置方法包括:As shown in FIG. 11, the configuration method of the switch in this embodiment of the present invention includes:
步骤1101,由交换机将所有配置命令映射成命令行编码,并将命令行编码与配 置命令按照映射关系进行保存。Step 1101, the switch maps all configuration commands to command line encoding, and encodes and matches the command line. The set command is saved according to the mapping relationship.
步骤1102,由交换机保存用户在交换机上创建的用户名和密码。In step 1102, the switch saves the user name and password created by the user on the switch.
步骤1103,由移动终端发送用户输入的用户名和密码给交换机。Step 1103: The user name and password input by the user are sent by the mobile terminal to the switch.
步骤1104,由交换机根据保存的用户名和密码对移动终端发送过来的用户名和密码进行验证,得到验证结果。Step 1104: The switch verifies the username and password sent by the mobile terminal according to the saved username and password, and obtains the verification result.
步骤1105,若验证结果显示验证通过,由交换机使用多个命令行管理协议数据包发送所有配置命令的命令行编码到移动终端,命令行管理协议数据包的封装如图6所示;否则,发送一个命令行管理协议数据包到移动终端,将该命令行管理协议数据包的命令行编码601域设为全0。Step 1105: If the verification result shows that the verification is passed, the switch sends the command line code of all the configuration commands to the mobile terminal by using multiple command line management protocol data packets, and the command line management protocol data packet is encapsulated as shown in FIG. 6; otherwise, the sending is performed. A command line management protocol packet is sent to the mobile terminal, and the command line code 601 field of the command line management protocol packet is set to all zeros.
步骤1106,由移动终端逐个解析收到的命令行管理协议数据包,解析过程为:对协议标识602和CRC 606进行校验,若协议标识602和CRC 606均校验通过,且获取到有效的命令行编码601,则根据命令行名称长度603获取命令行名称604,并记录下有效的命令行编码601及对应的命令行名称604.Step 1106: The received command line management protocol data packet is parsed one by one by the mobile terminal, and the parsing process is: verifying the protocol identifier 602 and the CRC 606, if the protocol identifier 602 and the CRC 606 are both verified and valid. The command line code 601 obtains the command line name 604 according to the command line name length 603, and records the valid command line code 601 and the corresponding command line name 604.
步骤1107,若移动终端只解析到一个命令行编码601全为0的报文,则提示用户验证失败;否则,由移动终端根据记录的命令行编码及对应的命令行名称生成可视化配置列表,将有效的命令行编码对应的命令行名称显示给用户。Step 1107, if the mobile terminal only parses a message with the command line code 601 all 0, the user is prompted to verify the failure; otherwise, the mobile terminal generates a visual configuration list according to the recorded command line code and the corresponding command line name, The command line name corresponding to a valid command line code is displayed to the user.
步骤1108,用户选取要配置的命令行名称。In step 1108, the user selects the name of the command line to be configured.
步骤1109,由移动终端将用户选取的命令名称对应的命令行编码填充到命令行管理协议数据包的命令行编码601域,添加协议标识602,设置命令行名称长度603为0,保留字段605初始化为0,并计算CRC 606的值。Step 1109: The mobile terminal adds the command line code corresponding to the command name selected by the user to the command line code 601 field of the command line management protocol data packet, adds the protocol identifier 602, sets the command line name length 603 to 0, and initializes the reserved field 605. It is 0 and the value of CRC 606 is calculated.
步骤1110,由移动终端将上述步骤1109的命令行管理协议数据包发送给交换机。Step 1110: The command line management protocol data packet of the above step 1109 is sent by the mobile terminal to the switch.
步骤1111,由交换机对接收的数据包中的CRC 606和协议标识602进行校验,若校验通过,则根据上述步骤1101保存的命令行编码与配置命令的映射关系,获取与用户选取的命令行编码对应的配置命令。Step 1111: The switch checks the CRC 606 and the protocol identifier 602 in the received data packet. If the check succeeds, the mapping between the command line code and the configuration command saved in the foregoing step 1101 is performed, and the command selected by the user is obtained. The line corresponds to the corresponding configuration command.
步骤1112,由交换机执行与用户选取的命令行编码对应的配置命令。In step 1112, the switch executes a configuration command corresponding to the command line code selected by the user.
步骤1113,由交换机将执行结果反馈给移动终端。Step 1113: The switch returns the execution result to the mobile terminal.
本发明实施例的交换机的配置方法,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
如图2所示,本发明的实施例还提供了一种交换机的配置装置,应用于移动终端,其中,所述配置装置包括:As shown in FIG. 2, an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a mobile terminal, where the configuration apparatus includes:
第一发送模块,用于向交换机发送用户输入的用户验证信息;a first sending module, configured to send user input information input by the user to the switch;
第一接收模块,用于接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;a first receiving module, configured to receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each The command line name corresponding to the command line code;
解析模块,用于对每个所述命令行管理协议数据包进行解析,若解析出有效的命 令行编码,则获取所述有效的命令行编码对应的命令行名称;a parsing module, configured to parse each of the command line management protocol data packets, if a valid life is parsed If the line is encoded, the command line name corresponding to the valid command line code is obtained;
显示模块,用于将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;a display module, configured to display a command line name corresponding to the valid command line code to the user, and obtain a command line name selected by the user;
第二发送模块,用于将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a second sending module, configured to send a command line code corresponding to the command line name selected by the user to the switch, and obtain, execute, and select a user according to a mapping relationship between the command line encoding and the configuration command by the switch. The command line encodes the corresponding configuration command.
本发明实施例的交换机的配置装置,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
其中,所述用户验证信息可以包括用户名和密码。用户可预先在交换机上创建用户名和密码,由交换机根据预先创建的用户名和密码对终端发送过来的用户名和密码进行验证。The user authentication information may include a username and a password. The user can create a user name and password on the switch in advance, and the switch verifies the user name and password sent by the terminal according to the pre-created user name and password.
本发明的具体实施例中,如图12所示,第一发送模块可通过移动终端的连接管理模块实现;第一接收模块和第二发送模块可通过移动终端的通信协议模块实现;解析模块可通过移动终端的命令结构配置模块实现;显示模块可通过移动终端的人机接口模块实现。In a specific embodiment of the present invention, as shown in FIG. 12, the first sending module may be implemented by a connection management module of the mobile terminal; the first receiving module and the second sending module may be implemented by a communication protocol module of the mobile terminal; The module is configured by a command structure of the mobile terminal; the display module can be implemented by a human interface module of the mobile terminal.
其中,连接管理模块用于交换机和移动终端之间的用户和密码的验证、连接状态维护;命令结构配置模块用于实现交换机配置命令到命令行编码的映射,以及命令行编码到命令行名称的映射;通信协议模块负责移动终端设备和交换机之间的信息交流;交换机管理人机接口模块在移动终端上提供可视化的图形界面,使交换机的管理更加便捷。The connection management module is used for user and password verification and connection state maintenance between the switch and the mobile terminal; the command structure configuration module is used to implement mapping of the switch configuration command to the command line code, and the command line code to the command line name. The communication protocol module is responsible for information exchange between the mobile terminal device and the switch; the switch management human-machine interface module provides a visual graphical interface on the mobile terminal, which makes the management of the switch more convenient.
本发明的具体实施例中,所述命令行管理协议数据包中还可以包含协议标识和循环冗余校验码CRC;In a specific embodiment of the present invention, the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
相应地,所述解析模块具体包括:Correspondingly, the parsing module specifically includes:
第一校验模块,用于对所述协议标识和所述CRC分别进行校验;a first verification module, configured to separately verify the protocol identifier and the CRC;
第一获取模块,用于若所述协议标识和所述CRC均校验通过,则获取每个所述命令行协议信息中包含的命令行编码;a first acquiring module, configured to acquire a command line code included in each of the command line protocol information if the protocol identifier and the CRC are both verified;
第二获取模块,用于若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。The second obtaining module is configured to obtain a command line name corresponding to the valid command line code if a valid command line code is obtained.
进一步的,所述第二发送模块具体包括:Further, the second sending module specifically includes:
第一发送子模块,用于将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a first sending submodule, configured to send a command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, where the switch identifies the protocol and the The CRC is separately verified, and when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
其中,所述命令行管理协议数据包中还可以包含命令行名称长度;The command line management protocol data packet may further include a command line name length;
相应地,所述解析模块具体包括: Correspondingly, the parsing module specifically includes:
第三获取模块,用于若解析出有效的命令行编码,则根据所述命令行名称长度,获取所述有效的命令行编码对应的命令行名称。The third obtaining module is configured to obtain a command line name corresponding to the valid command line code according to the length of the command line name if the valid command line code is parsed.
进一步的,第二发送模块具体包括:Further, the second sending module specifically includes:
填充模块,用于将与用户选取的命令名称对应的命令行编码填充到所述命令行管理协议数据包中的命令行编码域,并将所述命令行管理协议数据包中的命令行名称长度值设为无效值;a padding module, configured to fill a command line encoding field corresponding to the command name selected by the user into a command line encoding field in the command line management protocol data packet, and length the command line name in the command line management protocol data packet The value is set to an invalid value;
第二发送子模块,用于将填充后的所述命令行管理协议数据包返回给所述交换机,由所述交换机对所述命令行管理协议数据包进行解析后,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a second sending submodule, configured to return the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, according to a preset command line encoding The mapping relationship with the configuration command acquires and executes a configuration command corresponding to the command line code selected by the user.
其中,本发明实施例的交换机的配置装置还可以包括:The device for configuring the switch in the embodiment of the present invention may further include:
提示模块,用于若只解析出无效的命令行编码,则提示所述交换机对所述用户验证信息的验证失败。The prompting module is configured to prompt the switch to fail verification of the user verification information if only invalid command line coding is parsed.
本发明实施例的交换机的配置装置,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
需要说明的是,该交换机的配置装置是与上述交换机的配置方法相对应的装置,其中上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到同样的技术效果。It should be noted that the configuration device of the switch is a device corresponding to the configuration method of the switch, and all the implementation manners in the foregoing method embodiments are applicable to the embodiment of the device, and the same technical effects can be achieved.
由于本发明实施例的交换机的配置装置应用于移动终端,因此,本发明实施例还提供了一种移动终端,包括:如上述实施例中所述的交换机的配置装置。其中,上述交换机的配置装置的所述实现实施例均适用于该移动终端的实施例中,也能达到相同的技术效果。本发明的移动终端如可以是手机、平板电脑等移动电子设备。The configuration of the switch of the embodiment of the present invention is applied to the mobile terminal. Therefore, the embodiment of the present invention further provides a mobile terminal, including: the configuration device of the switch as described in the foregoing embodiment. The implementation examples of the configuration device of the switch are applicable to the embodiment of the mobile terminal, and the same technical effects can be achieved. The mobile terminal of the present invention may be a mobile electronic device such as a mobile phone or a tablet computer.
如图3所示,本发明的实施例还提供了一种交换机的配置方法,应用于交换机,所述配置方法包括:As shown in FIG. 3, an embodiment of the present invention further provides a method for configuring a switch, which is applied to a switch, and the configuration method includes:
步骤301,接收移动终端发送的用户验证信息;Step 301: Receive user authentication information sent by the mobile terminal.
步骤302,根据预存的用户信息对所述用户验证信息进行验证,得到验证结果;Step 302: Verify the user verification information according to the pre-stored user information, and obtain a verification result.
步骤303,根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包;Step 303: Return, according to the verification result, a command line management protocol data packet including a command line code corresponding to the command line code and the command line code to the mobile terminal;
步骤304,接收所述移动终端发送的用户选取的命令行编码,所述用户选取的命令行编码为所述移动终端对所述命令行管理协议数据包进行解析,由所述移动终端将解析出的有效的命令行编码对应的命令行名称显示给用户,并由所述移动终端获取的用户选取的命令行名称所对应的命令行编码;Step 304: Receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet, and the mobile terminal will parse out The command line name corresponding to the valid command line code is displayed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
步骤305,根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。Step 305: Acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
本发明实施例的交换机的配置方法,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。 The configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
本发明的具体实施例中,上述步骤303的步骤具体包括:In the specific embodiment of the present invention, the step of step 303 specifically includes:
步骤3031,若所述用户验证信息验证通过,则向所述移动终端返回包含有效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包,否则,向所述移动终端返回包含无效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包。Step 3031: If the user verification information is verified, return a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name to the mobile terminal, otherwise, return to the mobile terminal. A command-line management protocol packet containing an invalid command line encoding and command line name corresponding to the command line encoding.
此时,只有用户验证信息验证通过时,才会向移动终端返回有效的命令行编码,避免了非法用户对交换机的破坏,保证了移动终端对交换机管理的安全性。At this time, only when the user verification information is verified, a valid command line code is returned to the mobile terminal, which avoids the damage of the illegal user to the switch, and ensures the security of the mobile terminal to the switch management.
本发明的具体实施例中,所述命令行管理协议数据包中还可以包含协议标识和循环冗余校验码CRC;In a specific embodiment of the present invention, the command line management protocol data packet may further include a protocol identifier and a cyclic redundancy check code CRC;
上述步骤304中,所述接收所述移动终端发送的用户选取的命令行编码的步骤包括:In the above step 304, the step of receiving the command line code selected by the user sent by the mobile terminal includes:
步骤3041,接收所述移动终端一并发送的所述用户选取的命令行编码、所述协议标识和所述CRC。Step 3041: Receive, by the mobile terminal, a command line code selected by the user, the protocol identifier, and the CRC.
进一步的,上述步骤305之前还可以包括:Further, before step 305, the method may further include:
步骤3051,对所述协议标识和所述CRC分别进行校验,若所述协议标识和所述CRC均校验通过,则根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。Step 3051: Perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, obtain and execute according to a mapping relationship between a preset command line encoding and a configuration command. The configuration command corresponding to the command line code selected by the user.
这里,协议标识是命令行管理协议的标识,具有唯一性。而CRC的值由命令行管理协议的所有字段根据CRC算法计算得出。Here, the protocol identifier is an identifier of the command line management protocol and is unique. The value of the CRC is calculated by the CRC algorithm from all fields of the command line management protocol.
此时,通过对协议数据包中的协议标识进行校验,可判断获取到的协议数据包是否为命令行管理协议数据包,以在获取到的数据包为命令行管理协议数据包时,进行后续操作。且通过对协议数据包中的CRC进行校验,可判断获取到的数据包在传输过程中是否出现错误。在CRC校验通过时,可判断获取到的数据包在传输过程中没有出错,否则,判断获取到的数据包在传输过程中出现了错误。从而通过对协议标识和CRC分别进行校验,保证了交换机接收数据的准确性和有效性。At this time, by verifying the protocol identifier in the protocol data packet, it can be determined whether the obtained protocol data packet is a command line management protocol data packet, so that when the obtained data packet is a command line management protocol data packet, Follow-up actions. And by verifying the CRC in the protocol packet, it can be determined whether the obtained packet has an error during the transmission. When the CRC check is passed, it can be judged that the obtained data packet has no error during the transmission process; otherwise, it is judged that the acquired data packet has an error during the transmission process. Therefore, by verifying the protocol identifier and the CRC separately, the accuracy and validity of the data received by the switch are ensured.
其中,上述步骤305之后还可以包括:The step 305 may further include:
步骤306,将执行结果返回给所述移动终端。Step 306, returning an execution result to the mobile terminal.
此时,通过将执行结果返回给移动终端,使用户可及时获取到执行结果,以根据执行结果进行后续操作,方便了用户的使用,提高了实用性和便利性。At this time, by returning the execution result to the mobile terminal, the user can obtain the execution result in time to perform subsequent operations according to the execution result, which is convenient for the user to use, and improves the practicability and convenience.
本发明实施例的交换机的配置方法,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration method of the switch in the embodiment of the present invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
如图4所示,本发明的实施例还提供了一种交换机的配置装置,应用于交换机,所述配置装置包括:As shown in FIG. 4, an embodiment of the present invention further provides a configuration apparatus for a switch, which is applied to a switch, and the configuration apparatus includes:
第二接收模块,用于接收移动终端发送的用户验证信息;a second receiving module, configured to receive user verification information sent by the mobile terminal;
验证模块,用于根据预存的用户信息对所述用户验证信息进行验证,得到验证结 果;a verification module, configured to verify the user verification information according to the pre-stored user information, and obtain a verification result fruit;
返回模块,用于根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包;a returning module, configured to return, to the mobile terminal, a command line management protocol data packet including a command line code corresponding to a command line code according to the verification result;
第三接收模块,用于接收所述移动终端发送的用户选取的命令行编码,所述用户选取的命令行编码为所述移动终端对所述命令行管理协议数据包进行解析,由所述移动终端将解析出的有效的命令行编码对应的命令行名称显示给用户,并由所述移动终端获取的用户选取的命令行名称所对应的命令行编码;a third receiving module, configured to receive a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet by the mobile terminal The terminal displays the command line name corresponding to the valid command line code that is parsed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
执行模块,用于根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And an execution module, configured to acquire and execute a configuration command corresponding to the command line code selected by the user according to a mapping relationship between the preset command line encoding and the configuration command.
本发明实施例的交换机的配置装置,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。The configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
本发明的具体实施例中,如图12所示,第二接收模块和验证模块可通过交换机的连接管理模块实现;返回模块和第三接收模块可通过交换机的通信协议模块实现;执行模块可通过交换机的命令结构配置模块和命令执行模块实现。In a specific embodiment of the present invention, as shown in FIG. 12, the second receiving module and the verification module may be implemented by a connection management module of the switch; the return module and the third receiving module may be implemented by a communication protocol module of the switch; The command structure configuration module and the command execution module of the switch are implemented.
其中,连接管理模块用于交换机和移动终端之间的用户和密码的验证、连接状态维护;命令结构配置模块用于实现交换机配置命令到命令行编码的映射,以及命令行编码到命令行名称的映射;通信协议模块负责移动终端设备和交换机之间的信息交流;命令执行模块负责在交换机上执行收到的命令。The connection management module is used for user and password verification and connection state maintenance between the switch and the mobile terminal; the command structure configuration module is used to implement mapping of the switch configuration command to the command line code, and the command line code to the command line name. Mapping; the communication protocol module is responsible for information exchange between the mobile terminal device and the switch; the command execution module is responsible for executing the received command on the switch.
本发明的具体实施例中,所述返回模块包括:In a specific embodiment of the present invention, the returning module includes:
返回子模块,用于若所述用户验证信息验证通过,则向所述移动终端返回包含有效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包,否则,向所述移动终端返回包含无效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包。Returning to the submodule, if the user verification information is verified, returning, to the mobile terminal, a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name, otherwise, The mobile terminal returns a command line management protocol packet containing an invalid command line code and a command line name corresponding to the command line code.
其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
所述第三接收模块包括:The third receiving module includes:
第一接收子模块,用于接收所述移动终端一并发送的所述用户选取的命令行编码、所述协议标识和所述CRC。And a first receiving submodule, configured to receive, by the mobile terminal, the command line code selected by the user, the protocol identifier, and the CRC.
其中,所述配置装置还包括:The configuration device further includes:
第三校验模块,用于对所述协议标识和所述CRC分别进行校验,若所述协议标识和所述CRC均校验通过,则根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。a third check module, configured to perform verification on the protocol identifier and the CRC respectively, and if the protocol identifier and the CRC are both verified, according to a mapping relationship between a preset command line encoding and a configuration command And acquiring and executing a configuration command corresponding to the command line code selected by the user.
进一步的,所述配置装置还包括:Further, the configuring device further includes:
第二返回模块,用于将执行结果返回给所述移动终端。And a second returning module, configured to return an execution result to the mobile terminal.
本发明实施例的交换机的配置装置,通过移动终端实现了对交换机的管理作用,方便了用户的使用,提高了实用性。 The configuration device of the switch in the embodiment of the invention implements the management function of the switch through the mobile terminal, which facilitates the use of the user and improves the practicability.
需要说明的是,该交换机的配置装置是与上述交换机的配置方法相对应的装置,其中上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到同样的技术效果。It should be noted that the configuration device of the switch is a device corresponding to the configuration method of the switch, and all the implementation manners in the foregoing method embodiments are applicable to the embodiment of the device, and the same technical effects can be achieved.
由于本发明实施例的交换机的配置装置应用于交换机,因此,本发明实施例还提供了一种交换机,包括:如上述实施例中所述的交换机的配置装置。其中,上述交换机的配置装置的所述实现实施例均适用于该交换机的实施例中,也能达到相同的技术效果。The configuration of the switch of the embodiment of the present invention is applied to the switch. Therefore, the embodiment of the present invention further provides a switch, including: a configuration device of the switch as described in the foregoing embodiment. The implementation examples of the configuration device of the switch are applicable to the embodiment of the switch, and the same technical effects can be achieved.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.
工业实用性Industrial applicability
本发明适用于交换机设备的网络配置,用以实现移动终端设备对交换机的管理。 The present invention is applicable to a network configuration of a switch device, and is used to implement management of a switch by a mobile terminal device.

Claims (15)

  1. 一种交换机的配置方法,应用于移动终端,其中,所述配置方法包括:A configuration method of a switch is applied to a mobile terminal, where the configuration method includes:
    向交换机发送用户输入的用户验证信息;Sending user authentication information input by the user to the switch;
    接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;Receiving at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and a command corresponding to each command line code Row name
    对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称;Parsing each of the command line management protocol data packets, and if a valid command line code is parsed, obtaining a command line name corresponding to the valid command line code;
    将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;Displaying the command line name corresponding to the valid command line code to the user, and obtaining the command line name selected by the user;
    将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。The command line code corresponding to the command line name selected by the user is sent to the switch, and the switch obtains and executes the configuration corresponding to the command line code selected by the user according to the mapping relationship between the preset command line encoding and the configuration command. command.
  2. 根据权利要求1所述的配置方法,其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The configuration method according to claim 1, wherein the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
    相应地,所述对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称,包括:Correspondingly, the command line management protocol data packet is parsed. If a valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, including:
    对所述协议标识和所述CRC分别进行校验;Performing verification on the protocol identifier and the CRC respectively;
    若所述协议标识和所述CRC均校验通过,则获取每个所述命令行管理协议数据包中包含的命令行编码;And if the protocol identifier and the CRC are both verified, obtaining a command line code included in each of the command line management protocol data packets;
    若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。If a valid command line code is obtained, the command line name corresponding to the valid command line code is obtained.
  3. 根据权利要求2所述的配置方法,其中,所述将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令,包括:The configuration method according to claim 2, wherein the command line code corresponding to the command line name selected by the user is sent to the switch, and the switch maps the mapping relationship between the command line encoding and the configuration command according to the preset command line. , obtain and execute the configuration command corresponding to the command line code selected by the user, including:
    将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。Transmitting the command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, and verifying, by the switch, the protocol identifier and the CRC, respectively. When the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
  4. 根据权利要求1所述的配置方法,其中,所述命令行管理协议数据包中还包含命令行名称长度;The configuration method according to claim 1, wherein the command line management protocol data packet further includes a command line name length;
    相应地,所述若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称,为:Correspondingly, if the valid command line code is parsed, the command line name corresponding to the valid command line code is obtained, as follows:
    若解析出有效的命令行编码,则根据所述命令行名称长度,获取所述有效的命令行编码对应的命令行名称。If a valid command line code is parsed, the command line name corresponding to the valid command line code is obtained according to the length of the command line name.
  5. 根据权利要求4所述的配置方法,其中,所述将与用户选取的命令行名称对 应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令,包括:The configuration method according to claim 4, wherein said command line name pair to be selected by a user The command line code is sent to the switch, and the switch obtains and executes a configuration command corresponding to the command line code selected by the user according to the mapping relationship between the command line encoding and the configuration command, including:
    将与用户选取的命令名称对应的命令行编码填充到所述命令行管理协议数据包中的命令行编码域,并将所述命令行管理协议数据包中的命令行名称长度值设为无效值;Filling a command line encoding field corresponding to the command name selected by the user into the command line encoding field in the command line management protocol data packet, and setting the command line name length value in the command line management protocol data packet to an invalid value ;
    将填充后的所述命令行管理协议数据包返回给所述交换机,由所述交换机对所述命令行管理协议数据包进行解析后,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。Returning the filled command line management protocol data packet to the switch, and after the switch parses the command line management protocol data packet, according to a mapping relationship between a preset command line encoding and a configuration command, And executing a configuration command corresponding to the command line code selected by the user.
  6. 根据权利要求1所述的配置方法,其中,所述对每个所述命令行管理协议数据包进行解析之后,所述配置方法还包括:The configuration method according to claim 1, wherein after the parsing of each of the command line management protocol data packets, the configuration method further includes:
    若只解析出无效的命令行编码,则提示所述交换机对所述用户验证信息的验证失败。If only the invalid command line code is parsed, the switch is prompted to verify the verification of the user information.
  7. 一种交换机的配置装置,应用于移动终端,其中,所述配置装置包括:A configuration device for a switch is applied to a mobile terminal, where the configuration device includes:
    第一发送模块,设置为向交换机发送用户输入的用户验证信息;a first sending module, configured to send user input information input by the user to the switch;
    第一接收模块,设置为接收所述交换机对所述用户验证信息进行验证后返回的至少一个命令行管理协议数据包,每个所述命令行管理协议数据包中包含至少一条命令行编码及每条命令行编码对应的命令行名称;a first receiving module, configured to receive at least one command line management protocol data packet returned by the switch after verifying the user verification information, where each command line management protocol data packet includes at least one command line code and each The command line name corresponding to the command line code;
    解析模块,设置为对每个所述命令行管理协议数据包进行解析,若解析出有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称;The parsing module is configured to parse each of the command line management protocol data packets, and if a valid command line encoding is parsed, obtain a command line name corresponding to the valid command line encoding;
    显示模块,设置为将所述有效的命令行编码对应的命令行名称显示给用户,并获取用户选取的命令行名称;a display module, configured to display a command line name corresponding to the valid command line code to the user, and obtain a command line name selected by the user;
    第二发送模块,设置为将与用户选取的命令行名称对应的命令行编码发送给所述交换机,由所述交换机根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。The second sending module is configured to send a command line code corresponding to the command line name selected by the user to the switch, and the switch obtains and executes the selection according to the mapping relationship between the command line encoding and the configuration command by the switch. The command line encodes the corresponding configuration command.
  8. 根据权利要求7所述的配置装置,其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The configuration apparatus according to claim 7, wherein the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
    相应地,所述解析模块包括:Correspondingly, the parsing module comprises:
    第一校验模块,设置为对所述协议标识和所述CRC分别进行校验;a first verification module, configured to separately verify the protocol identifier and the CRC;
    第一获取模块,设置为若所述协议标识和所述CRC均校验通过,则获取每个所述命令行协议信息中包含的命令行编码;a first acquiring module, configured to acquire a command line code included in each of the command line protocol information if the protocol identifier and the CRC are both verified;
    第二获取模块,设置为若获取到有效的命令行编码,则获取所述有效的命令行编码对应的命令行名称。The second obtaining module is configured to obtain a command line name corresponding to the valid command line code if a valid command line code is obtained.
  9. 根据权利要求8所述的配置装置,其中,所述第二发送模块包括:The configuration device according to claim 8, wherein the second sending module comprises:
    第一发送子模块,设置为将与用户选取的命令行名称对应的命令行编码、所述协议标识和所述CRC一并发送给所述交换机,由所述交换机对所述协议标识和所述 CRC分别进行校验,且所述协议标识和所述CRC均校验通过时,根据预设的命令行编码与配置命令的映射关系,获取并执行与用户选取的命令行编码对应的配置命令。a first sending submodule, configured to send a command line code corresponding to the command line name selected by the user, the protocol identifier, and the CRC to the switch, where the switch identifies the protocol and the The CRC is separately verified, and when the protocol identifier and the CRC are both verified, the configuration command corresponding to the command line code selected by the user is obtained and executed according to the mapping relationship between the preset command line encoding and the configuration command.
  10. 一种移动终端,包括:如权利要求7-9任一项所述的交换机的配置装置。A mobile terminal comprising: the apparatus for configuring a switch according to any one of claims 7-9.
  11. 一种交换机的配置方法,应用于交换机,其中,所述配置方法包括:A configuration method of a switch is applied to a switch, where the configuration method includes:
    接收移动终端发送的用户验证信息;Receiving user authentication information sent by the mobile terminal;
    根据预存的用户信息对所述用户验证信息进行验证,得到验证结果;Verifying the user verification information according to the pre-stored user information, and obtaining a verification result;
    根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包;And returning, to the mobile terminal, a command line management protocol data packet including a command line name corresponding to the command line code and the command line code, according to the verification result;
    接收所述移动终端发送的用户选取的命令行编码,所述用户选取的命令行编码为所述移动终端对所述命令行管理协议数据包进行解析,由所述移动终端将解析出的有效的命令行编码对应的命令行名称显示给用户,并由所述移动终端获取的用户选取的命令行名称所对应的命令行编码;Receiving a command line code selected by the user sent by the mobile terminal, where the command line code selected by the user is used by the mobile terminal to parse the command line management protocol data packet, and the mobile terminal will parse the valid data. The command line name corresponding to the command line code is displayed to the user, and the command line code corresponding to the command line name selected by the user acquired by the mobile terminal is encoded;
    根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And obtaining, according to a preset mapping relationship between the command line encoding and the configuration command, a configuration command corresponding to the command line code selected by the user.
  12. 根据权利要求11所述的配置方法,其中,所述根据所述验证结果,向所述移动终端返回包含有命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包的步骤包括:The configuration method according to claim 11, wherein the step of returning, to the mobile terminal, a command line management protocol data packet including a command line code corresponding to a command line code and a command line code according to the verification result includes: :
    若所述用户验证信息验证通过,则向所述移动终端返回包含有效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包,若所述用户验证信息验证没有通过,向所述移动终端返回包含无效的命令行编码及命令行编码对应的命令行名称的命令行管理协议数据包。And if the user verification information is verified, returning, to the mobile terminal, a command line management protocol data packet containing a valid command line code and a command line code corresponding command line name, if the user verification information verification fails, The mobile terminal returns a command line management protocol data packet containing an invalid command line code and a command line name corresponding to the command line code.
  13. 根据权利要求11所述的配置方法,其中,所述命令行管理协议数据包中还包含协议标识和循环冗余校验码CRC;The configuration method according to claim 11, wherein the command line management protocol data packet further includes a protocol identifier and a cyclic redundancy check code CRC;
    所述接收所述移动终端发送的用户选取的命令行编码的步骤包括:The step of receiving the command line code selected by the user sent by the mobile terminal includes:
    接收所述移动终端一并发送的所述用户选取的命令行编码、所述协议标识和所述CRC。Receiving, by the mobile terminal, the command line code selected by the user, the protocol identifier, and the CRC.
  14. 根据权利要求13所述的配置方法,其中,所述根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令之前还包括:The configuration method according to claim 13, wherein the obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, the obtaining and executing the configuration command corresponding to the command line encoding selected by the user, further includes:
    对所述协议标识和所述CRC分别进行校验,若所述协议标识和所述CRC均校验通过,则根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令。And verifying the protocol identifier and the CRC respectively, if the protocol identifier and the CRC are both verified, obtaining and executing the user selection according to a mapping relationship between a preset command line encoding and a configuration command. The command line encodes the corresponding configuration command.
  15. 根据权利要求11所述的配置方法,其中,所述根据预设的命令行编码与配置命令的映射关系,获取并执行所述用户选取的命令行编码对应的配置命令之后还包括: The configuration method according to claim 11, wherein the obtaining, according to the mapping relationship between the preset command line encoding and the configuration command, obtaining and executing the configuration command corresponding to the command line encoding selected by the user, further comprises:
    将执行结果返回给所述移动终端。 The execution result is returned to the mobile terminal.
PCT/CN2016/077140 2015-05-13 2016-03-23 Method and apparatus for configuring switch, mobile terminal, and switch WO2016180089A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510242113.7 2015-05-13
CN201510242113.7A CN106301818A (en) 2015-05-13 2015-05-13 The collocation method of a kind of switch, device, mobile terminal and switch

Publications (1)

Publication Number Publication Date
WO2016180089A1 true WO2016180089A1 (en) 2016-11-17

Family

ID=57247772

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/077140 WO2016180089A1 (en) 2015-05-13 2016-03-23 Method and apparatus for configuring switch, mobile terminal, and switch

Country Status (2)

Country Link
CN (1) CN106301818A (en)
WO (1) WO2016180089A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109088855A (en) * 2018-07-12 2018-12-25 新华三信息安全技术有限公司 A kind of identity authentication method and equipment
CN109067755B (en) * 2018-08-17 2021-06-04 深圳市永达电子信息股份有限公司 Access control method and system for security switch
CN109245947A (en) * 2018-10-30 2019-01-18 北京计算机技术及应用研究所 A kind of interchanger and its tactics configuring method
CN111614498A (en) * 2020-05-22 2020-09-01 南京金税网安系统软件有限公司 Configuration command interaction system of multi-board core switch and implementation method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139751B1 (en) * 2000-12-01 2006-11-21 Juniper Networks, Inc. Searching and reusing information from previously executed control instructions in a data forwarding device
CN102546239A (en) * 2011-12-26 2012-07-04 苏州风采信息技术有限公司 Operation method of server-side configuration
CN104346280A (en) * 2014-10-31 2015-02-11 上海斐讯数据通信技术有限公司 Method and system for exchanger reset configuration checking

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139751B1 (en) * 2000-12-01 2006-11-21 Juniper Networks, Inc. Searching and reusing information from previously executed control instructions in a data forwarding device
CN102546239A (en) * 2011-12-26 2012-07-04 苏州风采信息技术有限公司 Operation method of server-side configuration
CN104346280A (en) * 2014-10-31 2015-02-11 上海斐讯数据通信技术有限公司 Method and system for exchanger reset configuration checking

Also Published As

Publication number Publication date
CN106301818A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN103152331B (en) The method, system and the cloud server that log in/register is carried out by mobile terminal
US9078122B2 (en) Method and apparatus of providing messaging service and callback feature to mobile stations
WO2016180089A1 (en) Method and apparatus for configuring switch, mobile terminal, and switch
TWI735429B (en) Authentication method, device, system and electronic equipment for client login server end
CN103124267B (en) The method, system and the cloud server that log in/register is carried out by mobile terminal
US9148412B2 (en) Secure configuration of authentication servers
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
CN104363213A (en) Register and login control method for network household appliance
CN105828329B (en) Mobile terminal authentication management method
ES2748405T3 (en) Method, Autoconfiguration Server (ACS), and system to obtain the status of a device based on the Tr069 protocol
TW201707415A (en) Method, Apparatus, and System for Secure Authentication
US20140161121A1 (en) Method, System and Device for Authenticating IP Phone and Negotiating Voice Domain
US20210392045A1 (en) Device Configuration Method, System, and Apparatus
EP4271015A1 (en) Registration method and apparatus, authentication method and apparatus, routing indicator determining method and apparatus, entity, and terminal
WO2021057802A1 (en) Das system management method and device, electronic device, and storage medium
CN103841587B (en) A kind of implementation method, the apparatus and system of Internet of Things Convergence gateway
EP2670107B1 (en) Communication method for wireless terminal and host device, and wireless terminal and host device
CN112087412B (en) Service access processing method and device based on unique token
WO2014044218A2 (en) Plug-and-play network element, system, and access method
WO2017124728A1 (en) Method and apparatus for acquiring router configuration
CN104301285B (en) Login method for web system
CN111984958B (en) Authentication method supporting VNC double factors
US10979287B2 (en) Method and apparatus for receiving a solution when configuration function verification fails in a terminal
CN115150075A (en) Method, apparatus, device and medium for data communication based on shared secret key
WO2020253330A1 (en) Method and apparatus for customer premise equipment configuration management

Legal Events

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

Ref document number: 16791939

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16791939

Country of ref document: EP

Kind code of ref document: A1