CN107783786B - Method and device for creating equipment resources - Google Patents

Method and device for creating equipment resources Download PDF

Info

Publication number
CN107783786B
CN107783786B CN201610736591.8A CN201610736591A CN107783786B CN 107783786 B CN107783786 B CN 107783786B CN 201610736591 A CN201610736591 A CN 201610736591A CN 107783786 B CN107783786 B CN 107783786B
Authority
CN
China
Prior art keywords
command
parameter
target command
resource
name
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610736591.8A
Other languages
Chinese (zh)
Other versions
CN107783786A (en
Inventor
宋科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Huawei Technology Co Ltd
Original Assignee
Huawei Digital Technologies Chengdu 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 Huawei Digital Technologies Chengdu Co Ltd filed Critical Huawei Digital Technologies Chengdu Co Ltd
Priority to CN202110671897.0A priority Critical patent/CN113467868B/en
Priority to CN201610736591.8A priority patent/CN107783786B/en
Publication of CN107783786A publication Critical patent/CN107783786A/en
Application granted granted Critical
Publication of CN107783786B publication Critical patent/CN107783786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/451Execution arrangements for user interfaces

Abstract

The invention discloses a method and a device for creating equipment resources, and belongs to the technical field of computing. The method comprises the following steps: a user can receive a help information acquisition instruction of a target command name by operating a trigger device, and then the device can search a resource identifier corresponding to a command parameter of a required device resource associated with the target command name according to a pre-stored corresponding relation between the command parameter of the required device resource and a resource identifier of a currently available device resource; if the command parameters of the required device resources associated with the target command name have target command parameters for which the corresponding resource identifiers are not found, the device can create the device resources required by the target command parameters and display the help information of the target command name and the resource identifiers of the newly created device resources. By adopting the invention, the efficiency of executing the command can be improved.

Description

Method and device for creating equipment resources
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for creating device resources.
Background
Currently, a user may perform service configuration on a storage device, such as storing data and creating a virtual machine, through a CLI (Command Line Interface) application installed in the storage device.
A user may input a command corresponding to a certain service configuration on a CLI interface to implement the service configuration on a storage device, where the command is composed of a command name, a command parameter (the command parameter may be a command parameter associated with the command name capable of implementing the service configuration), and a parameter value, for example, the service configuration is to store data in a folder identified as 0 included in the storage device, in this case, the command name of the technically input command may be storage data (where the command name may be an english name corresponding to the storage data), the command parameter is a folder identifier, and the parameter value is 0. When a user performs service configuration on a storage device through a command, it may be unclear the usage rule of a command name, at this time, the user may view help information of the command name through a command help function, and specifically, after the user inputs the command name on the CLI interface, the user may click "? After reading the text information, the user can input a command consisting of the command name, the command parameter and parameter values of the command parameter on the CLI interface, and click an enter key in the keyboard, at this time, the terminal receives an execution instruction, and further can determine a target command parameter (the target command parameter may be a folder identifier) of a device resource that needs to be used in the command, wherein the parameter value of the command parameter of the device resource needs to be a resource identifier of the device resource, and can determine whether the storage device contains the device resource corresponding to the parameter value of the target command parameter (the device resource may be a folder with a folder identifier of 0, and 0 may be a resource identifier of the device resource), if the device resource does not exist in the storage device, the terminal will report an error, at this time, the user can create the device resource by using the command for creating the device resource according to the error, after creating the device resource, the user can re-input the command corresponding to the service configuration according to the created device resource (wherein, when inputting the command at this time, the parameter value of the target command parameter can be set as the resource identifier of the device resource just created), and click the enter key in the keyboard, the storage device will be triggered to execute the command, and the service configuration corresponding to the command is completed.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
based on the above processing manner, after the user inputs the command according to the help information of the command name of the command, if the storage device does not have the device resource required for executing the command, the terminal may not correctly execute the command and may report an error, at this time, the user is required to create the device resource by using the command for creating the device resource first, and then input the command corresponding to the service configuration again, thereby resulting in a low efficiency of executing the command.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for creating device resources. The technical scheme is as follows:
in a first aspect, a method for creating a device resource is provided, the method including:
receiving a help information acquisition instruction of a target command name; searching a resource identifier corresponding to the command parameter of the required equipment resource associated with the target command name according to the corresponding relation between the command parameter of the required equipment resource stored in advance and the resource identifier of the currently available equipment resource; if the command parameters of the required device resources associated with the target command name have target command parameters of which the corresponding resource identifiers are not found, the device resources required by the target command parameters can be created, and the help information of the target command name and the newly created resource identifiers of the device resources are displayed.
According to the scheme provided by the embodiment of the invention, the user can directly input the command containing the target command name, the command parameter and the parameter value based on the device identifier of the device resource created by the device in the process of displaying the help information of the target command name, namely, the user only needs to input the command once to realize the service configuration, the command for creating the device resource is input according to the error report after the target command is input once, and then the target command is input once again, so that the efficiency of executing the command can be improved.
In one possible implementation, displaying the help information of the target command name includes: acquiring pre-stored parameter values corresponding to the command parameters associated with the target command name; the target command name, the command parameters and the parameter values corresponding to the command parameters can be displayed according to the usage rules of the target command name.
According to the scheme shown in the embodiment of the present invention, after receiving the help information acquisition instruction of the target command name, the device may create the device resource required by the target command parameter, and may display the help information of the target command name in an exemplary form (where, the device may perform parallel processing on the created device resource and the help information for displaying the target command name, or create the device resource first and then display the help information of the target command name), that is, in an exemplary form, a command including the target command name, each command parameter associated with the target command name, and a parameter value of each command parameter stored in advance is displayed, and this mode may be referred to as a help demonstration mode. Therefore, the displayed exemplary command is more helpful for the user to understand the use rule of the target command name, and further, the user can input the command which comprises the target command name and is used for realizing certain service configuration more quickly and accurately, so that the efficiency of executing the command by the equipment can be improved, and the difficulty of carrying out service configuration by the user through the command is also reduced.
In one possible implementation, displaying help information of the target command name includes: and displaying each command parameter related to the target command name and description information of each command parameter.
In one possible implementation, the method includes: corresponding to each command parameter, displaying a parameter value input bit; the parameter values input by the user in the parameter value input bits corresponding to each command parameter can be obtained; when the execution instruction is received, the target command can be generated and executed based on the parameter value corresponding to each command parameter input by the user and the target command name.
According to the scheme provided by the embodiment of the invention, after the device receives the help information acquisition instruction of the target command name, the device resource required by the target command parameter can be created, and then the command parameter associated with the target command name, the description information of each command parameter and the input bit of the parameter value are sequentially displayed, so that a user can input the corresponding parameter at the parameter value input bit corresponding to the command parameter, wherein after the user inputs the parameter value of the current command parameter and clicks the preset key in the keyboard, the device displays the next command parameter, the description information of the command parameter and the input bit of the parameter value until the last command parameter associated with the target command name is displayed. After the user inputs the parameter value of the last command parameter and taps the preset key in the keyboard, the device can execute the target command containing the parameter value corresponding to each command parameter and the target command name. In this case, when the user obtains the help information of the target command name, the device guides the user to input the parameter value of each command parameter in the guidance execution mode, and finally executes the target command without inputting the target command according to the understanding of the user after the user reads the help information in the text form.
Furthermore, the device may also support both the help presentation mode and the boot execution mode.
In one possible implementation, the method further includes: and correspondingly adding the target command parameter and the resource identifier of the newly created equipment resource into the corresponding relation.
In one possible implementation, the method further includes: and displaying resource identifiers corresponding to other command parameters except the target command parameter in the command parameters needing equipment resources and related to the target command name.
According to the scheme provided by the embodiment of the invention, after the device receives the help information acquisition instruction of the target command name, the resource identifier corresponding to the command parameter of the required device resource associated with the target command name can be displayed, so that when a user inputs a command containing the target command name, the parameter value corresponding to the command parameter of the required device resource can be obtained more intuitively and conveniently, and the user does not need to search the command name of the resource identifier corresponding to the command parameter of the required device resource and search the resource identifier of the command parameter, thereby improving the efficiency of the device for executing the command.
In a second aspect, there is provided an apparatus comprising a processor, a memory, a display, the processor configured to execute instructions stored in the memory; the processor implements the method for creating device resources provided by the first aspect described above by executing the instructions.
In a third aspect, an apparatus for creating a device resource is provided, where the apparatus includes at least one module, and the at least one module is configured to implement the method for creating a device resource provided in the first aspect.
The technical effects obtained by the second to third aspects of the embodiments of the present invention are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, before a user realizes certain service configuration through a target command name, the user can trigger the help information acquisition instruction of the target command name of the equipment through operation, and then the equipment can search equipment resources which are associated with the target command name and are required by command parameters of equipment resources in the equipment, if the equipment resources of the command parameter are not searched, the equipment can create the equipment resources required by the command parameter, and can display the help information of the target command name and the resource identification of the newly created equipment resources. Therefore, the user can directly input the command containing the target command name, the command parameter and the parameter value based on the device identifier of the device resource created by the device in the process of displaying the help information of the target command name, namely, the user only needs to input the command once to realize the service configuration, the user does not need to input the command for creating the device resource according to the error after inputting the target command once, and then re-input the target command once, thereby improving the efficiency of executing the command.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for a user in the field, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for creating device resources according to an embodiment of the present invention;
FIG. 3(a) is a schematic view of an interface provided by an embodiment of the present invention;
FIG. 3(b) is a schematic diagram of an interface provided by an embodiment of the present invention;
FIG. 4 is a schematic view of an interface provided by an embodiment of the present invention;
FIG. 5(a) is a schematic view of an interface provided by an embodiment of the present invention;
FIG. 5(b) is a schematic view of an interface provided by an embodiment of the present invention;
FIG. 5(c) is a schematic view of an interface provided by an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus for creating device resources according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus for creating device resources according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus for creating device resources according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an apparatus for creating device resources according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for creating equipment resources, wherein an execution main body of the method is equipment with a service configuration function realized through a Command Line Interface, wherein the equipment can be storage equipment, a server, a personal computer and the like provided with a Command Line Interface (CLI) application program, and can be equipment provided with a shell application program. The following embodiments take a device as an example of a device installed with a CLI application program for detailed description, and other cases are similar and will not be described again.
The device may include a processor 110, a memory 120, and a display 130, and the processor 110 may be connected to the memory 120 and the display 130, respectively, as shown in fig. 1. The processor 110 may be a control center of the device, connect various parts of the device using various interfaces and lines, perform various functions of the device and process data by running or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby monitoring the device as a whole. Processor 110 may include one or more processing units; the processor 110 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, etc. The memory 110 may be used to store programs. Specifically, the program may include a program code including computer operation instructions, and in this embodiment of the present invention, the memory 120 may be further configured to store a correspondence between a command parameter of the required device resource and a resource identifier of the currently available device resource. Memory 120 may comprise RAM and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 110 executes the program codes stored in the memory 120 to realize various functions, wherein in the embodiment of the present invention, the memory 120 can also be used for storing data required and generated in the following processing procedures. The display may be used to display various interfaces, and in the embodiment of the present invention, the display may be used to display help information of the target command name and a resource identifier of the device resource.
As shown in fig. 2, the specific processing flow of the method may include the following steps:
in step 201, the device receives a help information acquisition instruction of a target command name.
The target command name may be any one of all command names for implementing service configuration, and may be a command name corresponding to help information to be acquired by a user.
In implementation, a user may perform various service configurations on a device through a CLI application installed in the device, and specifically, when the user wants to perform a certain service configuration, a command name corresponding to the service configuration, command parameters associated with the command name, and parameter values corresponding to the command parameters may be input in a CLI interface. In order to prevent the user from forgetting the usage rule of a command name, wherein the usage rule may be a command structure of a command containing the command name, the device may be further provided with a command help function, so that the user can view help information of the command name through the command help function before performing service configuration through the command containing the command name. Specifically, the user may input a command name (i.e., a target command name) in the CLI interface, and may click a preset key of the keyboard for obtaining help information of the command name, for example, "? ", the device receives the help information acquisition instruction of the target command name.
This step may be specifically implemented by the processor 110.
Step 202, the device searches for a resource identifier corresponding to the command parameter of the required device resource associated with the target command name according to the pre-stored correspondence between the command parameter of the required device resource and the resource identifier of the currently available device resource.
The currently available device resources may be currently unoccupied device resources contained in the device.
In implementation, the device may store in advance a correspondence between a command parameter of the device resource required and a resource identifier of the currently available device resource, where the command parameter of the device resource required may be a command parameter whose corresponding parameter value is the resource identifier of the device resource in the device. For example, the target command name is storage data, the command containing the command name is storage data in the folder 0, the command parameter associated with the target command name includes a folder identifier, 0 is a parameter value of the folder identifier, if the command can be executed, it is necessary that the device includes the folder identified as 0, i.e. the folder is a device resource, 0 is a resource identifier of the device resource (folder), i.e. the folder identifier is a command parameter requiring the device resource, and for example, the target command name is to create a virtual machine, the command parameter associated with the target command name includes a name and the like, wherein, the name can be the name of the virtual machine to be created, the parameter value of the command parameter needs the user to draw a name for the virtual machine to be created according to the requirement of the user, the command parameter does not require device resources, i.e., the command parameter is not a command parameter that requires device resources.
The command parameters associated with the target command name may include command parameters requiring device resources, and after receiving the help information acquisition instruction of the target command name, the device may acquire the target command name input by the user, and acquire the command parameters associated with the target command name in the pre-stored correspondence between the command name and the associated command parameters, thereby determining the command parameters requiring device resources in all the command parameters associated with the target command name, and determining whether the device includes currently available device resources corresponding to the command parameters. Specifically, the device may determine, from the command parameters in the pre-stored correspondence, a command parameter that requires device resources among all command parameters associated with the target command name, and in the pre-stored correspondence between the command parameters of the required device resources and the resource identifiers of the currently available device resources, searching a resource identifier corresponding to the command parameter needing the equipment resource and associated with the target command name, if all device resources requiring the command parameters of the device resource associated with the target command name are included in the device, the device may find the resource identifier corresponding to the command parameter for each device resource that is needed, if the device does not include a device resource of a command parameter (which may be referred to as a target command parameter) of all the command parameters requiring device resources associated with the target command name, the device does not find a resource identifier corresponding to the target command parameter.
This step may be implemented in particular by the processor 110 and the memory 120 together.
Step 203, if there is a target command parameter for which the corresponding resource identifier is not found in the command parameters of the required device resources associated with the target command name, the device creates the device resources required by the target command parameter, and displays the help information of the target command name and the resource identifier of the newly created device resource.
In implementation, if the device does not include a device resource of the target command parameter, that is, if there is a target command parameter that does not find a corresponding resource identifier in the command parameter of the device resource that needs to be associated with the target command name, the device may create a device resource that is needed by the target command parameter, where the device may allocate a resource identifier to the newly created device resource according to a preset rule, for example, the resource identifier of the device resource is a number, and the device may allocate the resource identifier to the device resource when creating the device resource. After the device creates the device resource, help information of the target command name and a resource identifier of the newly created device resource may be displayed on the CLI interface, where the help information of the target command name may be use help information of the target command name, and may be used for a user to specify a use rule of the target command name. In addition, the device may also display a resource identifier corresponding to another command parameter except the target command parameter in the command parameters requiring device resources associated with the target command name, that is, after the device receives the help information obtaining instruction of the target command name, the resource identifier of the currently available device resource corresponding to the command parameter requiring device resources associated with the target command name may be displayed on the CLI interface.
This step may be specifically implemented by processor 110 and display 130 together.
Optionally, after the device creates the device resource, the target command parameter may be stored in correspondence with the resource identifier of the device resource, and accordingly, the processing procedure may be as follows: and correspondingly adding the target command parameter and the resource identifier of the newly created equipment resource into the corresponding relation by the equipment.
In implementation, after the device creates the device resource required by the target command parameter, the target command parameter and the resource identifier of the newly created device resource may be correspondingly added to the corresponding relationship, that is, to the pre-stored corresponding relationship between the command parameter required by the device resource and the resource identifier of the currently available device resource.
The process may be specifically implemented by the processor 110.
Optionally, the device may display the help information of the target command name in an exemplary form according to the usage rule of the target command name, and accordingly, the processing procedure may be as follows: acquiring parameter values corresponding to command parameters associated with a pre-stored target command name; and displaying the target command name, each command parameter and the parameter value corresponding to each command parameter according to the use rule of the target command name.
In implementation, after receiving the help information acquisition instruction of the target command name, the device may display a static text help option and a dynamic demonstration help option on the CLI interface, and the user may select the two options. When the user selects the dynamic presentation help option, the device may display a help presentation mode option and a guidance execution mode option in the CLI interface, and the user may select the two options, for example, the CLI interface may display a static text help option and a dynamic presentation help option, and correspondingly display a number label, and may display an option selection input bit, and the user may select the corresponding options by inputting the corresponding number label in the option selection input bit, as shown in fig. 3(a), for example, the user selects 1 (where 1 denotes the dynamic presentation help option, and 2 denotes the static text help option), and then the device may continue to display the help presentation mode option and the guidance execution mode option in the CLI interface, and correspondingly display a number label, and may display an option selection input bit, and the user may input the corresponding number label in the option selection input bit, to select the corresponding option, as shown in fig. 3(b), such as 1 selected by the user (where 1 represents the help presentation mode option and 2 represents the boot execution mode option).
When a user selects the help demonstration mode option, the device may obtain parameter values corresponding to command parameters associated with a pre-stored target command name, and may further sequentially display the target command name, the command parameters, and the parameter values corresponding to the command parameters according to the usage rules of the target command name, where the content command displayed at this time is an example command including the target command name, the user may input a command including the target command name with reference to the example command, and when inputting the command, the user only needs to modify the parameter values corresponding to the command parameters on the example basis. In addition, after the device obtains the parameter values corresponding to the command parameters associated with the target command name, whether the parameter values corresponding to the command parameters meet the verification conditions or not can be judged according to the verification conditions corresponding to the command parameters, and if the parameter values meet the verification conditions, text information of successful command execution can be displayed. For example, the target command is named create virtual _ machine generator, and the command parameters include: name, inner _ container _ id, memory, vcpu _ count, and sys _ disk _ size, parameter values meeting the verification conditions of the command parameters may be stored in advance in the device, and a create virtual _ machine general name ═ xlj inner _ container _ id ═ 0 memory ═ 4GB vcpu _ count ═ 1 sys _ disk _ size ═ 100GB may be displayed in the CLI interface, as shown in fig. 4.
The processing may be specifically implemented by the processor 110 and the display 130 in combination.
Optionally, after the device creates the device resource required by the target command parameter, the device may guide the user to input the command including the target command name, and accordingly, the processing procedure may be as follows: and displaying each command parameter related to the target command name and description information of each command parameter.
In implementation, after the device creates the device resources required by the target command parameter, the command parameters associated with the target command name and the description information of the command parameters may be displayed on the CLI interface, where the description information of the command parameters may be definitions of the command parameters, and input requirement information.
The process may be embodied by display 130.
Optionally, the device may further display an input bit corresponding to each command parameter, and accordingly, the processing procedure may be as follows: corresponding to each command parameter, displaying a parameter value input bit; acquiring parameter values input by a user in a parameter value input bit corresponding to each command parameter; when an execution instruction is received, a target command is generated and executed based on a parameter value corresponding to each command parameter input by a user and a target command name.
In implementation, after the device creates device resources required by a target command parameter, a parameter value input bit may be further displayed corresponding to each displayed command parameter on the CLI interface, so that a user may input a parameter value corresponding to the command parameter at the parameter value input bit corresponding to each command parameter, further, the device may obtain a parameter value input by the user in the parameter value input bit corresponding to each command parameter, and after the user inputs the parameter values for all command parameters, the device may tap a trigger key (for example, enter key) for executing a command in the keyboard, at this time, when the device receives an execution instruction, the device may further generate and execute the target command based on the parameter value corresponding to each command parameter input by the user and the target command name.
Specifically, after the device creates the device resource required by the target command parameter, a first command parameter and description information of the first command parameter in each command parameter associated with the target command name may be displayed, wherein a parameter value input bit is also displayed corresponding to the first command parameter, a user may input a parameter value corresponding to the first command parameter at the parameter value input bit, after the input, the user may click an enter key in a keyboard, at this time, the device is triggered to obtain the parameter value of the first command parameter input by the user, and whether the parameter value of the first command parameter input by the user satisfies a check condition is detected according to the check condition of the first command parameter (for example, the check condition of the first command parameter is that the parameter value is an english character, if the parameter value input by the user is an english character, the parameter value input by the user satisfies the check condition, if the parameter value input by the user is Chinese characters, the parameter value input by the user meets the check condition), if so, the equipment can judge whether the command parameter (namely, the first command parameter) is the last command parameter, if so, the equipment can generate and execute a target command based on the parameter value corresponding to each command parameter input by the user and the target command name, if not, the equipment can display the next command parameter (namely, the second command parameter) and the description information of the second command parameter, and can display the parameter value input bit of the second command parameter until the last command parameter, the description information and the parameter value input bit are displayed.
The following describes the above processing procedure in detail, taking the target command name as create virtual _ machine generator as an example:
after the device creates the device resource needed by the target command parameter, the name description information and the parameter value input bit can be displayed on the CLI interface, as follows:
Please input the value of<name>:|
Name string using alphanumeric,underscores(_),dots(.)or hyphens(-)(length is from 1to 31).
the "|" symbol represents a parameter value input bit (the symbol may not be displayed), that is, the position of the symbol is an inputtable state, the user may input the parameter value of the name at the position, for example, the parameter value input by the user is test, and a enter key in the keyboard is clicked, at this time, the device may determine whether the command parameter is the last command parameter, if not, the related information of the next command parameter is continuously displayed, at this time, as shown in fig. 5(a), the display content in the CLI interface is as follows:
Please input the value of<name>:test
Name string using alphanumeric,underscores(_),dots(.)or hyphens(-)(length is from 1to 31).
Please input the value of<owner_container_id>:|
ID of Container that manage virtual machine,and is an integer(0-15).
the user may input the parameter value of inner _ container _ id at the parameter value input bit corresponding to inner _ container _ id, for example, the parameter value input by the user is 0, and hit the enter key in the keyboard, at this time, the device may determine whether the command parameter is the last command parameter, if not, continue to display the related information of the next command parameter, at this time, the display content in the CLI interface is as follows:
Please input the value of<name>:test
Name string using alphanumeric,underscores(_),dots(.)or hyphens(-)(length is from 1to 31).
Please input the value of[owner_container_id]:0
ID of Container that manage virtual machine,and is an integer(0-15).
Please input the value of[memory]:|
Memory value use integer followed by unit MB,GB,TB(128MB-1TB,GB support three decimal places).
the user may input the parameter value of the memory at the parameter value input position corresponding to the memory, for example, the parameter value input by the user is 4GB, and tap an enter key in the keyboard, at this time, the device may determine whether the command parameter is the last command parameter, if not, continue to display the related information of the next command parameter, at this time, the display content in the CLI interface is as follows:
Please input the value of<name>:test
Name string using alphanumeric,underscores(_),dots(.)or hyphens(-)(length is from 1to 31).
Please input the value of[owner_container_id]:0
ID of Container that manage virtual machine,and is an integer(0-15).
Please input the value of[memory]:4GB
Memory value use integer followed by unit MB,GB,TB(128MB-1TB,GB support three decimal places).
Please input the value of[vcpu_count]:|
The cpu counts(1-32).
the user may input the parameter value of vcpu _ count at the parameter value input bit corresponding to vcpu _ count, for example, the parameter value input by the user is 1, and tap an enter key in the keyboard, at this time, the device may determine whether the command parameter is the last command parameter, and if not, continue to display the related information of the next command parameter, at this time, the display content in the CLI interface is as follows:
Please input the value of<name>:test
Name string using alphanumeric,underscores(_),dots(.)or hyphens(-)(length is from 1to 31).
Please input the value of[owner_container_id]:0
ID of Container that manage virtual machine,and is an integer(0-15).
Please input the value of[memory]:4GB
Memory value use integer followed by unit MB,GB,TB(128MB-1TB,GB support three decimal places).
Please input the value of[vcpu_count]:1
The cpu counts(1-32).
Please input the value of[sys_disk_size]:|
Disk size value use integer followed by unit GB,TB(1GB-1TB,GB and TB support three decimal places).
the user may input the parameter value of sys _ disk _ size at the parameter value input bit corresponding to sys _ disk _ size, for example, the parameter value input by the user is 100GB, and tap the enter key in the keyboard, at this time, the device may determine whether the command parameter is the last command parameter, if so, execute the target command including the parameter value corresponding to each command parameter input by the user and the target command name, and may display text information indicating that the command execution is successful, as shown in fig. 5 (b). In addition, the device may display the resource identifier of the currently available device resource corresponding to the command parameter when displaying the command parameter, the specification information, and the parameter value input bit of the device resource that is needed, as shown in fig. 5 (c).
In addition, the embodiment of the invention can simultaneously support two modes of a help demonstration mode and a guide execution mode, namely after the device displays the help demonstration mode option and the guide execution mode option on the CLI interface, when the user can select the guide execution mode option, under the condition, the device can guide the user to continuously input the parameter value of each command parameter according to the method until the device executes the target command containing the target command name after the parameter value of the last command parameter is input. In other words, in this mode, after receiving the help information acquisition instruction of the target command name, the device can directly guide the user to complete the input of the command including the target command name, and the user does not need to simply read the text information and automatically input all the contents of the target command according to the understanding of the user on the text information, so that the user can input the command for realizing the service configuration more conveniently, and further, the efficiency of executing the command by the device can be improved.
The processing may be specifically implemented by the processor 110 and the display 130 in combination.
In the embodiment of the invention, before a user realizes certain service configuration through a target command name, the user can trigger the help information acquisition instruction of the target command name of the equipment through operation, and then the equipment can search equipment resources which are associated with the target command name and are required by command parameters of equipment resources in the equipment, if the equipment resources of the command parameter are not searched, the equipment can create the equipment resources required by the command parameter, and can display the help information of the target command name and the resource identification of the newly created equipment resources. Therefore, the user can directly input the command containing the target command name, the command parameter and the parameter value based on the device identifier of the device resource created by the device in the process of displaying the help information of the target command name, namely, the user only needs to input the command once to realize the service configuration, the user does not need to input the command for creating the device resource according to the error after inputting the target command once, and then re-input the target command once, thereby improving the efficiency of executing the command.
Fig. 6 is a block diagram of an apparatus for creating device resources according to an embodiment of the present invention. The means for creating device resources may be implemented as part or all of the device in software, hardware, or a combination of both. The apparatus for creating device resources provided in the embodiment of the present invention may implement the process described in fig. 2 in the embodiment of the present invention, where the apparatus for creating device resources includes: the device comprises a receiving module 610, a searching module 620, a creating module 630, a displaying module 640, a first obtaining module 650, a second obtaining module 660, an executing module 670 and an adding module 680, wherein:
the receiving module 610 is configured to receive a help information obtaining instruction of the target command name, and may specifically implement the receiving function in step 201 and other implicit steps of receiving information by the device.
The searching module 620 is configured to search, according to a correspondence between a pre-stored command parameter of a device resource that needs to be searched and a resource identifier of a currently available device resource, a resource identifier corresponding to the command parameter of the device resource that needs to be searched and is associated with the target command name, and may specifically implement the searching function in step 202 and other implicit steps of searching information by the device.
A creating module 630, configured to create, if there is a target command parameter that does not find a corresponding resource identifier in the command parameters of the required device resource associated with the target command name, a device resource required by the target command parameter, which may specifically implement the creating function in step 203 and other implicit steps of creating information by a device.
The display module 640 is configured to display the help information of the target command name and the resource identifier of the newly created device resource, and may specifically implement the display function in step 203 and other implicit steps of displaying information by the device.
Optionally, as shown in fig. 7, the apparatus further includes:
a first obtaining module 650, configured to obtain parameter values corresponding to command parameters associated with the target command name, where the parameter values are stored in advance;
the display module 640 is specifically configured to:
and displaying the target command name, the command parameters and the parameter values corresponding to the command parameters according to the use rule of the target command name.
Optionally, the display module 640 is specifically configured to:
and displaying each command parameter associated with the target command name and description information of each command parameter.
Optionally, the display module 640 is further configured to:
corresponding to each command parameter, displaying a parameter value input bit;
as shown in fig. 8, the apparatus further includes:
a second obtaining module 660, configured to obtain a parameter value input by the user in the parameter value input bit corresponding to each command parameter;
and the execution module 670 is configured to, when an execution instruction is received, generate and execute a target command based on a parameter value corresponding to each command parameter input by the user and the target command name.
Optionally, as shown in fig. 9, the apparatus further includes:
an adding module 680, configured to correspondingly add the target command parameter and the resource identifier of the newly created device resource to the corresponding relationship.
Optionally, the display module 640 is further configured to:
and displaying resource identifiers corresponding to other command parameters except the target command parameter in the command parameters of the required equipment resources associated with the target command name.
The relevant details may be combined with the method embodiment described in fig. 2.
It should be noted that the receiving unit 610, the searching module 620, the creating module 630, the first obtaining module 650, the second obtaining module 660, the executing module 670, and the adding module 680 may be implemented by a processor, or the processor is implemented by matching a memory, or the processor executes program instructions in the memory, and the displaying module 640 may be implemented by a display, or implemented by combining the processor.
In the embodiment of the invention, before a user realizes certain service configuration through a target command name, the user can trigger the help information acquisition instruction of the target command name of the equipment through operation, and then the equipment can search equipment resources which are associated with the target command name and are required by command parameters of equipment resources in the equipment, if the equipment resources of the command parameter are not searched, the equipment can create the equipment resources required by the command parameter, and can display the help information of the target command name and the resource identification of the newly created equipment resources. Therefore, the user can directly input the command containing the target command name, the command parameter and the parameter value based on the device identifier of the device resource created by the device in the process of displaying the help information of the target command name, namely, the user only needs to input the command once to realize the service configuration, the user does not need to input the command for creating the device resource according to the error after inputting the target command once, and then re-input the target command once, thereby improving the efficiency of executing the command.
It should be noted that: in the apparatus for creating device resources according to the foregoing embodiments, when creating device resources, only the division of the functional modules is described as an example, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for creating device resources and the method for creating device resources provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
It will be understood by those skilled in the art that all or part of the steps of the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (16)

1. A method for creating device resources is applied to a device for implementing service configuration functions, and the method comprises the following steps:
receiving a help information acquisition instruction of a target command name;
displaying a help presentation mode option and a boot execution mode option;
searching a resource identifier corresponding to the command parameter of the required equipment resource associated with the target command name according to the corresponding relation between the pre-stored command parameter of the required equipment resource and the resource identifier of the currently available equipment resource;
if the command parameters of the required equipment resources associated with the target command name have target command parameters of which the corresponding resource identifiers are not found, establishing the equipment resources required by the target command parameters, and displaying the help information of the target command name and the newly established resource identifiers of the equipment resources;
wherein, if a selection operation for the help demonstration mode option is received, the displaying the help information of the target command name includes:
acquiring pre-stored parameter values corresponding to command parameters associated with the target command name;
and displaying the target command name, the command parameters and the parameter values corresponding to the command parameters according to the use rule of the target command name.
2. The method according to claim 1, wherein if a selection operation for the guidance execution mode option is received, the displaying help information of the target command name comprises:
and displaying each command parameter associated with the target command name and description information of each command parameter.
3. The method of claim 2, wherein the method comprises:
corresponding to each command parameter, displaying a parameter value input bit;
acquiring parameter values input by a user in a parameter value input bit corresponding to each command parameter;
when an execution instruction is received, a target command is generated and executed based on a parameter value corresponding to each command parameter input by a user and the target command name.
4. The method of claim 1, further comprising:
and correspondingly adding the target command parameter and the resource identifier of the newly created equipment resource into the corresponding relation.
5. The method of claim 1, further comprising:
and displaying resource identifiers corresponding to other command parameters except the target command parameter in the command parameters of the required equipment resources associated with the target command name.
6. An apparatus for implementing a service configuration function, the apparatus comprising a processor, a memory, and a display, wherein:
the processor is used for receiving a help information acquisition instruction of a target command name; searching a resource identifier corresponding to the command parameter of the required equipment resource associated with the target command name according to the corresponding relation between the command parameter of the required equipment resource pre-stored in the memory and the resource identifier of the currently available equipment resource; if the command parameters of the required equipment resources associated with the target command name have target command parameters of which the corresponding resource identifiers are not found, establishing the equipment resources required by the target command parameters;
the display is used for displaying a help demonstration mode option and a guide execution mode option, and displaying help information of the target command name and a resource identifier of a newly created device resource;
the processor is further configured to: if the selection operation aiming at the help demonstration mode option is received, acquiring parameter values corresponding to all command parameters associated with the target command name and stored in the memory in advance;
if the processor receives a selection operation for the help presentation mode option, the display is specifically configured to:
and displaying the target command name, the command parameters and the parameter values corresponding to the command parameters according to the use rule of the target command name.
7. The device of claim 6, wherein if the processor receives a selection operation for the boot execution mode option, the display is specifically configured to:
and displaying each command parameter associated with the target command name and description information of each command parameter.
8. The apparatus of claim 7, wherein the display is further configured to:
corresponding to each command parameter, displaying a parameter value input bit;
the processor is further configured to: acquiring parameter values input by a user in a parameter value input bit corresponding to each command parameter; when an execution instruction is received, a target command is generated and executed based on a parameter value corresponding to each command parameter input by a user and the target command name.
9. The device of claim 6, wherein the processor is further configured to:
and correspondingly adding the target command parameter and the resource identifier of the newly created equipment resource into the corresponding relation.
10. The apparatus of claim 6, wherein the display is further configured to:
and displaying resource identifiers corresponding to other command parameters except the target command parameter in the command parameters of the required equipment resources associated with the target command name.
11. An apparatus for creating device resources, applied to a device implementing a service configuration function, the apparatus comprising:
the receiving module is used for receiving a help information acquisition instruction of a target command name;
the display module is used for displaying a help demonstration mode option and a guide execution mode option;
the searching module is used for searching the resource identifier corresponding to the command parameter of the required equipment resource associated with the target command name according to the corresponding relation between the command parameter of the required equipment resource stored in advance and the resource identifier of the currently available equipment resource;
a creating module, configured to create, if there is a target command parameter for which a corresponding resource identifier is not found in the command parameters of the required device resources associated with the target command name, a device resource required by the target command parameter;
the display module is further used for displaying the help information of the target command name and the resource identifier of the newly created equipment resource;
a first obtaining module, configured to obtain, if the receiving module receives a selection operation for the help demonstration mode option, a parameter value corresponding to each command parameter associated with the pre-stored target command name;
if the receiving module receives a selection operation for the help demonstration mode option, the display module is specifically configured to:
and displaying the target command name, the command parameters and the parameter values corresponding to the command parameters according to the use rule of the target command name.
12. The apparatus of claim 11, wherein if the receiving module receives a selection operation for the guidance execution mode option, the displaying module is specifically configured to:
and displaying each command parameter associated with the target command name and description information of each command parameter.
13. The apparatus of claim 12, wherein if the receiving module receives a selection operation for the boot execution mode option, the displaying module is further configured to:
corresponding to each command parameter, displaying a parameter value input bit;
the device further comprises:
the second acquisition module is used for acquiring the parameter values input by the user in the parameter value input bits corresponding to each command parameter;
and the execution module is used for generating and executing the target command based on the parameter value corresponding to each command parameter input by the user and the target command name when receiving the execution instruction.
14. The apparatus of claim 11, further comprising:
and the adding module is used for correspondingly adding the target command parameter and the resource identifier of the newly created equipment resource into the corresponding relation.
15. The apparatus of claim 11, wherein the display module is further configured to:
and displaying resource identifiers corresponding to other command parameters except the target command parameter in the command parameters of the required equipment resources associated with the target command name.
16. A computer-readable storage medium, characterized in that a program is stored in the computer-readable storage medium, which program is executed by a processor to implement the method according to any one of claims 1 to 5.
CN201610736591.8A 2016-08-26 2016-08-26 Method and device for creating equipment resources Active CN107783786B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110671897.0A CN113467868B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources
CN201610736591.8A CN107783786B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610736591.8A CN107783786B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110671897.0A Division CN113467868B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources

Publications (2)

Publication Number Publication Date
CN107783786A CN107783786A (en) 2018-03-09
CN107783786B true CN107783786B (en) 2021-06-15

Family

ID=61440401

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110671897.0A Active CN113467868B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources
CN201610736591.8A Active CN107783786B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202110671897.0A Active CN113467868B (en) 2016-08-26 2016-08-26 Method and device for creating equipment resources

Country Status (1)

Country Link
CN (2) CN113467868B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840414A (en) * 2018-12-13 2019-06-04 北京华胜天成信息技术发展有限公司 Safety protecting method, device and the electronic equipment of baseboard management controller
CN110543302A (en) * 2019-09-05 2019-12-06 无锡华云数据技术服务有限公司 Input method and device for input parameters in resource arrangement process
CN110955409B (en) * 2019-12-02 2023-03-28 郑州阿帕斯数云信息科技有限公司 Method and device for creating resources on cloud platform
CN111158770B (en) * 2019-12-30 2023-01-06 联想(北京)有限公司 Configuration information display method, device and storage medium
CN113495769B (en) * 2020-04-07 2023-04-07 西安理邦科学仪器有限公司 Page guidance method, equipment, system and storage medium
CN114385285B (en) * 2021-11-30 2024-02-06 重庆长安汽车股份有限公司 Image creation method based on automobile AI intelligent assistant

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1652510A (en) * 2004-02-07 2005-08-10 华为技术有限公司 Method and terminal for operating and maintaining telecommunication apparatus
CN101073057A (en) * 2003-10-24 2007-11-14 微软公司 Mechanism for providing extended functionality to command line instructions
CN101674375A (en) * 2009-09-02 2010-03-17 优视动景(北京)技术服务有限公司 Display method of helping prompt for mobile communication terminal and system thereof
CN101924656A (en) * 2010-08-26 2010-12-22 北京天融信科技有限公司 Method and device for realizing network equipment CLI (Command Line Interface for batch scripti) based on dynamic configuration
CN101944023A (en) * 2010-09-14 2011-01-12 南京联创科技集团股份有限公司 Implement method of universal command line interface of UNIX server software
CN102043570A (en) * 2009-10-22 2011-05-04 华为技术有限公司 Command line input method and device
CN104428749A (en) * 2012-07-02 2015-03-18 微软公司 Visual UI guide triggered by user actions

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7293262B2 (en) * 2003-01-27 2007-11-06 Bea Systems, Inc. Web based interface for JAVA message service mark-up language
CN1256663C (en) * 2003-03-28 2006-05-17 烽火通信科技股份有限公司 Management method possessing real time helping function in insertion type system
US7478380B2 (en) * 2004-11-15 2009-01-13 Dell Products L.P. Dynamically updatable and easily scalable command line parser using a centralized data schema
CN101226525B (en) * 2007-01-19 2012-02-15 国际商业机器公司 Method, server, client terminal and system for controlling download and display of web page layout
US9177269B2 (en) * 2009-05-29 2015-11-03 International Business Machines Corporation Complexity reduction of user tasks
US8744980B2 (en) * 2011-09-21 2014-06-03 Dell Products Lp Systems and methods for analysis of network equipment command line interface (CLI) and runtime management of user interface (UI) generation for same
CN111143006B (en) * 2019-12-25 2022-11-01 杭州迪普科技股份有限公司 Method and device for acquiring command help information

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101073057A (en) * 2003-10-24 2007-11-14 微软公司 Mechanism for providing extended functionality to command line instructions
US7640540B2 (en) * 2003-10-24 2009-12-29 Microsoft Corporation Mechanism for providing extended functionality to command line instructions
CN1652510A (en) * 2004-02-07 2005-08-10 华为技术有限公司 Method and terminal for operating and maintaining telecommunication apparatus
CN101674375A (en) * 2009-09-02 2010-03-17 优视动景(北京)技术服务有限公司 Display method of helping prompt for mobile communication terminal and system thereof
CN102043570A (en) * 2009-10-22 2011-05-04 华为技术有限公司 Command line input method and device
CN101924656A (en) * 2010-08-26 2010-12-22 北京天融信科技有限公司 Method and device for realizing network equipment CLI (Command Line Interface for batch scripti) based on dynamic configuration
CN101944023A (en) * 2010-09-14 2011-01-12 南京联创科技集团股份有限公司 Implement method of universal command line interface of UNIX server software
CN104428749A (en) * 2012-07-02 2015-03-18 微软公司 Visual UI guide triggered by user actions

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JMeter学习-023-JMeter 命令行(非GUI)模式详解(一)-执行、输出结果及日志、简单分布执行脚本;范丰平;《https://www.cnblogs.com/fengpingfan/p/5586711.html》;20160616;1-5 *
OceanStor 2800 V3 存储系统 V300R001 命令参考 04;华为技术有限公司;《https://support.huawei.com/enterprise/zh/doc/EDOC1000057387》;20150919;正文第1-2章,第5.1节,第12.3节 *
OceanStor 5300 V3&5500 V3&5600 V3&5800 V3&6800 V3 存储系统V300R002 命令参考;华为技术有限公司;《https://support.huawei.com/enterprise/zh/doc/EDOC1000059403》;20151109;1-54 *

Also Published As

Publication number Publication date
CN113467868B (en) 2023-12-15
CN107783786A (en) 2018-03-09
CN113467868A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN107783786B (en) Method and device for creating equipment resources
CN107193750B (en) Script recording method and device
EP3433732B1 (en) Converting visual diagrams into code
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN105868166B (en) Regular expression generation method and system
US10346159B2 (en) Systems and methods for software scanning tool
CN111125555B (en) Enterprise information acquisition method and device
CN109656815B (en) Test statement writing method, device and medium with configuration file and electronic equipment
CN111176996A (en) Test case generation method and device, computer equipment and storage medium
CN110990411B (en) Data structure generation method and device, and calling method and device
CN111813680B (en) Method and device for generating test script, computer equipment and storage medium
CN114416667A (en) Method and device for rapidly sharing network disk file, network disk and storage medium
CN104156305A (en) Application program testing method and device
CN113204345A (en) Page generation method and device, electronic equipment and storage medium
CN110975293A (en) Method, device, server and medium for establishing resource reference relation table
CN110019444B (en) Operation request processing method, device, equipment and system
CN110362404B (en) SQL-based resource allocation method and device and electronic equipment
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN111694992A (en) Data processing method and device
WO2018228001A1 (en) Electronic device, information query control method, and computer-readable storage medium
US10073852B2 (en) Computer-readable storage medium, file management apparatus, and file management method
US10747794B2 (en) Smart search for annotations and inking
CN107766228B (en) Multi-language-based automatic testing method and device
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN114064657A (en) Multi-table integration method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220906

Address after: No.1899 Xiyuan Avenue, high tech Zone (West District), Chengdu, Sichuan, 611730

Patentee after: Chengdu Huawei Technologies Co.,Ltd.

Address before: 611731 Qingshui River District, Chengdu hi tech Zone, Sichuan, China

Patentee before: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) Co.,Ltd.