CN114020348A - Command processing method and device - Google Patents

Command processing method and device Download PDF

Info

Publication number
CN114020348A
CN114020348A CN202111183470.2A CN202111183470A CN114020348A CN 114020348 A CN114020348 A CN 114020348A CN 202111183470 A CN202111183470 A CN 202111183470A CN 114020348 A CN114020348 A CN 114020348A
Authority
CN
China
Prior art keywords
command
preset
input command
commands
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111183470.2A
Other languages
Chinese (zh)
Inventor
陈智振
肖立锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Thunder Software Technology Shenzhen Co ltd
Original Assignee
Thunder Software Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Thunder Software Technology Shenzhen Co ltd filed Critical Thunder Software Technology Shenzhen Co ltd
Priority to CN202111183470.2A priority Critical patent/CN114020348A/en
Publication of CN114020348A publication Critical patent/CN114020348A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Input From Keyboards Or The Like (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a command processing method and device, electronic equipment and a computer readable storage medium, and relates to the field of computers. The method is applied to the ubuntu system and comprises the following steps: receiving a first execution instruction for an input command; detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time; if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command. Therefore, by presetting the multi-input command in the ubuntu system, the ubuntu system can input at least two preset commands corresponding to the multi-input command at one time when receiving the input command of the user and judging that the input command is the multi-input command, so that a plurality of commands can be input by inputting the command once without a script, and the processing efficiency of the commands in the ubuntu system is greatly improved.

Description

Command processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a command.
Background
ubuntu is an open source GNU/Linux operating system based on Debian GNU/Linux, supporting x86, amd64 and ppc architectures, and created by a globalized professional development team.
ubuntu facilitates command operations, but sometimes a user needs to repeatedly execute some commands, which can be achieved in two ways:
1. repeatedly executing a command through the direction key;
2. multiple commands are executed at once by the script.
However, the above method has the following disadvantages:
1. the direction key can only execute the previous command in one step, and when a plurality of commands need to be executed repeatedly, a large operation amount is needed;
2. although multiple instructions can be executed at one time using a script, the script cannot be modified as desired. Moreover, scripts need to be additionally built and stored, are not easy to find or require additional plug-ins. Therefore, the use is cumbersome and the processing efficiency of the command is low.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed to provide a method for processing a command and a corresponding device for processing a command, which overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a method for processing a command, where the method is applied to an ubuntu system, and includes:
receiving a first execution instruction for an input command;
detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time;
if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command.
In one or more embodiments, before the receiving the execution instruction for the input command, further comprising:
inputting the multi-input command and at least two preset commands to be associated;
generating an incidence relation between the multi-input command and the at least two preset commands;
and storing the multi-input command, the at least two preset commands and the incidence relation into a preset command library.
In one or more embodiments, the detecting whether the input command is a preset multiple-input command includes:
matching the input command with a preset command library;
if the matching item exists, judging that the detection is successful;
if no matching item exists, the detection is judged to be failed.
In one or more embodiments, the determining the at least two preset commands includes:
acquiring an incidence relation corresponding to the multi-input command;
and determining at least two preset commands associated with the multi-input command based on the association relation.
In one or more embodiments, further comprising:
receiving a second execution instruction for the update command; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated;
determining at least two preset commands associated with any multi-input command in the command library;
and updating at least two preset commands related to any multi-input command by adopting the target command based on the second execution instruction to obtain an updated target multi-input command.
In one or more embodiments, further comprising:
receiving a query instruction aiming at any multi-input command in a preset command library;
determining at least two preset commands associated with any one multi-input command;
and displaying the determined at least two preset commands based on the query instruction.
In one or more embodiments, when the input command includes identification information for marking a preset command, the determining, based on the association relationship, at least two preset commands associated with the multiple-input command includes:
and determining a target preset command from the at least two preset commands based on the identification information.
Correspondingly, the embodiment of the invention discloses a command processing device, which comprises:
the first receiving module is used for receiving a first execution instruction aiming at an input command;
the detection module is used for detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time;
the first processing module is used for determining the at least two preset commands and inputting the at least two preset commands based on the first execution instruction; or, discarding the input command.
In one or more embodiments, further comprising:
the input module is used for inputting the multi-input command and at least two preset commands to be associated before the execution instruction for the input command is received;
the generating module is used for generating the incidence relation between the multi-input command and the at least two preset commands;
and the storage module is used for storing the multi-input command, the at least two preset commands and the association relation into a preset command library.
In one or more embodiments, the detection module comprises:
the matching sub-module is used for matching the input command with a preset command library;
the judging submodule is used for judging that the detection is successful if the matching item exists; or if no matching item exists, judging that the detection fails.
In one or more embodiments, the first processing includes:
the obtaining submodule is used for obtaining the incidence relation corresponding to the multi-input command;
and the determining submodule is used for determining at least two preset commands related to the multi-input command based on the association relation.
In one or more embodiments, further comprising:
a second receiving module, configured to receive a second execution instruction for the update command; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated;
the first determining module is used for determining at least two preset commands related to any multi-input command in the command library;
and the second processing module is used for updating at least two preset commands related to any multi-input command by adopting the target command based on the second execution instruction to obtain an updated target multi-input command.
In one or more embodiments, further comprising:
the third receiving module is used for receiving a query instruction aiming at any one multi-input command in a preset command library;
the second determining module is used for determining at least two preset commands related to any one multi-input command;
and the display module is used for displaying the determined at least two preset commands based on the query instruction.
In one or more embodiments, when the input command includes identification information for marking a preset command, the determining sub-module is specifically configured to:
determining a target preset command from the at least two preset commands based on the identification information
Correspondingly, the embodiment of the invention discloses an electronic device, which comprises: a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the above-described method embodiments of command processing.
Accordingly, the embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the embodiment of the command processing method.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, when the ubuntu system receives a first execution instruction aiming at an input command, whether the input command is a preset multi-input command is detected; the multi-input command is used for inputting at least two preset commands at one time; if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command. Therefore, by presetting the multi-input command in the ubuntu system, the ubuntu system can input at least two preset commands corresponding to the multi-input command at one time when receiving the input command of the user and judging that the input command is the multi-input command, so that a plurality of commands can be input by inputting the command once without a script, and the processing efficiency of the commands in the ubuntu system is greatly improved.
Drawings
FIG. 1 is a flowchart of steps of a first embodiment of a method for processing commands according to the present invention;
FIG. 2 is a flowchart of the steps of a second embodiment of a command processing method according to the present invention;
FIG. 3 is a flow chart of the update procedure of any of the multiple input commands of the present invention;
FIG. 4 is a flow chart of the query steps of any of the multiple input commands of the present invention;
FIG. 5 is a block diagram of an embodiment of a command processing apparatus according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
One of the core concepts of the embodiments of the present invention is that a multiple input command is preset in an ubuntu system, and when the ubuntu system receives a first execution instruction for an input command, it is detected whether the input command is a preset multiple input command; the multi-input command is used for inputting at least two preset commands at one time; if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command. Therefore, by presetting the multi-input command in the ubuntu system, the ubuntu system can input at least two preset commands corresponding to the multi-input command at one time when receiving the input command of the user and judging that the input command is the multi-input command, so that a plurality of commands can be input by inputting the command once without a script, and the processing efficiency of the commands in the ubuntu system is greatly improved.
Referring to fig. 1, a flowchart of the steps of a first embodiment of a command processing method of the present invention is shown, which is applied to an ubuntu system, wherein the ubuntu is an open-source GNU/Linux operating system based on Debian GNU/Linux, supporting x86, amd64 and ppc architectures, and created by a globalized professional development team. The method specifically comprises the following steps:
step 101, receiving a first execution instruction aiming at an input command;
in practical applications, when a user executes a command operation in the ubuntu system, the user usually inputs the command and then initiates an execution instruction to execute the operation corresponding to the command. For example, the user inputs the command a, and then initiates an execution instruction by "enter", so that the system executes the operation corresponding to the command a. In the embodiment of the present invention, the input command may be a command input by a user, such as command a, and the first execution instruction may be an instruction initiated by the user to execute the input command, such as "enter".
Of course, in practical applications, besides that the first execution instruction may be "enter", other types of instructions for initiating execution of the input command are also applicable to the embodiment of the present invention, and the embodiment of the present invention is not limited to this.
102, detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time;
after receiving the first execution instruction, the ubuntu system may detect whether the input command is a preset multiple-input command, where the multiple-input command is used to input at least two preset commands at a time without using a script. For example, if the preset commands corresponding to a certain multi-input command are a, b, and c, the commands a, b, and c can be input at one time through the multi-input command.
In an embodiment of the present invention, the detecting whether the input command is a preset multiple-input command includes:
matching the input command with a preset command library;
if the matching item exists, judging that the detection is successful;
if no matching item exists, the detection is judged to be failed.
Specifically, in the embodiment of the present invention, a command library may be preset in the ubuntu system, and multiple preset multiple input commands may be stored in the command library, so that after receiving the first execution instruction, the input command is matched with all preset multiple input commands in the command library, and if there is a matching item, it may be determined that the detection is successful, that is, the input command is a multiple input command; if there is no match, it may be determined that the detection failed, i.e., the input command is not a multiple input command.
Step 103, if yes, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction;
when it is determined that there are matching items between the input command and all the preset multiple input commands in the command library, at least two preset commands associated with the matched multiple input commands can be further determined, and since the first execution instruction has been received, the at least two preset commands can be directly input.
In this embodiment of the present invention, the determining the at least two preset commands includes:
acquiring an incidence relation corresponding to the multi-input command;
and determining at least two preset commands associated with the multi-input command based on the association relation.
Specifically, in the embodiment of the present invention, the association relationship between multiple input commands and the preset commands may also be stored in the command library, for example, the preset commands corresponding to a certain multiple input command are a, b, and c, and then the association relationship between the multiple input command and the preset commands a, b, and c is also stored in the command library, so that after the detection is determined to be successful, at least two preset commands corresponding to the input command may be determined based on the input command and the association relationship.
It should be noted that, in the embodiment of the present invention, in addition to associating at least two preset commands, any multi-input command in the command library may also be associated with one preset command, which is only the same as that of directly inputting the preset command.
In this embodiment of the present invention, when the input command includes identification information for marking a preset command, the determining, based on the association relationship, at least two preset commands associated with the multiple-input command includes:
and determining a target preset command from the at least two preset commands based on the identification information.
Specifically, the input command may include identification information for marking each preset command in any multi-input command. For example, the preset commands corresponding to a certain multi-input command are a, b, and c, where the identification information of a may be marked as Head {0}, the identification information of b may be marked as Head {1}, the identification information of c may be marked as Head {2}, and if the input command does not include the identification information, a, b, and c are used as target preset commands; if the input command includes at least one identification information, the preset command corresponding to each identification information is used as a target preset command, for example, if the input command includes "Head {1} - {2 }", then b and c are used as target preset commands.
And 104, if not, discarding the input command.
Specifically, when it is determined that the input command is not a multiple-input command, the input command may be discarded. Of course, other processing may be performed besides discarding, for example, whether the command is another type of command is further detected, and in an actual application, the setting may be performed according to an actual requirement, which is not limited in this embodiment of the present invention.
For convenience of understanding, the embodiments of the present invention are illustrated by using specific examples.
It is assumed that the preset command library includes a multi-input command and instructions log and repeat, where the log is used to query at least two preset commands, the repeat is used to implement at least two preset commands to be executed, and the at least two preset commands are a, b, and c.
When a user inputs "$ ubuntu log" in the ubuntu system and executes it (at least two preset commands corresponding to the query multiple input command), what is presented to the user may be:
Head{0}:c
Head{1}:b
Head{2}:a。
when the user inputs "$ ubuntu logreat" in the ubuntu system and executes it (inputs at least two preset commands), what is presented to the user may be:
$a
$b
$c。
when the user inputs "$ ubuntu logepeat Head {1} - {2 }" in the ubuntu system and executes it (inputs Head {1} - {2} of at least two preset commands), what is shown to the user may be:
$a
$b。
it should be noted that the names, forms, and the like of the multi-input commands are merely examples, and in practical applications, multi-input commands with other names, forms, and the like are also applicable to the embodiment of the present invention, and the embodiment of the present invention is not limited to this.
In the embodiment of the invention, when the ubuntu system receives a first execution instruction aiming at an input command, whether the input command is a preset multi-input command is detected; the multi-input command is used for inputting at least two preset commands at one time; if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command. Therefore, by presetting the multi-input command in the ubuntu system, the ubuntu system can input at least two preset commands corresponding to the multi-input command at one time when receiving the input command of the user and judging that the input command is the multi-input command, so that a plurality of commands can be input by inputting the command once without a script, and the processing efficiency of the commands in the ubuntu system is greatly improved.
Furthermore, the target preset command to be executed can be determined from the at least two preset commands through the identification information, so that personalized command processing can be realized according to the requirements of users on the basis of greatly improving the command processing efficiency in the ubuntu system.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of a command processing method according to the present invention is shown, where the method is applied to an ubuntu system, and specifically may include the following steps:
step 201, inputting the multiple input command and at least two preset commands to be associated;
in order to implement the multiple input command in the ubuntu system, the user may set the multiple input command in the ubuntu system in advance. Specifically, the user may input at least two preset commands to be related to the multi-input command in the ubuntu system, for example, the user may input "log" and "a, b, c" in the ubuntu system.
Step 202, generating an incidence relation between the multi-input command and the at least two preset commands;
after receiving an instruction for establishing an association relationship initiated by a user, the ubuntu system can establish the association relationship between the multiple input commands and at least two preset commands. For example, an association relationship between "log" and "a, b, c" is established. Of course, in practical application, the form of the instruction for establishing the association relationship may be set according to actual requirements, for example, the association relationship may be established in the form of a code, the association relationship may be established in the form of a graphical interface, or the association relationship may be established in other forms, which is not limited in this embodiment of the present invention.
Step 203, storing the multiple input commands, the at least two preset commands and the association relation into a preset command library;
after the association relationship between the multi-input command and the at least two preset commands is established, the multi-input command, the associated at least two preset commands and the association relationship between the multi-input command and the associated at least two preset commands can be stored in a preset command library. For example, as mentioned above, the "log", "a, b, c" and the association relationship between the "log" and the "a, b, c" may be stored together in a preset command library.
Step 204, receiving a first execution instruction aiming at an input command;
step 205, detecting whether the input command is a preset multi-input command; the multi-input command is used for inputting at least two preset commands at one time;
step 206, if yes, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction;
step 207, if not, discarding the input command.
Specifically, steps 204 to 207 are substantially the same as steps 101 to 104, and for avoiding repetition, they are not described herein, and refer to steps 101 to 104.
In the embodiment of the present invention, a user may input the multiple input command and at least two preset commands to be associated in the ubuntu system in advance, then initiate an instruction for establishing an association relationship, generate an association relationship between the multiple input command and the at least two preset commands, and then store the multiple input command, the at least two preset commands, and the association relationship in a preset command library. The multi-input command is created in the ubuntu system in the mode, and guarantee is provided for inputting multiple commands by inputting one command under the condition that scripts are not needed.
When the ubuntu system receives a first execution instruction aiming at an input command, detecting whether the input command is a preset multi-input command; the multi-input command is used for inputting at least two preset commands at one time; if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command. Therefore, by presetting the multi-input command in the ubuntu system, the ubuntu system can input at least two preset commands corresponding to the multi-input command at one time when receiving the input command of the user and judging that the input command is the multi-input command, so that a plurality of commands can be input by inputting the command once without a script, and the processing efficiency of the commands in the ubuntu system is greatly improved.
Furthermore, the target preset command to be executed can be determined from the at least two preset commands through the identification information, so that personalized command processing can be realized according to the requirements of users on the basis of greatly improving the command processing efficiency in the ubuntu system.
Referring to fig. 3, a flowchart of an updating step of any multi-input command in the present invention is shown, where the updating step may be applied after steps 101 to 104, or after steps 201 to 207, and may be adjusted according to actual requirements in actual applications, which is not limited in this embodiment of the present invention, and the updating step may specifically include the following steps:
step 301, receiving a second execution instruction for the update command; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated;
specifically, a user may input an update command in the ubuntu system, where the update command is used to update at least two preset commands associated with any multi-input command in a preset command library, and the update command includes a target command to be updated. That is to say, the update command may update at least two preset commands associated with any one of the multiple input commands with the target command, and the update may be addition, replacement, or the like. For example, the preset commands corresponding to a certain multi-input command are a, b, and c, and the update command includes a target command d, so that the update command is used to update a, b, and c by using d, and d may be added or replaced by any one of a, b, and c. Therefore, the user can update any multi-input command in the command library at any time, so that the current requirement is met.
Further, the second execution instruction may be a user-initiated instruction to execute an update command, such as "enter". Of course, in practical applications, besides that the second execution instruction may be "enter", other types of instructions for initiating execution of the update command are also applicable to the embodiment of the present invention, and the embodiment of the present invention is not limited to this.
Step 302, determining at least two preset commands associated with any multi-input command in the command library;
after receiving the second execution instruction, the ubuntu system may determine at least two preset commands associated with any one of the multiple input commands to be updated according to the association relationship.
Step 303, based on the second execution instruction, updating at least two preset commands associated with any one of the multiple input commands by using the target command, so as to obtain an updated target multiple input command.
Since the second execution instruction has been received, the target command may be used to update the at least two preset commands to obtain an updated target multiple-input command, where the updating may be to establish an association relationship between the target command and the any multiple-input command, or to replace any one of the at least two preset commands with the target command (in a case where the target command is one), or to delete at least one of the at least two preset commands. Of course, if there are multiple target commands, each target command may be updated separately.
For convenience of understanding, the embodiments of the present invention are illustrated by using specific examples.
Supposing that the preset command library comprises a multi-input command, and instructions log and add, wherein the log is used for inquiring at least two preset commands, the add is used for adding new preset commands, and the at least two preset commands are a, b and c.
When a user inputs "$ ubuntu log" in the ubuntu system and executes it (at least two preset commands corresponding to the query multiple input command), what is presented to the user may be:
Head{0}:c
Head{1}:b
Head{2}:a。
when the user enters "$ ubuntu logad {1} d" in the ubuntu system and executes "$ ubuntu log" again (add d new to the Head {1} position in at least two preset commands), what is shown to the user may be:
Head{0}:c
Head{1}:d
Head{2}:b
Head{3}:a。
when the user inputs "$ ubuntu logreat" in the ubuntu system and executes it (inputs at least two preset commands), what is presented to the user may be:
$a
$b
$d
$c。
when the user inputs "$ ubuntu logdlhead {2 }" in the ubuntu system and executes "$ ubuntu log" again (delete the command at the Head {1} position of at least two preset commands), what is exposed to the user may be:
Head{0}:c
Head{1}:d
Head{2}:a。
when the user inputs "$ ubuntu logreat" in the ubuntu system and executes it (inputs at least two preset commands), what is presented to the user may be:
$a
$d
$c。
it should be noted that, when replacing any one of the at least two preset commands with the target command, the preset command may be deleted first, and then the target command may be added, which may be specifically referred to the above example, and is not described herein again.
In the embodiment of the present invention, after receiving the second execution instruction for the update command, the ubuntu system may determine at least two preset commands associated with any of the multiple input commands in the command library; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated; and then, updating at least two preset commands associated with any one multi-input command by adopting the target command based on the second execution instruction to obtain an updated target multi-input command. Therefore, a user can update any multi-input command in the command library at any time to obtain the multi-input command with the current requirement, so that the current requirement is met, and the processing efficiency of the command in the ubuntu system is further improved.
Referring to fig. 4, a flowchart of an inquiry step of any multi-input command in the present invention is shown, where the inquiry step may be applied after steps 101 to 104, or after steps 201 to 207, or after steps 301 to 303, and may be adjusted according to actual requirements in practical application, where the present invention is not limited to this, and the inquiry step may specifically include the following steps:
step 401, receiving a query instruction for any multi-input command in a preset command library;
specifically, a user may input a query command in the ubuntu system, where the query command is used to query at least two preset commands associated with any multi-input command in a preset command library. When a multi-input command is included in the command library, the query can be directly performed by using "log", for example, "$ ubuntu log"; when the command library includes at least two input commands, each multiple input command may be tagged, and the query may be tagged, for example, "$ ubuntu log tag". Of course, the method may be implemented by other methods, and in practical application, the method may be set according to actual needs, which is not limited in the embodiment of the present invention.
Step 402, determining at least two preset commands associated with any one multi-input command;
after receiving the query instruction, the ubuntu system may determine at least two preset commands associated with any one of the multiple input commands to be queried according to the association relationship.
And 403, displaying the determined at least two preset commands based on the query instruction.
Since the query instruction has been received, the determined at least two preset commands may be displayed.
Further, in the embodiment of the present invention, there may be a plurality of query commands, and in addition to "log" for querying at least two preset commands corresponding to the multi-input command, a "reflow" for querying all executed commands may be included.
For convenience of understanding, the embodiments of the present invention are illustrated by using specific examples.
Suppose that the preset command library includes a multi-input command and an instruction log, where the log is used to query at least two preset commands, and the at least two preset commands are a, b, and c.
When a user inputs "$ ubuntu log" in the ubuntu system and executes it (at least two preset commands corresponding to the query multiple input command), what is presented to the user may be:
Head{0}:c
Head{1}:b
Head{2}:a。
when a user inputs "$ a", "$ b", "$ c", "$ ubuntu log" in the ubuntu system and executes it, and then "$ ubuntu reflow" is input and executed (all executed commands are queried), what is shown to the user may be:
Head{0}:$ubuntu log
Head{1}:c
Head{2}:b
Head{3}:a。
in the embodiment of the present invention, when receiving a query instruction for any one of multiple input commands in a preset command library, the ubuntu system may determine at least two preset commands associated with the any one of multiple input commands, and then display the at least two determined preset commands based on the query instruction. Therefore, the user can check at least two specific preset commands associated with the multi-input command at any time, and efficient management of the multi-input command is achieved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a structure of an embodiment of a command processing apparatus according to the present invention is shown, which may specifically include the following modules:
a first receiving module 501, configured to receive a first execution instruction for an input command;
a detecting module 502, configured to detect whether the input command is a preset multiple-input command; the multi-input command is used for inputting at least two preset commands at one time;
the first processing module 503 is configured to determine the at least two preset commands, and input the at least two preset commands based on the first execution instruction; or, discarding the input command.
In the embodiment of the present invention, the method further includes:
the input module is used for inputting the multi-input command and at least two preset commands to be associated before the execution instruction for the input command is received;
the generating module is used for generating the incidence relation between the multi-input command and the at least two preset commands;
and the storage module is used for storing the multi-input command, the at least two preset commands and the association relation into a preset command library.
In an embodiment of the present invention, the detection module includes:
the matching sub-module is used for matching the input command with a preset command library;
the judging submodule is used for judging that the detection is successful if the matching item exists; or if no matching item exists, judging that the detection fails.
In an embodiment of the present invention, the first processing includes:
the obtaining submodule is used for obtaining the incidence relation corresponding to the multi-input command;
and the determining submodule is used for determining at least two preset commands related to the multi-input command based on the association relation.
In the embodiment of the present invention, the method further includes:
a second receiving module, configured to receive a second execution instruction for the update command; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated;
the first determining module is used for determining at least two preset commands related to any multi-input command in the command library;
and the second processing module is used for updating at least two preset commands related to any multi-input command by adopting the target command based on the second execution instruction to obtain an updated target multi-input command.
In the embodiment of the present invention, the method further includes:
the third receiving module is used for receiving a query instruction aiming at any one multi-input command in a preset command library;
the second determining module is used for determining at least two preset commands related to any one multi-input command;
and the display module is used for displaying the determined at least two preset commands based on the query instruction.
In this embodiment of the present invention, when the input command includes identification information for marking a preset command, the determining submodule is specifically configured to:
and determining a target preset command from the at least two preset commands based on the identification information.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, including:
the method comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, each process of the embodiment of the command processing method is realized, the same technical effect can be achieved, and the details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the embodiment of the command processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is provided for a command processing method and a command processing apparatus, and the principle and the implementation of the present invention are explained by applying specific examples, and the above descriptions of the embodiments are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A command processing method is applied to an ubuntu system and comprises the following steps:
receiving a first execution instruction for an input command;
detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time;
if so, determining the at least two preset commands, and inputting the at least two preset commands based on the first execution instruction; if not, discarding the input command.
2. The method of claim 1, wherein before the receiving the execution instruction for the input command, the method further comprises:
inputting the multi-input command and at least two preset commands to be associated;
generating an incidence relation between the multi-input command and the at least two preset commands;
and storing the multi-input command, the at least two preset commands and the incidence relation into a preset command library.
3. The command processing method according to claim 1 or 2, wherein the detecting whether the input command is a preset multiple-input command comprises:
matching the input command with a preset command library;
if the matching item exists, judging that the detection is successful;
if no matching item exists, the detection is judged to be failed.
4. The method for processing the command according to claim 1 or 2, wherein the determining the at least two preset commands comprises:
acquiring an incidence relation corresponding to the multi-input command;
and determining at least two preset commands associated with the multi-input command based on the association relation.
5. The command processing method according to claim 1 or 2, further comprising:
receiving a second execution instruction for the update command; the updating command is used for updating at least two preset commands associated with any multi-input command in a preset command library, and the updating command comprises a target command to be updated;
determining at least two preset commands associated with any multi-input command in the command library;
and updating at least two preset commands related to any multi-input command by adopting the target command based on the second execution instruction to obtain an updated target multi-input command.
6. The command processing method according to claim 1 or 2, further comprising:
receiving a query instruction aiming at any multi-input command in a preset command library;
determining at least two preset commands associated with any one multi-input command;
and displaying the determined at least two preset commands based on the query instruction.
7. The command processing method according to claim 4, wherein when the input command includes identification information for marking a preset command, the determining at least two preset commands associated with the multiple-input command based on the association relationship includes:
and determining a target preset command from the at least two preset commands based on the identification information.
8. An apparatus for processing a command, the apparatus comprising:
the first receiving module is used for receiving a first execution instruction aiming at an input command;
the detection module is used for detecting whether the input command is a preset multi-input command or not; the multi-input command is used for inputting at least two preset commands at one time;
the first processing module is used for determining the at least two preset commands and inputting the at least two preset commands based on the first execution instruction; or, discarding the input command.
9. An electronic device, comprising: processor, memory and computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the method of processing a command according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of a method for processing commands according to any one of claims 1 to 7.
CN202111183470.2A 2021-10-11 2021-10-11 Command processing method and device Pending CN114020348A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111183470.2A CN114020348A (en) 2021-10-11 2021-10-11 Command processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111183470.2A CN114020348A (en) 2021-10-11 2021-10-11 Command processing method and device

Publications (1)

Publication Number Publication Date
CN114020348A true CN114020348A (en) 2022-02-08

Family

ID=80055616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111183470.2A Pending CN114020348A (en) 2021-10-11 2021-10-11 Command processing method and device

Country Status (1)

Country Link
CN (1) CN114020348A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589616A (en) * 2014-10-21 2016-05-18 中兴通讯股份有限公司 Method and apparatus for combining multiple application operations on terminal and terminal
CN107506103A (en) * 2017-06-29 2017-12-22 努比亚技术有限公司 A kind of terminal control method, terminal and computer-readable recording medium
CN110309214A (en) * 2018-04-10 2019-10-08 腾讯科技(深圳)有限公司 A kind of instruction executing method and its equipment, storage medium, server
CN111522510A (en) * 2020-04-22 2020-08-11 杭州宏杉科技股份有限公司 Command processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589616A (en) * 2014-10-21 2016-05-18 中兴通讯股份有限公司 Method and apparatus for combining multiple application operations on terminal and terminal
CN107506103A (en) * 2017-06-29 2017-12-22 努比亚技术有限公司 A kind of terminal control method, terminal and computer-readable recording medium
CN110309214A (en) * 2018-04-10 2019-10-08 腾讯科技(深圳)有限公司 A kind of instruction executing method and its equipment, storage medium, server
CN111522510A (en) * 2020-04-22 2020-08-11 杭州宏杉科技股份有限公司 Command processing method and device

Similar Documents

Publication Publication Date Title
EP3333704B1 (en) Method and apparatus for repairing kernel vulnerability
CN107545181B (en) Program operating method, terminal, and computer-readable storage medium
CN106815031B (en) Kernel module loading method and device
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
US10489591B2 (en) Detection system and method thereof
US9686303B2 (en) Web page vulnerability detection method and apparatus
CN107133165B (en) Browser compatibility detection method and device
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
US20140195794A1 (en) Electronic device with baseboard management controller updating system
CN111949607B (en) Method, system and device for monitoring UDT file
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
AU2019279950A1 (en) Web application adjustment for different browsers
US20220292056A1 (en) Method and apparatus for modifying file name, and storage medium
JP7314243B2 (en) How to Generate Malicious Behavior Feature Information for Malware
CN111309369B (en) Code management method and device based on Git code warehouse
JP2019101582A (en) Software quality determination device, software quality determination method, and software quality determination program
CN105354490B (en) Method and equipment for processing hijacked browser
CN114020348A (en) Command processing method and device
CN116661936A (en) Page data processing method and device, computer equipment and storage medium
KR102021383B1 (en) Method and apparatus for analyzing program by associating dynamic analysis with static analysis
US10061686B2 (en) Method, electronic apparatus, system, and storage medium for automated testing of application user interface
CN116010347A (en) Resource updating method, device, system, electronic equipment and storage medium
US10798181B2 (en) Storage medium containing a program, information processing device, and processing method for deploying an application generated to a cloud environment
CN109635175B (en) Page data splicing method and device, readable storage medium and electronic equipment
CN112699372A (en) Vulnerability processing method and device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination