Command prompt changing method and device, equipment and storage medium

By loading customized configuration files in the controlled device, parsing and updating command prompts, the problem that enterprises need to learn new commands when using different network devices is solved, improving development efficiency and reducing workload.

CN120200906APending Publication Date: 2025-06-24RUIJIE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311773903.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

When an enterprise purchases network equipment from other companies, each enterprise has its own command prompt, developers need to learn new commands, which increases the inconvenience and work burden of development work.

Method used

Changes to command prompts are implemented by loading customized configuration files in the controlled device. The specific steps include parsing the change commands in the customized configuration file, updating the valid command set, and storing the new command prompt as a form of the command tree for quick search and update.

Benefits of technology

The batch changes of the command prompt are implemented, which reduces the time for developers to learn new commands, improves the development efficiency of network devices, and avoids the need to replace devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120200906A_ABST
    Figure CN120200906A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a command prompt changing method and device, equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps that controlled equipment loads a customized configuration file after being started; a first change command of at least one group of command prompts is recorded in the customized configuration file; wherein the change command is used for indicating to replace an original command prompt in the controlled equipment with a set command prompt; the controlled device analyzes the at least one first change command in the customized configuration file, and updates an effective command set in the controlled device according to the at least one first change command; the effective command set is used for controlling the controlled equipment by the control equipment. In the embodiment of the invention, by customizing the configuration file, when the controlled equipment needs to be controlled, the configuration file can be directly loaded and analyzed to complete the change of the command, a new command does not need to be learned, and the equipment does not need to be replaced, so that a lot of time is saved for developers to develop the controlled equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technologies, and in particular, to a method, device, equipment, and storage medium for changing a command prompt. Background Art

[0002] With the continuous improvement of the informatization level of various industries, more and more enterprises are involved in the development of network devices. The command-line interface is the most basic and widely used user interface for network devices. Therefore, after memorizing the commands of an enterprise, it is possible to conveniently and quickly develop the products of that enterprise.

[0003] However, when an enterprise purchases network devices from other non-itself enterprises, since non-itself enterprises have their own commands, it is impossible to use the commands of the enterprise itself to develop the purchased network devices. It is necessary to learn the commands of non-itself enterprises before developing the purchased network devices, which will cause an additional workload for the developers of the enterprise and bring inconvenience to the development work. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, equipment, and storage medium for changing a command prompt, which are used to improve the development efficiency of developers for network devices.

[0005] In a first aspect, the embodiments of the present application provide a method for changing a command prompt, and the method includes:

[0006] After starting up, a controlled device loads a customized configuration file; at least one first change command for a command prompt is recorded in the customized configuration file; wherein, the change command is used to indicate replacing an original command prompt in the controlled device with a set command prompt;

[0007] The controlled device parses at least one first change command in the customized configuration file, and updates a valid command set in the controlled device according to the at least one first change command; the valid command set is used to control a device to manipulate the controlled device.

[0008] In the embodiments of the present application, by customizing the configuration file, commands can be preset according to the controlled device, and more than one set of command prompts are stored in the configuration file, enabling batch change of commands, making command change more convenient and efficient; the controlled device realizes command change by parsing the customized configuration file and updates the valid command set with the successfully parsed changed commands, so that the latest and valid changed commands are stored in the valid command set. By customizing the configuration file for the controlled device, when it is necessary to control the controlled device, the configuration file can be directly loaded and parsed to complete command change. When the commands are different, there is no need to learn new commands or replace the device, saving a large amount of time for developers to develop the controlled device and improving the development efficiency.

[0009] Optionally, the valid command set is stored in the form of a command tree; the first change command is to replace the first command prompt with the second command prompt;

[0010] Updating the valid command set in the controlled device according to the at least one first change command includes:

[0011] Deleting the part corresponding to the first command prompt from the command tree and adding the part corresponding to the second command prompt to obtain the valid command set in the controlled device.

[0012] In the embodiments of the present application, by storing the valid command set in the form of a command tree, it is more convenient to find the first command prompt for the first change command, and the form of the command tree is easy to understand and more intuitive to store in the form of a command tree; through the command tree, the part corresponding to the first command prompt is deleted instead of deleting all of the first command prompt, avoiding adding duplicate parts after deleting all of the first command prompt, saving the time for updating the valid command set.

