CN109542357B - Command parameter assembling method, system, equipment and computer storage medium - Google Patents
Command parameter assembling method, system, equipment and computer storage medium Download PDFInfo
- Publication number
- CN109542357B CN109542357B CN201811463342.1A CN201811463342A CN109542357B CN 109542357 B CN109542357 B CN 109542357B CN 201811463342 A CN201811463342 A CN 201811463342A CN 109542357 B CN109542357 B CN 109542357B
- Authority
- CN
- China
- Prior art keywords
- information
- attribute
- command
- option
- parameter
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 230000009471 action Effects 0.000 claims abstract description 65
- 238000004590 computer program Methods 0.000 claims description 10
- 238000000605 extraction Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 7
- 230000000875 corresponding effect Effects 0.000 description 59
- 238000004891 communication Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 2
- 238000005056 compaction Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
- G06F3/0607—Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a command parameter assembling method, a system, equipment and a computer storage medium, wherein the method comprises the following steps: receiving configuration parameter information and configuration request information; extracting operation object information and operation option information from the configuration parameter information; extracting operation action information from the configuration request information; and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format. The command parameter assembling method disclosed by the application omits repeated code information in configuration parameter information and configuration request information; and then, the operation action information, the operation object information and the operation option information are assembled into corresponding command parameters according to a preset format, so that the command parameters do not contain repeated code information, the quality and the expandability of the command parameters are improved, and the command parameters have better applicability. The command parameter assembling system, the device and the computer readable storage medium provided by the application also solve the corresponding technical problems.
Description
Technical Field
The present application relates to the field of software technologies, and in particular, to a method, a system, a device, and a computer storage medium for assembling command parameters.
Background
In storage management software, a GUI (Graphical User Interface) has two business processes, one is to query and present a stored resource object, an alarm event, a performance index, state information, and the like, and the other is to configure, such as create, modify, delete, and the like. For each configuration task, there are many parameters, and the back end needs to assemble a corresponding command according to the parameters specified by the user and then execute the command.
However, in the existing command parameter assembly method, a large amount of repeated codes exist in the process of receiving the command parameters transmitted from the front end at the back end, injecting the parameters into the corresponding command, and then executing the command, which affects the quality and expandability of the codes, so that the existing command parameter assembly method has low applicability.
In view of the above, how to improve the applicability of the command parameter assembly method is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a command parameter assembling method, which can solve the technical problem of improving the applicability of the command parameter assembling method to a certain extent. The application also provides a command parameter assembling system, a device and a computer readable storage medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
a command parameter assembly method, comprising:
receiving configuration parameter information and configuration request information;
extracting operation object information and operation option information from the configuration parameter information;
extracting operation action information from the configuration request information;
and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format.
Preferably, before receiving the configuration parameter information and the configuration request information, the method further includes:
receiving a query request sent by a user client;
sending preset command parameter attribute information corresponding to the query request to the user client;
the receiving the configuration parameter information and the configuration request information includes:
receiving the configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information;
receiving configuration request information sent by the user client;
the command parameter class attribute information includes defined attribute information of the operation object information and the operation option information, and the type of the attribute information includes a name, a data type and a description.
Preferably, the extracting the operation object information and the operation option information from the configuration parameter information includes:
acquiring an attribute list corresponding to the command parameter type attribute information in the configuration parameter information by using a reflection principle;
traversing the attribute list, and splicing the value method of each attribute in the attribute list to obtain the value method of the attribute list;
calling a value taking method of the attribute list, and acquiring the attribute value of each attribute in the attribute list from the configuration parameter information;
for any attribute value, judging whether the attribute value belongs to the operation object information, if so, saving the attribute value as the operation object information; if not, the attribute value is stored as the operation option information.
Preferably, the operation option information includes operation option information with a reference and operation option information without a reference, the operation option information with a reference includes option names and option values, and the operation option information without a reference includes only the option names;
the storing the attribute value as the operation option information includes:
and judging whether the type of the attribute value is the option information with the parameter operation, if so, storing the attribute value according to a format containing the option name and the option value, and if not, storing the attribute value according to a format only containing the option name.
Preferably, the saving the attribute value according to a format including the option name and the option value includes:
and storing the attribute value according to a key-value pair format containing the option name and the option value.
Preferably, the assembling the operation action information, the operation object information, and the operation option information into corresponding command parameters according to a preset format includes:
searching the command class corresponding to the command parameter class corresponding to the configuration parameter information based on the preset mapping relation between the command parameter class attribute information and the command class;
assembling the operation action information, the operation object information and the operation option information into corresponding command parameters based on the searched command class;
and the command class comprises the operation action information and the assembly mode of the operation option information.
Preferably, the assembling the operation action information, the operation object information, and the operation option information into corresponding command parameters according to a preset format includes:
and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format, wherein the preset format comprises a format arranged according to prefix information, a splicing symbol, the operation action information, the splicing symbol, the operation option information, the splicing symbol and the operation object information.
A command parameter assembly system, comprising:
the first receiving module is used for receiving configuration parameter information and configuration request information;
the first extraction module is used for extracting operation object information and operation option information from the configuration parameter information;
the second extraction module is used for extracting operation action information from the configuration request information;
and the first assembling module is used for assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format.
A command parameter assembly apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the command parameter assembly method as described in any one of the above when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a command parameter assembly method as set forth in any one of the preceding claims.
The command parameter assembling method provided by the application receives configuration parameter information and configuration request information; extracting operation object information and operation option information from the configuration parameter information; extracting operation action information from the configuration request information; and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format. According to the command parameter assembling method, the operation object information and the operation option information are extracted from the configuration parameter information, and the operation action information is extracted from the configuration request information, so that repeated code information in the configuration parameter information and the configuration request information is saved; and then, the operation action information, the operation object information and the operation option information are assembled into corresponding command parameters according to a preset format, so that the command parameters do not contain repeated code information, the influence of the repeated code information on the command parameters is avoided, the quality and the expandability of the command parameters are improved, and the command parameters have better applicability. The command parameter assembling system, the device and the computer readable storage medium provided by the application also solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a first flowchart of a command parameter assembly method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a command parameter assembling method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a command parameter assembly system according to an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of a command parameter assembling apparatus according to an embodiment of the present disclosure;
fig. 5 is another schematic structural diagram of a command parameter assembling apparatus according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In storage management software, a GUI (Graphical User Interface) has two business processes, one is to query and present a stored resource object, an alarm event, a performance index, state information, and the like, and the other is to configure, such as create, modify, delete, and the like. For each configuration task, there are many parameters, and the back end needs to assemble a corresponding command according to the parameters specified by the user and then execute the command. However, in the existing command parameter assembly method, a large amount of repeated codes exist in the process of receiving the command parameters transmitted from the front end at the back end, injecting the parameters into the corresponding command, and then executing the command, which affects the quality and expandability of the codes, so that the existing command parameter assembly method has low applicability. The command parameter assembling method has better applicability.
Referring to fig. 1, fig. 1 is a first flowchart of a command parameter assembling method according to an embodiment of the present disclosure.
The command parameter assembling method provided by the embodiment of the application can comprise the following steps:
step S101: and receiving configuration parameter information and configuration request information.
In practical applications, it is possible to receive configuration parameter information and configuration request information, and as can be seen from the descriptions in steps S102 and S103, the configuration parameter information refers to information including operation object information and operation option information, and the configuration request information refers to information including operation action information. The detailed format of the configuration parameter information and the configuration request information may be determined according to a specific application scenario. In a specific application scenario, the command parameter assembly system can receive configuration parameter information and configuration request information transmitted by a human-computer interaction interface of the command parameter assembly system, and also can receive configuration parameter information and configuration request information transmitted by an upload port of the command parameter assembly system.
Step S102: and extracting operation object information and operation option information from the configuration parameter information.
In practical application, after receiving the configuration parameter information and the configuration request information, the operation object information and the operation option information may be extracted from the configuration parameter information, and specifically, the configuration parameter information may be analyzed by an analysis method, and the operation object information and the operation option information may be extracted according to an analysis result. The specific content of the operation object information and the operation option information may be determined according to actual needs, for example, the operation object information may be an ID of a volume, and the operation option information may be a new name of the volume.
Step S103: operation action information is extracted from the configuration request information.
In practical application, after receiving the configuration parameter information and the configuration request information, the operation action information may be extracted from the configuration request information, specifically, the configuration request information may also be analyzed by an analysis method, and the operation action information may be extracted according to an analysis result. The specific content of the operation action information may be determined according to actual needs, for example, the operation action information may be a name of a modified volume, and the like.
Step S104: and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format.
In practical application, after the operation object information, the operation option information and the operation action information are extracted, the operation action information, the operation object information and the operation option information can be assembled into corresponding command parameters according to a preset format, so that the storage management software can realize corresponding functions according to the command parameters. For example, when the operation target information is a volume ID, the operation option information is a new name of a volume, and the operation action information is a name of a modified volume, the function represented by the command parameter may be that the name of the volume with a modified ID of a certain value is the new name.
The command parameter assembling method provided by the application receives configuration parameter information and configuration request information; extracting operation object information and operation option information from the configuration parameter information; extracting operation action information from the configuration request information; and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format. According to the command parameter assembling method, the operation object information and the operation option information are extracted from the configuration parameter information, and the operation action information is extracted from the configuration request information, so that repeated code information in the configuration parameter information and the configuration request information is saved; and then, the operation action information, the operation object information and the operation option information are assembled into corresponding command parameters according to a preset format, so that the command parameters do not contain repeated code information, the influence of the repeated code information on the command parameters is avoided, the quality and the expandability of the command parameters are improved, and the command parameters have better applicability.
Referring to fig. 2, fig. 2 is a second flowchart of a command parameter assembling method according to an embodiment of the present disclosure.
In practical applications, the command parameter assembling method provided by the embodiment of the present application may include the following steps:
step S201: and receiving a query request sent by a user client.
Step S202: and sending preset command parameter attribute information corresponding to the query request to the user client.
In practical application, a query request sent by a user client may be received first, and then preset command parameter attribute information corresponding to the query request is sent to the user client, so that the user client generates corresponding configuration parameter information according to the received command parameter attribute information.
Specifically, the command parameter class attribute information may include attribute information of each of the defined operation object information and the defined operation option information. Taking the operation object information as an example, the attribute information of the operation object information may include a name, a data type, a description, and the like of the operation object, such as "vdiskid" of the volume, an ID for marking the volume, and the data type of the operation object information may be a character string type, and the like; taking the operation option information as an example, the attribute information of the operation option information may include a name, a data type, a description, and the like of the operation option, such as a name "of the volume, a name for specifying the volume, which may be a character string type, and the like, such as a size" of the volume, a capacity size for specifying the volume, which may be a full-size type, and the like, such as "autoexpand" of the volume, a volume for specifying whether the volume belongs to self-compaction, and the like, such as "compact" of the volume, whether compression is enabled, and the like.
In a specific application scenario, the operation option information may include operation option information with a parameter and operation option information without a parameter, the operation option information with a parameter includes an option name and an option value, and the operation option information without a parameter only includes an option name; for example, the name of the volume, the size of the volume, and the like are information with the parameter, and the "autoexpand" of the volume and the "compressed" of the volume are information without the parameter.
Step S203: and receiving configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information.
In practical application, after the command parameter class attribute information is sent to the user client, the user client can assign values to corresponding parameters in the command parameter attribute information to generate corresponding configuration parameter information, and then the user client can send the configuration parameter information to the command parameter assembly system, and correspondingly, the command parameter assembly system can directly receive the configuration parameter information sent by the user client.
Step S204: receiving configuration request information sent by a user client; the command parameter class attribute information comprises defined attribute information of an operation object and operation option information, and the type of the attribute information comprises a name, a data type and a description.
In practical application, the configuration request information sent by the user client can be directly received, that is, the configuration request information can be information sent by the user client alone, so that the configuration request information and the configuration parameter information can be prevented from being mixed with each other and difficult to extract.
Step S205: and acquiring an attribute list corresponding to the command parameter type attribute information in the configuration parameter information by using a reflection principle.
In practical application, after receiving the configuration parameter information, since the configuration parameter information is generated by the user client assigning values to corresponding parameters in the command parameter type attribute information, different parts of the configuration parameter information and the command parameter type attribute information can be determined by using a reflection principle according to the format of the command parameter attribute information, that is, an attribute list corresponding to the command parameter type attribute information in the configuration parameter information is obtained.
In a specific application scenario, assignment and value taking methods of each attribute can be set in the command parameter class attribute information, so that assignment or value taking can be performed on the command parameter class attribute information by the aid of the assignment and value taking methods of each attribute.
Step S206: and traversing the attribute list, and splicing the value taking methods of all the attributes in the attribute list to obtain the value taking method of the attribute list.
Step S207: and calling a value taking method of the attribute list, and acquiring the attribute value of each attribute in the attribute list in the configuration parameter information.
In practical application, after the attribute list is obtained, the attribute list can be traversed, the value-taking methods of the attributes in the attribute list are spliced to obtain the value-taking method of the attribute list, then the value-taking method of the attribute list is called, the attribute value of each attribute in the attribute list is obtained in the configuration parameter information, and therefore the attribute value of each attribute is obtained quickly.
Step S208: for any attribute value, judging whether the attribute value belongs to the operation object information, if so, executing step S209; if not, go to step S210.
Step S209: the attribute value is saved as operation target information.
Step S210: the attribute values are saved as operation option information.
In practical application, after obtaining the attribute values of each attribute, it can be determined whether the attribute value belongs to the operation object information or not for any attribute value, if so, the attribute value is saved as the operation object information, and if not, the attribute value belongs to the operation option information, and the attribute value is saved as the operation option information. Specifically, it may be determined whether the attribute value belongs to the operation object information defined in the command parameter class attribute information, if so, it is determined that the attribute value belongs to the operation object information, and if not, it is determined that the attribute value does not belong to the operation object information.
Specifically, the operation option information may include operation option information with a parameter and operation option information without a parameter, where the operation option information with a parameter includes an option name and an option value, and the operation option information without a parameter includes only an option name; for example, the name of the volume, the size of the volume, and the like are information with the parameter, and the "autoexpand" of the volume and the "compressed" of the volume are information without the parameter. The step of saving the attribute value as the operation option information may specifically be: and judging whether the type of the attribute value is the option information with the parameter operation, if so, storing the attribute value according to a format containing the option name and the option value, and if not, storing the attribute value according to a format only containing the option name.
In a specific application scenario, in order to quickly store the attribute value and facilitate subsequent quick finding of the attribute value, the step of storing the attribute value according to a format including an option name and an option value may specifically be: and storing the attribute value according to a key value pair format containing the option name and the option value.
Step S211: operation action information is extracted from the configuration request information.
Step S212: and searching a command class corresponding to the command parameter class corresponding to the configuration parameter information based on the preset mapping relation between the command parameter class attribute information and the command class.
In practical application, a command class may be predefined, where the command class includes the assembly manner of the operation action information and the operation option information, that is, the assembly manner of the operation action information and the operation option information may be determined according to the command class. Therefore, the corresponding command parameters can be assembled according to the attribute information of the command parameter class and the command class. Specifically, in order to quickly determine the command class corresponding to the command parameter class attribute information, a mapping relationship between the command parameter class attribute information and the command class may be established in advance, and in a specific application scenario, the mapping relationship between the command parameter class attribute information and the command class may also be established by means of a key value pair. In a specific application scenario, the command class may further include a concatenation character, such as "-", etc.
Step S213: assembling the operation action information, the operation object information and the operation option information into corresponding command parameters based on the searched command class; the command class comprises operation action information and an assembly mode of operation option information.
In a specific application scenario, the step of assembling the operation action information, the operation object information, and the operation option information into the corresponding command parameter according to the preset format may specifically be: and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format, wherein the preset format comprises a format arranged according to prefix information, splicing symbols, the operation action information, the splicing symbols, the operation option information, the splicing symbols and the operation object information.
In practical applications, examples of command parameters assembled by the command parameter assembling method provided by the present application may be: mcsop chvdisk-name myvdisk 0. It represents the meaning: the name of the volume with ID 0 is changed to the new name myvdisk. Wherein, mcsop represents prefix, chvdisk represents operation action information, splicing symbol, name myvdisk represents operation option information with parameter, and 0 represents operation object information.
The application also provides a command parameter assembling system, which has the corresponding effect of the command parameter assembling method provided by the embodiment of the application. Referring to fig. 3, fig. 3 is a schematic structural diagram of a command parameter assembly system according to an embodiment of the present disclosure.
The command parameter assembly system provided by the embodiment of the application can include:
a first receiving module 101, configured to receive configuration parameter information and configuration request information;
the first extraction module 102 is configured to extract operation object information and operation option information from the configuration parameter information;
a second extraction module 103, configured to extract operation action information from the configuration request information;
the first assembling module 104 is configured to assemble the operation action information, the operation object information, and the operation option information into corresponding command parameters according to a preset format.
In the command parameter assembly system provided in an embodiment of the present application, the method may further include:
the second receiving module is used for receiving the query request sent by the user client before the first receiving module receives the configuration parameter information and the configuration request information;
the first sending module is used for sending preset command parameter attribute information corresponding to the query request to the user client;
the first receiving module may include:
the first receiving unit is used for receiving configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information;
the second receiving unit is used for receiving the configuration request information sent by the user client;
the command parameter class attribute information comprises defined attribute information of an operation object and operation option information, and the type of the attribute information comprises a name, a data type and a description.
In an instruction parameter assembling system provided in an embodiment of the present application, a first extracting module may include:
the first acquisition unit is used for acquiring an attribute list corresponding to the command parameter type attribute information in the configuration parameter information by using a reflection principle;
the first traversal unit is used for traversing the attribute list, splicing the value taking methods of all the attributes in the attribute list and obtaining the value taking method of the attribute list;
the first calling unit is used for calling a value taking method of the attribute list and acquiring the attribute value of each attribute in the attribute list from the configuration parameter information;
a first judging unit, configured to judge, for any attribute value, whether the attribute value belongs to the operation target information, and if so, save the attribute value as the operation target information; if not, the attribute value is stored as operation option information.
In the command parameter assembly system provided by the embodiment of the application, the operation option information includes operation option information with a parameter and operation option information without the parameter, the operation option information with the parameter includes an option name and an option value, and the operation option information without the parameter includes only the option name;
the first judgment unit may include:
and the first judging subunit is used for judging whether the type of the attribute value is the option information with the parameter operation, if so, storing the attribute value according to a format containing the option name and the option value, and if not, storing the attribute value according to a format only containing the option name.
In an instruction parameter assembling system provided in an embodiment of the present application, the first determining subunit may include:
and the first saving subunit is used for saving the attribute value according to a key value pair format containing the option name and the option value.
In an order parameter assembly system provided in an embodiment of the present application, a first assembly module may include:
the first searching unit is used for searching a command class corresponding to the command parameter class corresponding to the configuration parameter information based on the preset mapping relation between the command parameter class attribute information and the command class;
the first assembly unit is used for assembling the operation action information, the operation object information and the operation option information into corresponding command parameters based on the searched command class;
the command class comprises operation action information and an assembly mode of operation option information.
In an order parameter assembly system provided in an embodiment of the present application, a first assembly module may include:
and the second assembling unit is used for assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format, wherein the preset format comprises a format arranged according to prefix information, splicing symbols, operation action information, splicing symbols, operation option information, splicing symbols and operation object information.
The application also provides command parameter assembling equipment and a computer readable storage medium, which have corresponding effects of the command parameter assembling method provided by the embodiment of the application. Referring to fig. 4, fig. 4 is a schematic structural diagram of a command parameter assembling apparatus according to an embodiment of the present disclosure.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program stored in the memory 201:
receiving configuration parameter information and configuration request information;
extracting operation object information and operation option information from the configuration parameter information;
extracting operation action information from the configuration request information;
and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: before receiving configuration parameter information and configuration request information, receiving a query request sent by a user client; sending preset command parameter attribute information corresponding to the query request to the user client; correspondingly, receiving configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information; receiving configuration request information sent by a user client; the command parameter class attribute information comprises defined attribute information of an operation object and operation option information, and the type of the attribute information comprises a name, a data type and a description.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: acquiring an attribute list corresponding to command parameter attribute information in configuration parameter information by using a reflection principle; traversing the attribute list, and splicing the value-taking methods of all the attributes in the attribute list to obtain the value-taking method of the attribute list; calling a value taking method of the attribute list, and acquiring the attribute value of each attribute in the attribute list in the configuration parameter information; for any attribute value, judging whether the attribute value belongs to the operation object information, if so, saving the attribute value as the operation object information; if not, the attribute value is stored as operation option information.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: the operation option information comprises operation option information with a parameter and operation option information without the parameter, the operation option information with the parameter comprises option names and option values, and the operation option information without the parameter only comprises option names; and judging whether the type of the attribute value is the option information with the parameter operation, if so, storing the attribute value according to a format containing the option name and the option value, and if not, storing the attribute value according to a format only containing the option name.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: and storing the attribute value according to a key value pair format containing the option name and the option value.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: searching a command class corresponding to the command parameter class corresponding to the configuration parameter information based on the preset mapping relation between the command parameter class attribute information and the command class; assembling the operation action information, the operation object information and the operation option information into corresponding command parameters based on the searched command class; the command class comprises operation action information and an assembly mode of operation option information.
The command parameter assembling device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer subprogram is stored in the memory 201, and the following steps are specifically realized when the processor 202 executes the computer subprogram stored in the memory 201: and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format, wherein the preset format comprises a format arranged according to prefix information, splicing symbols, the operation action information, the splicing symbols, the operation option information, the splicing symbols and the operation object information.
Referring to fig. 5, another command parameter assembling apparatus provided in the embodiment of the present application may further include: an input port 203 connected to the processor 202, for transmitting externally input commands to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing the communication between the command parameter assembly equipment and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high definition link technology (HML), Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), and wireless connection: wireless fidelity technology (WiFi), bluetooth communication technology, bluetooth low energy communication technology, ieee802.11s based communication technology.
The computer-readable storage medium provided in the embodiments of the present application stores a computer program, and when the computer program is executed by a processor, the steps of the command parameter assembly method described in any of the above embodiments are implemented.
The computer-readable storage media described herein include Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
For a description of a relevant part in a command parameter assembly system, a device and a computer readable storage medium provided in the embodiments of the present application, please refer to a detailed description of a corresponding part in a command parameter assembly method provided in the embodiments of the present application, which is not repeated herein. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
It is further 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 apparatus 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 apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group consisting of additional identical elements in the process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (8)
1. A method for command parameter assembly, comprising:
receiving configuration parameter information and configuration request information;
extracting operation object information and operation option information from the configuration parameter information;
extracting operation action information from the configuration request information;
assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format;
before receiving the configuration parameter information and the configuration request information, the method further includes:
receiving a query request sent by a user client;
sending preset command parameter attribute information corresponding to the query request to the user client;
the receiving the configuration parameter information and the configuration request information includes:
receiving the configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information;
receiving configuration request information sent by the user client;
the command parameter class attribute information comprises defined attribute information of the operation object information and the operation option information, and the type of the attribute information comprises a name, a data type and a description;
wherein, the extracting operation object information and operation option information from the configuration parameter information includes:
acquiring an attribute list corresponding to the command parameter type attribute information in the configuration parameter information by using a reflection principle;
traversing the attribute list, and splicing the value method of each attribute in the attribute list to obtain the value method of the attribute list;
calling a value taking method of the attribute list, and acquiring the attribute value of each attribute in the attribute list from the configuration parameter information;
for any attribute value, judging whether the attribute value belongs to the operation object information, if so, saving the attribute value as the operation object information; if not, the attribute value is stored as the operation option information.
2. The method according to claim 1, wherein the operation option information includes operation option information with reference and operation option information without reference, the operation option information with reference includes option names and option values, and the operation option information without reference includes only the option names;
the storing the attribute value as the operation option information includes:
and judging whether the type of the attribute value is the option information with the parameter operation, if so, storing the attribute value according to a format containing the option name and the option value, and if not, storing the attribute value according to a format only containing the option name.
3. The method of claim 2, wherein said storing said property values in a format including said option name, said option value, comprises:
and storing the attribute value according to a key-value pair format containing the option name and the option value.
4. The method according to claim 2, wherein the assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format comprises:
searching the command class corresponding to the command parameter class corresponding to the configuration parameter information based on the preset mapping relation between the command parameter class attribute information and the command class;
assembling the operation action information, the operation object information and the operation option information into corresponding command parameters based on the searched command class;
and the command class comprises the operation action information and the assembly mode of the operation option information.
5. The method according to any one of claims 1 to 4, wherein the assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format comprises:
and assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format, wherein the preset format comprises a format arranged according to prefix information, a splicing symbol, the operation action information, the splicing symbol, the operation option information, the splicing symbol and the operation object information.
6. A command parameter assembly system, comprising:
the first receiving module is used for receiving configuration parameter information and configuration request information;
the first extraction module is used for extracting operation object information and operation option information from the configuration parameter information;
the second extraction module is used for extracting operation action information from the configuration request information;
the first assembling module is used for assembling the operation action information, the operation object information and the operation option information into corresponding command parameters according to a preset format;
wherein, can also include:
the second receiving module is used for receiving the query request sent by the user client before the first receiving module receives the configuration parameter information and the configuration request information;
the first sending module is used for sending preset command parameter attribute information corresponding to the query request to the user client;
the first receiving module includes:
a first receiving unit, configured to receive the configuration parameter information obtained after the user client assigns values to corresponding parameters in the command parameter class attribute information;
a second receiving unit, configured to receive configuration request information sent by the user client;
the command parameter class attribute information comprises defined attribute information of the operation object information and the operation option information, and the type of the attribute information comprises a name, a data type and a description;
wherein the first extraction module comprises:
a first obtaining unit, configured to obtain, by using a reflection principle, an attribute list corresponding to the command parameter type attribute information in the configuration parameter information;
the first traversal unit is used for traversing the attribute list, splicing the value taking methods of all the attributes in the attribute list and obtaining the value taking method of the attribute list;
the first calling unit is used for calling the value taking method of the attribute list and acquiring the attribute value of each attribute in the attribute list from the configuration parameter information;
a first judging unit, configured to judge, for any attribute value, whether the attribute value belongs to the operation target information, and if so, save the attribute value as the operation target information; if not, the attribute value is stored as the operation option information.
7. A command parameter assembly apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the command parameter assembly method of any one of claims 1 to 5 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a command parameter assembly method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811463342.1A CN109542357B (en) | 2018-12-03 | 2018-12-03 | Command parameter assembling method, system, equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811463342.1A CN109542357B (en) | 2018-12-03 | 2018-12-03 | Command parameter assembling method, system, equipment and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109542357A CN109542357A (en) | 2019-03-29 |
CN109542357B true CN109542357B (en) | 2022-03-08 |
Family
ID=65852330
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811463342.1A Active CN109542357B (en) | 2018-12-03 | 2018-12-03 | Command parameter assembling method, system, equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109542357B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110502384B (en) * | 2019-08-28 | 2020-06-02 | 云汉芯城(上海)互联网科技股份有限公司 | Parameter calibration method, device, equipment and storage medium for electronic component |
CN111610999A (en) * | 2020-05-26 | 2020-09-01 | 北京字节跳动网络技术有限公司 | Checking method, checking device, computer equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1783872A (en) * | 2004-11-30 | 2006-06-07 | 广东省电信有限公司科学技术研究院 | Method for realizing network configuration interface for opening mobile communication service |
CN101005681A (en) * | 2006-01-17 | 2007-07-25 | 大唐移动通信设备有限公司 | Interface automatic forming method and interface automatic forming system |
CN101179444A (en) * | 2007-12-11 | 2008-05-14 | 华为技术有限公司 | Configuration take-effective method, configuration system and configuration gateway |
CN103959429A (en) * | 2011-06-08 | 2014-07-30 | Xenex消毒服务有限公司 | Ultraviolet discharge lamp apparatuses with one or more reflectors and systems which determine operating parameters and disinfection schedules for germicidal devices |
CN106909395A (en) * | 2017-03-02 | 2017-06-30 | 腾讯科技(深圳)有限公司 | A kind of interface call method and terminal |
CN107783848A (en) * | 2017-09-27 | 2018-03-09 | 歌尔科技有限公司 | A kind of JSON command handling methods and device based on socket communication |
CN107908485A (en) * | 2017-10-26 | 2018-04-13 | 中国平安人寿保险股份有限公司 | Interface parameters transmission method, device, equipment and computer-readable recording medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8527577B2 (en) * | 2007-05-22 | 2013-09-03 | Oracle International Corporation | System and method for configuration-driven deployment |
US8769506B2 (en) * | 2007-09-24 | 2014-07-01 | Microsoft Corporation | Using a command interpreter at design time |
US20170097621A1 (en) * | 2014-09-10 | 2017-04-06 | Crestron Electronics, Inc. | Configuring a control sysem |
US10459665B2 (en) * | 2017-04-03 | 2019-10-29 | Samsung Electronics Co., Ltd. | System and method of configuring NVMe-oF devices using a baseboard management controller (BMC) |
CN108200080B (en) * | 2018-01-19 | 2021-03-16 | 深圳神州数码云科数据技术有限公司 | Remote service communication method |
-
2018
- 2018-12-03 CN CN201811463342.1A patent/CN109542357B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1783872A (en) * | 2004-11-30 | 2006-06-07 | 广东省电信有限公司科学技术研究院 | Method for realizing network configuration interface for opening mobile communication service |
CN101005681A (en) * | 2006-01-17 | 2007-07-25 | 大唐移动通信设备有限公司 | Interface automatic forming method and interface automatic forming system |
CN101179444A (en) * | 2007-12-11 | 2008-05-14 | 华为技术有限公司 | Configuration take-effective method, configuration system and configuration gateway |
CN103959429A (en) * | 2011-06-08 | 2014-07-30 | Xenex消毒服务有限公司 | Ultraviolet discharge lamp apparatuses with one or more reflectors and systems which determine operating parameters and disinfection schedules for germicidal devices |
CN106909395A (en) * | 2017-03-02 | 2017-06-30 | 腾讯科技(深圳)有限公司 | A kind of interface call method and terminal |
CN107783848A (en) * | 2017-09-27 | 2018-03-09 | 歌尔科技有限公司 | A kind of JSON command handling methods and device based on socket communication |
CN107908485A (en) * | 2017-10-26 | 2018-04-13 | 中国平安人寿保险股份有限公司 | Interface parameters transmission method, device, equipment and computer-readable recording medium |
Also Published As
Publication number | Publication date |
---|---|
CN109542357A (en) | 2019-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111176976B (en) | Test data generation method and device, storage medium and electronic device | |
CN106936441B (en) | Data compression method and device | |
WO2015043512A1 (en) | Picture management method and device | |
CN108038212B (en) | Data interaction method, device, system, equipment and storage medium | |
JP2017531849A (en) | Character editing method and apparatus for screen display device | |
CN111641554B (en) | Message processing method and device and computer readable storage medium | |
CN109542357B (en) | Command parameter assembling method, system, equipment and computer storage medium | |
CN103440295A (en) | Method for uploading multimedia files and electronic terminal | |
CN104268229A (en) | Resource obtaining method and device based on multi-process browser | |
CN104965676A (en) | Random access memory access method and apparatus and control chip | |
CN108959294B (en) | Method and device for accessing search engine | |
CN115563071A (en) | Data processing method, system, electronic device and computer readable storage medium | |
CN111241071A (en) | Data migration method, system, equipment and computer readable storage medium | |
CN106371856B (en) | Menu counting method, user terminal and application background terminal | |
CN105207830A (en) | Detection method and apparatus for terminal information, and terminal | |
CN107357481B (en) | Message display method and message display device | |
CN108205559B (en) | Data management method and equipment thereof | |
CN111090651A (en) | Data source processing method, device and equipment and readable storage medium | |
CN104809753A (en) | File treatment method | |
CN112765110B (en) | PDF annotation data generation method, device, equipment and storage medium | |
CN114861003A (en) | Object enumeration method, device and medium under specified directory | |
CN112162701B (en) | Storage space recycling method, device, equipment and computer storage medium | |
CN111310088B (en) | Page rendering method and device | |
CN113326302A (en) | Data query method and device and storage medium | |
CN112784132A (en) | Data acquisition method and device and computer 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 |