[0013] Optionally, it further includes:

[0014] The controlled device receives a second change command sent by the control device through the command line interface;

[0015] The controlled device parses the second change command and updates the valid command set in the controlled device according to the second change command;

[0016] The controlled device feeds back a change success message through the command line interface.

[0017] In the embodiments of the present application, by directly receiving the second change command, the controlled device can separately modify the change command of the controlled device, avoiding the problem of re-modifying the customized configuration file after adding a new change command after the customized configuration file is completed; by updating the valid command set, the second change command can be saved to the valid command set; by the controlled device feeding back a change success message, the control device can use the set change command to control the controlled device, realizing message intercommunication between the controlled device and the control device.

[0018] Optionally, after the controlled device feeds back a change success message through the command line interface, it further includes:

[0019] The controlled device generates a customized configuration file containing the second change command based on the save instruction sent by the control device.

[0020] In the embodiments of the present application, through the save instruction sent by the control device, the controlled device stores the change command, avoiding re-entering the change instruction when changing the command of the controlled device again; generating a customized configuration file for the second change command, when the controlled device restarts, it does not need to change the command through the command line interface again, and can directly load and parse the customized configuration file to complete the change of the command.

[0021] In a second aspect, embodiments of the present application provide a method for changing a command prompt, the method including:

[0022] The controlled device receives a second change command sent by the control device through the command line interface; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt;

[0023] The controlled device parses the second change command and updates the valid command set in the controlled device according to the second change command; the valid command set is used for the control device to control the controlled device;

[0024] The controlled device feeds back a change success message through the command line interface.

[0025] In the embodiments of the present application, by directly receiving the second change command, the controlled device can separately modify the change command of the controlled device, avoiding the problem of re-modifying the customized configuration file after adding a new change command after the customized configuration file is completed; by updating the valid command set, the second change command can be saved to the valid command set; by the controlled device feeding back a change success message, the control device can use the set change command to control the controlled device, realizing message intercommunication between the controlled device and the control device.

[0026] Optionally, after the controlled device feeds back a change success message through the command line interface, it further includes:

[0027] The controlled device generates a customized configuration file containing the second change command based on the save instruction sent by the control device; the customized configuration file is used for the controlled device to load and parse it into a valid command set after restarting.

[0028] In the embodiments of the present application, through the save instruction sent by the control device, the controlled device stores the change command, avoiding re-entering the change instruction when changing the commands of the controlled device again; generating a customized configuration file with the second change command, when the controlled device restarts, it does not need to change the command through the command line interface again, and can directly load and parse the customized configuration file to complete the change of the command.

[0029] In a third aspect, embodiments of the present application provide a method for changing a command prompt, the method including:

[0030] The control device sends a second change command to the controlled device through the command line interface; wherein, the change command is used to indicate replacing the original command prompt in the controlled device with a set command prompt;

[0031] The control device receives, through the command line interface, change success information fed back by the controlled device; the change success information is sent by the controlled device after updating the valid command set in the controlled device according to the second change command; the valid command set is used for the control device to control the controlled device.

[0032] Optionally, after the valid command set is used for the control device to control the controlled device, it further includes:

[0033] The control device sends a save instruction to the controlled device through the command line interface; the save instruction is used to instruct the controlled device to generate a customized configuration file containing the second change command; the customized configuration file is used for the controlled device to load and parse it into a valid command set after restarting.

[0034] In a fourth aspect, a device for changing a command prompt, the device includes:

[0035] A loading module, configured to load a customized configuration file by the controlled device after startup; at least one first change command of a command prompt is recorded in the customized configuration file; wherein, the change command is used to indicate replacing the original command prompt in the controlled device with a set command prompt;

[0036] An analysis module, configured to analyze at least one first change command in the customized configuration file by the controlled device, and update the valid command set in the controlled device according to the at least one first change command; the valid command set is used for the control device to control the controlled device.

[0037] Optionally, the parsing module is specifically configured to:

[0038] Delete the part corresponding to the first command prompt from the command tree, and add the part corresponding to the second command prompt to obtain the effective command set in the controlled device.

[0039] Optionally, the parsing module is further configured to:

[0040] The controlled device receives a second change command sent by the control device through the command line interface;

[0041] The controlled device parses the second change command and updates the effective command set in the controlled device according to the second change command;

[0042] The controlled device feeds back a change success message through the command line interface.

[0043] Optionally, the parsing module is further configured to:

[0044] The controlled device generates a customized configuration file including the second change command based on the save instruction sent by the control device.

[0045] In a fifth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the above method for changing the command prompt are implemented.

[0046] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device is caused to execute the steps of the above method for changing the command prompt.

[0047] In the embodiments of the present application, through the customized configuration file, commands can be preset according to the controlled device, and more than one set of command prompts are stored in the configuration file, so that commands can be changed in batches, making the command change more convenient and efficient; the controlled device parses the customized configuration file to implement command change and updates the effective command set with the successfully parsed change commands, so that the latest and valid change commands are stored in the effective command set. By customizing the configuration file of the controlled device, when it is necessary to control the controlled device, the configuration file can be directly loaded and parsed to complete the command change. When the commands are different, there is no need to learn new commands or replace the device, saving a lot of time for developers to develop the controlled device and improving the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0049] Figure 1 It is a system architecture diagram provided by an embodiment of the present application;

[0050] Figure 2 It is a schematic flowchart of a method for changing a command prompt provided by an embodiment of the present application Figure 1 ;

[0051] Figure 3 It is a schematic flowchart of a method for changing a command prompt provided by an embodiment of the present application Figure 2 ;

[0052] Figure 4 It is a schematic flowchart of a method for changing a command prompt provided by an embodiment of the present application Figure 3 ;

[0053] Figure 5 It is a device for changing a command prompt provided by an embodiment of the present application;

[0054] Figure 6 It is a computer device provided by an embodiment of the present application. Detailed implementation manners

[0055] In order to make the objectives, technical solutions and advantages of the present invention clearer, the following will further describe the present invention in detail with reference to the drawings. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0056] In some embodiments, referring to Figure 1 , it is a system architecture diagram provided by an embodiment of the present application. The system at least includes a control device 101 and a controlled device 102. The control device 101 is pre-installed with the business applications of the controlled device 102. Among them, the business applications are client applications, web applications, mini-program applications, etc. The terminal device 101 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart home appliance, a smart voice interaction device, a smart vehicle-mounted device, etc., but is not limited thereto.

[0057] The controlled device 102 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

[0058] In some embodiments, based on Figure 1 the system architecture diagram, an embodiment of the present application provides a process for a method of changing a command prompt, as Figure 2 shown. The process of this method is executed by a computer device, and the computer device can be Figure 1 the controlled device shown in the figure, and includes the following steps:

[0059] Step 201: After the controlled device is started, it loads a customized configuration file; at least one first change command for the command prompt is recorded in the customized configuration file; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt.

[0060] Specifically, the controlled device can be a network device commonly used in enterprises, such as switches, routers, firewalls, bridges, hubs, gateways, VPN servers, network interface cards (NICs), wireless access points (WAPs), modems, 5G base stations, optical terminal machines, optical fiber transceivers, optical cables, etc.

[0061] The configuration file is a file that stores the first change command. The first change command includes at least one set of command prompts, and the original command prompt and the set command prompt are a set of command prompts. The change command is used to replace the original command prompt in the controlled device with the set command prompt. Since different enterprises have different command prompts, different enterprises need to customize the configuration file. The customized configuration file is customized by the control device and then sent to the controlled device. After the controlled device is started, it is necessary to load the customized configuration file first and load the customized configuration file into the controlled device.

[0062] Step 202: The controlled device parses at least one first change command in the customized configuration file and updates the valid command set in the controlled device according to at least one first change command; the valid command set is used for the control device to control the controlled device.

[0063] Specifically, the controlled device stores an effective command set, which consists of all commands for controlling the controlled device. After the customized configuration file is loaded into the controlled device, the controlled device parses the first change command in the customized configuration file to obtain the original command prompt and the set command prompt in the first change command, then replaces the original command prompt with the set command prompt, and stores the set command prompt in the effective command set, thereby completing the update of the effective command set.

[0064] For example, if the controlled device is a switch, after parsing the customized configuration file, the switch obtains the first change command as follows:

[0065]

[0066]

[0067] The change command is: change "show running-config" to "display current-config", the command prompts are "show", "display", "running-config", "current-config", the original command prompts are: "show", "running-config", and the set command prompts are: "display", "current-config". Store "display current-config" in the effective command set. "display current-config" is an effective command, and the original command "show running-config" is an invalid command. The switch is controlled by the set command prompt "displaycurrent-config".

[0068] In the embodiment of the present application, through the customized configuration file, commands can be preset according to the controlled device, and there are more than one set of command prompts stored in the configuration file, which can realize batch change of commands, making the command change more convenient and efficient; the controlled device realizes the change of commands by parsing the customized configuration file, and updates the effective command set with the successfully parsed change commands, so that the effective command set stores the latest and effective change commands. Through the customized configuration file of the controlled device, when it is necessary to control the controlled device, the configuration file can be directly loaded and parsed to complete the change of commands. When the commands are different, there is no need to learn new commands or replace the device, which saves a lot of time for developers to develop the controlled device and improves the development efficiency.

[0069] The valid command set is stored in the form of a command tree; the first change command is to replace the first command prompt with the second command prompt; updating the valid command set in the controlled device according to at least one first change command includes: deleting the part corresponding to the first command prompt from the command tree and adding the part corresponding to the second command prompt to obtain the valid command set in the controlled device.

[0070] Specifically, the valid command set can be stored in the form of a command tree. The tree structure is a non-linear data structure that is widely used in computer science and mathematics. The tree structure consists of a series of nodes and edges, and the relationship between them is that a parent node can have multiple child nodes, but each child node can only have one parent node, thus forming a hierarchical, directed acyclic graph with a root node and child nodes. The tree structure can be used to represent hierarchical structures, such as organizational structures, file systems, HTML documents, etc. In algorithms, the tree structure is also used to implement functions such as searching, sorting, and storing. Common tree structures include binary trees, balanced trees, B-trees, etc. Due to the high efficiency and ease of understanding of the tree structure, it is widely used in software development.

[0071] In the first change command, there are an original command prompt and a set command prompt. The original command prompt is the first command prompt, and the set command prompt is the second command prompt. Before the command change, the command tree is composed of the original command prompt. After the command change, according to the first change command, after changing the original command prompt to the set command prompt, the composition of the command tree is synchronously updated from the original command prompt to the set command prompt.

[0072] The specific update method is: according to the first change command, find the position of the first command prompt corresponding to the first change command in the command tree, delete the first command prompt at this position, and add the second command prompt at this position to obtain the valid command set.

[0073] In the embodiments of the present application, by storing the valid command set in the form of a command tree, it is more convenient to find the first command prompt for the first change command, and the form of the command tree is easy to understand and more intuitive to store in the form of a command tree; through the command tree, the part corresponding to the first command prompt is deleted instead of deleting all of the first command prompt, avoiding adding duplicate parts after deleting all of the first command prompt, saving the time for updating the valid command set.

[0074] In the customized configuration file, at least one first change command is stored. Therefore, by adopting the embodiments of the present application, the commands of the controlled device can be changed in batches.

[0075] In some embodiments, based on Figure 1The system architecture diagram of the present application provides a method for changing a command prompt, such as Figure 3 As shown, the following steps are included:

[0076] Step 301: The controlled device receives a second change command sent by the control device through a command line interface; wherein the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt;

[0077] Specifically, the command line interface can display change commands. In the command line interface, the command line interface can be operated through an external device. When a change command is entered in the command line interface, the command line interface will display the entered change command and replace the original command prompt with the set command prompt to control the controlled device according to the requirements of the change command.

[0078] The second change command is a separate change command, which does not exist in any configuration file, and is only a change command sent from the control device to the controlled device through the command line interface in the form of a command. The second change command also includes the original command prompt and the set command prompt.

[0079] When it is necessary to directly control the controlled device through a change command, the controlled device can directly receive the second change command through the command line interface, and replace the original command prompt in the controlled device with the set command prompt.

[0080] For example, when you need to change the "show running-config" of the controlled device to "displaycurrent-config", you can directly enter in the command line interface

[0081]

[0082] Step 302: The controlled device parses the second change command, and updates the valid command set in the controlled device according to the second change command; the valid command set is used for the control device to control the controlled device.

[0083] Specifically, after receiving the second change command of the command line interface, the controlled device parses the second change command and adds the second change command to the valid command set of the controlled device. Then, the controlled device can be controlled by the set command prompt in the second change command.

[0084] For example, the switch receives the second change command sent by the computer through the command line interface, and parses the second change command to obtain:

[0085]

[0086] The switch updates the effective command set according to the second change command and changes the "show running-config" command to "display current-config".

[0087] Step 303: The controlled device feeds back change success information through the command line interface.

[0088] Specifically, after the controlled device receives the second change command and successfully parses it, the controlled device feeds back information that the command change was successful to the control device through the command line interface. After the control device receives the information that the change command was successfully fed back sent by the controlled device, the control device can use the second command to control the controlled device.

[0089] For example, after receiving and successfully parsing the second change command, the switch can display a notification of successful command change through the command line interface, such as: "show running-config" has been changed to "display current-config". The switch feeds back the message of successful command change to the computer. Only after the computer receives the message of successful command change can it use the "display current-config" command to control the switch.

[0090] In an embodiment of the present application, the controlled device can modify the change command of the controlled device separately by directly receiving the second change command, thereby avoiding the problem of adding a change command and then re-modifying the customized configuration file after the customized configuration file is completed; by updating the valid command set, the second change command can be saved in the valid command set; by having the controlled device feedback the change success information, the control device uses the set change command to control the controlled device, thereby realizing message communication between the controlled device and the control device.

[0091] In some embodiments, after the controlled device feeds back the change success information through the command line interface, the method further includes:

[0092] The controlled device generates a customized configuration file including a second change command based on the save instruction sent by the control device; the customized configuration file is used for the controlled device to load and parse into a valid command set after restarting.

[0093] Specifically, after the controlled device successfully parses the second change command and feeds back the successful parsing of the second change command to the control device, the control device sends a save instruction to the controlled device, and the save instruction is used for the controlled device to save the second change command locally and generate a customized configuration file according to the second change command. After the controlled device is restarted, the customized configuration file can be directly loaded and parsed, and the controlled device can be controlled according to the set command prompt in the second change command saved in the customized configuration file. The control device does not need to input the second change command again through the command line interface to control the controlled device, which improves the efficiency of the interaction between the controlled device and the control device.

[0094] For example, after receiving the information that the command change is successful, the computer sends a save instruction to the interactive machine, saves the change command locally on the interactive machine, and generates a customized configuration file based on the second change command. After the switch is restarted, the computer does not need to send the second change command to the switch again. The switch can parse the second change command saved in the customized configuration file, and the computer can directly operate the switch by setting the command prompt.

[0095] In an embodiment of the present application, the controlled device stores the change command through the save instruction sent by the control device, thereby avoiding the need to re-enter the change instruction when the command of the controlled device is changed again; the second change command is generated into a customized configuration file. When the controlled device is restarted, there is no need to change the command again through the command line interface, and the customized configuration file can be directly loaded and parsed to complete the command change.

[0096] The control device sends a second change command to the controlled device through a command line interface to change the command of the controlled device. Therefore, by adopting the embodiment of the present application, the command of the controlled device can be changed one by one.

[0097] In some embodiments, based on Figure 1 The system architecture diagram can change the command of the controlled device by combining the first change command with the second change command, including:

[0098] The controlled device loads a customized configuration file after startup; the customized configuration file records at least one first change command of a command prompt; wherein the change command is used to instruct to replace the original command prompt in the controlled device with the set command prompt.

[0099] The controlled device parses at least one first change command in the customized configuration file, and updates a valid command set in the controlled device according to the at least one first change command; the valid command set is used for the control device to control the controlled device.

[0100] The controlled device receives a second change command sent by the control device through a command line interface. The controlled device parses the second change command and updates the valid command set in the controlled device according to the second change command; the controlled device feeds back change success information through the command line interface. After the controlled device feeds back change success information through the command line interface, the method further includes: the controlled device generates a customized configuration file containing the second change command based on the save instruction sent by the control device.

[0101] Specifically, the controlled device first receives the customized configuration file sent by the control device, and after the controlled device is started, the customized configuration file is loaded, and the customized configuration file records at least one set of first change commands of the command prompt. After receiving the first change command, the controlled device parses the first change command in the customized configuration file, obtains the set command prompt, and adds the first change command to the valid command set. The controlled device feeds back the information of successful parsing to the control device, and when the control device controls the controlled device, it can use the set command prompt to control it.

[0102] If you want to add a new setting command prompt, the control device can directly send a second change command to the controlled device through the command line interface. The second change command does not exist in the custom configuration file, and the second change command also contains the original command prompt and the setting command prompt. By sending the second change command, the control device can replace the original command prompt in the controlled device with the setting command prompt. After the controlled device successfully parses the second change command, the second change command can be saved to the controlled device, and the second change command can be generated into a custom configuration file. After the controlled device is restarted, the custom configuration file can be directly loaded and parsed, and the controlled device can be controlled according to the setting command prompt in the second change command saved in the custom configuration file.

[0103] In order to better explain the embodiment of the present application, the following describes a flowchart of a method for changing a command prompt provided by the embodiment of the present application in combination with a specific implementation scenario. The flow of the method can be as follows: Figure 1 The control device 101 and the controlled device 102 shown in the figure are interactively executed, wherein the control device can be a computer and the controlled device can be a switch, including the following steps: Figure 4 As shown:

[0104] Step 401: According to the command of the switch, the computer customizes the configuration file;

[0105] Step 402: The computer sends the customized configuration file to the switch, wherein the customized configuration file at least includes a first change command of a set of command prompts, wherein the set of command prompts includes an original command prompt and a set command prompt;

[0106] Step 403: After receiving the customized configuration file sent by the computer, the switch parses and loads the customized configuration file to obtain a first change command;

[0107] Step 404: The switch searches the command tree for the position of the original command prompt in the command tree according to the first change command, deletes the original command prompt, and then adds a set command prompt at the position of the command tree where the original command prompt is located.

[0108] Step 405: The switch updates the command tree, where the command tree is a storage form of a valid command set;

[0109] Step 406: The switch feeds back information that the command tree has been successfully parsed, loaded and updated to the computer;

[0110] Step 407, the computer uses the set command prompt to control the switch;

[0111] Step 408: The computer sends a second change command through a command line interface;

[0112] Step 409: The switch parses the second change command and replaces the original command prompt with the set command prompt;

[0113] Step 410: The switch sends a message indicating that the second change command has been parsed successfully to the computer;

[0114] Step 411: After the computer confirms that the second change command is parsed successfully, it sends a save instruction to the switch;

[0115] Step 412: The switch saves the second change command and generates a customized configuration file for the second change command.

[0116] In the embodiment of the present application, commands can be pre-set according to the controlled device through a customized configuration file, and more than one set of command prompts are stored in the configuration file, so that batch changes of commands can be realized, making command changes more convenient and efficient; the controlled device implements command changes by parsing the customized configuration file, and updates the effective command set with the successfully parsed change command, so that the effective command set can store the latest and effective change command. Through the customized configuration file of the controlled device, when the controlled device needs to be controlled, the parsed configuration file can be directly loaded to complete the command change. When the command is different, there is no need to learn new commands or replace the device, which saves a lot of time for developers to develop controlled devices and improves the development efficiency.

[0117] Based on the same technical concept, the embodiment of the present application provides a device for changing a command prompt, such as Figure 5 As shown, the device 500 includes:

[0118] A loading module 501 is used for the controlled device to load a customized configuration file after startup; the customized configuration file records at least one first change command of a command prompt; wherein the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt;

[0119] The parsing module 502 is used for the controlled device to parse at least one first change command in the customized configuration file and update the valid command set in the controlled device according to the at least one first change command; the valid command set is used for the control device to control the controlled device.

[0120] Optionally, the parsing module 502 is specifically used for:

[0121] The portion corresponding to the first command prompt is deleted from the command tree, and the portion corresponding to the second command prompt is added to obtain a valid command set in the controlled device.

[0122] Optionally, the parsing module 502 is further used for:

[0123] The controlled device receives a second change command sent by the control device through a command line interface;

[0124] The controlled device parses the second change command, and updates a valid command set in the controlled device according to the second change command;

[0125] The controlled device feeds back change success information through the command line interface.

[0126] Optionally, the parsing module 502 is further used for:

[0127] The controlled device generates a customized configuration file including the second change command based on the save instruction sent by the control device.

[0128] Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal or a server, such as Figure 6 As shown, it includes at least one processor 601 and a memory 602 connected to the at least one processor. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 For example, the processor 601 and the memory 602 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.

[0129] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute the steps included in the above-mentioned command prompt change method by executing the instructions stored in the memory 602.

[0130] Among them, the processor 601 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and change the command prompt by running or executing instructions stored in the memory 602 and calling data stored in the memory 602. Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0131] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0132] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0133] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned command prompt change method.

[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxesFigure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0138] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for changing a command prompt, characterized in that, Including: After the controlled device is started, it loads a customized configuration file; At least one first change command of a set of command prompts is recorded in the customized configuration file; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt; The controlled device parses at least one first change command in the customized configuration file, and updates the valid command set in the controlled device according to the at least one first change command; the valid command set is used for the control device to control the controlled device.

2. The method according to claim 1, characterized in that, The valid command set is stored in the form of a command tree; the first change command is to replace the first command prompt with the second command prompt; Updating the valid command set in the controlled device according to the at least one first change command includes: Deleting the part corresponding to the first command prompt from the command tree, and adding the part corresponding to the second command prompt to obtain the valid command set in the controlled device.

3. The method according to claim 1, wherein Also including: The controlled device receives a second change command sent by the control device through the command line interface; The controlled device parses the second change command, and updates the valid command set in the controlled device according to the second change command; The controlled device feeds back a change success message through the command line interface.

4. The method according to claim 3, wherein After the controlled device feeds back a change success message through the command line interface, it also includes: The controlled device generates a customized configuration file containing the second change command based on the save instruction sent by the control device.

5. A method for changing a command prompt, characterized in that, Including: The controlled device receives a second change command sent by the control device through the command line interface; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt; The controlled device parses the second change command, and updates the valid command set in the controlled device according to the second change command; the valid command set is used for the control device to control the controlled device; The controlled device feeds back a change success message through the command line interface.

6. The method according to claim 5, wherein After the controlled device feeds back a change success message through the command line interface, it also includes: The controlled device generates a customized configuration file containing the second change command based on the save instruction sent by the control device; the customized configuration file is used for the controlled device to load and parse into a valid command set after restarting.

7. A method for changing a command prompt, characterized in that Including: The control device sends a second change command to the controlled device through the command line interface; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt; The control device receives the change success message fed back by the controlled device through the command line interface; the change success message is sent by the controlled device after updating the valid command set in the controlled device according to the second change command; the valid command set is used for the control device to control the controlled device.

8. The method according to claim 7, wherein After the valid command set is used for the control device to control the controlled device, it also includes: The control device sends a save instruction to the controlled device through the command line interface; the save instruction is used to instruct the controlled device to generate a customized configuration file containing the second change command; the customized configuration file is used for the controlled device to load and parse into a valid command set after restarting.

9. A command prompt change device, characterized in that, Comprising: A loading module, configured to load a customized configuration file by the controlled device after startup; At least one first change command of a command prompt is recorded in the customized configuration file; wherein, the change command is used to instruct to replace the original command prompt in the controlled device with a set command prompt; A parsing module, configured to parse at least one first change command in the customized configuration file by the controlled device, and update the valid command set in the controlled device according to the at least one first change command; the valid command set is used for the control device to control the controlled device.

10. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.