[go: up one dir, main page]

CN113867975A - Method, device and computer equipment for quick response to command line - Google Patents

Method, device and computer equipment for quick response to command line Download PDF

Info

Publication number
CN113867975A
CN113867975A CN202111128939.2A CN202111128939A CN113867975A CN 113867975 A CN113867975 A CN 113867975A CN 202111128939 A CN202111128939 A CN 202111128939A CN 113867975 A CN113867975 A CN 113867975A
Authority
CN
China
Prior art keywords
data structure
structure information
class data
command
information
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.)
Granted
Application number
CN202111128939.2A
Other languages
Chinese (zh)
Other versions
CN113867975B (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111128939.2A priority Critical patent/CN113867975B/en
Publication of CN113867975A publication Critical patent/CN113867975A/en
Application granted granted Critical
Publication of CN113867975B publication Critical patent/CN113867975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本申请涉及一种命令行的快速响应方法、装置、计算机设备和存储介质。该方法包括:获取用户在命令行界面输入的命令指令,对命令指令进行解析得到命令关键字信息;根据命令关键字信息,获取对应于命令关键字信息的视图类数据结构信息;根据视图类数据结构信息,获取对应于视图类数据结构信息的实体类数据结构信息;执行命令指令,对实体类数据结构信息进行配置,视图类数据结构信息对应配置;输出配置完成后的实体类数据结构信息和/或视图类数据结构信息。采用本方法具有提高了命令行界面查询修改的速度,同时,也确保了数据的一致性的效果。

Figure 202111128939

The present application relates to a command line quick response method, apparatus, computer device and storage medium. The method includes: acquiring command instructions input by a user on a command line interface, and analyzing the command instructions to obtain command keyword information; acquiring view class data structure information corresponding to the command keyword information according to the command keyword information; Structure information, obtain the entity class data structure information corresponding to the view class data structure information; execute the command instruction to configure the entity class data structure information, and the view class data structure information corresponds to the configuration; output the entity class data structure information after configuration and / or view class data structure information. The adoption of the method has the effect of improving the speed of query and modification of the command line interface and at the same time ensuring the consistency of the data.

Figure 202111128939

Description

Quick response method and device for command line and computer equipment
Technical Field
The present application relates to the field of storage device technologies, and in particular, to a method and an apparatus for fast responding to a command line, a computer device, and a storage medium.
Background
With the rapid development of the mobile internet, the network data generated every day is also growing at an alarming speed, and in the big data era, the storage device can not be separated, and the storage device can provide safe, reliable, large-capacity and high-speed data storage services.
The CLI is not opened for the storage device, and provides interfaces for management, monitoring, maintenance and the like for the storage device, and if operations such as query modification and the like are required to be performed on the storage device, the CLI needs to be executed through the CLI, so that the operation experience of a user on the storage device and the industry competitiveness of the user are directly influenced by the speed of CLI response.
The existing method for inquiring and modifying the storage device through the CLI is as follows: analyzing the input command instruction according to the command instruction input by the user, and directly inquiring and modifying the corresponding storage resource object in the storage equipment according to the analysis result.
However, the above query modification method only modifies the corresponding storage resource object, and since different storage resource objects may be associated with each other, the associated resource object needs to be modified manually, which results in prolonging the overall processing time and affecting the processing efficiency; further, if carelessness is slight, the data related to each other may be inconsistent.
Disclosure of Invention
In view of the above, it is necessary to provide a fast response method and apparatus for a command line, a computer device and a storage medium.
In one aspect, a method for fast response of a command line is provided, the method comprising:
acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information;
acquiring view type data structure information corresponding to the command keyword information according to the command keyword information;
acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured;
and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
In one embodiment, the obtaining, according to the command keyword information, view type data structure information corresponding to the command keyword information includes:
acquiring view class data structure information defined for each command input line, the view class data structure information including all command keyword information corresponding to each command input line;
and acquiring view type data structure information corresponding to the command keyword information according to the command keyword information.
In one embodiment, the obtaining, according to the view class data structure information, entity class data structure information corresponding to the view class data structure information includes:
acquiring entity class data structure information defined for each storage resource in the storage equipment;
acquiring view class data structure information defined for each command input line, wherein the view class data structure information is matched with the entity class data structure information;
and acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
In one embodiment, the executing the command instruction configures entity class data structure information, where the view class data structure information is configured correspondingly, and includes:
the command instruction comprises a query command instruction and a configuration command instruction;
when the command instruction is a query command instruction, executing the command instruction, and querying the entity data structure information and/or the view data structure information;
when the command instruction is a configuration command instruction, analyzing the configuration command instruction to obtain modified keyword information;
and executing the command instruction, and modifying the entity type data structure information according to the modifying key word information, wherein the view type data structure information is modified correspondingly.
In one embodiment, the above instruction for executing a command modifies the entity class data structure information according to the modification key information, and before the step of modifying the view class data structure information correspondingly, the method further includes:
setting a mutual exclusion lock for the entity class data structure information;
executing the command instruction, and modifying the entity data structure information according to the modifying key word information;
unlocking entity class data structure information;
and outputting the modified entity class data structure information.
In one embodiment, the method further comprises the following steps:
the entity data structure information comprises entity summarized data structure information and Map structure information; the entity class summary data structure information comprises summary data information of each resource object in each storage resource; the Map structure information includes an ID of each resource object and entity class object data information corresponding to each ID; the entity class data structure information is stored in the memory.
In one embodiment, the method further comprises the following steps:
the data of the view type data structure information is calculated by data matched with the entity type data structure information; the entity class data structure information refers to data information specified when the entity class data structure is created.
In another aspect, a fast response apparatus for a command line is provided, the apparatus including:
the first acquisition module is used for acquiring a command instruction input by a user on a command line interface and analyzing the command instruction to obtain command keyword information;
the second acquisition module is used for acquiring view data structure information corresponding to the command keyword information according to the command keyword information;
the third acquisition module is used for acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
the execution module is used for executing the command instruction, configuring the entity type data structure information and correspondingly configuring the view type data structure information;
and the output module is used for outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
In another aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the following steps are implemented:
acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information;
acquiring view type data structure information corresponding to the command keyword information according to the command keyword information;
acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured;
and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
In yet another aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when executed by a processor, performs the steps of:
acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information;
acquiring view type data structure information corresponding to the command keyword information according to the command keyword information;
acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured;
and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
Firstly, acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information; then, acquiring view type data structure information corresponding to the command keyword information according to the command keyword information; acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information; finally, executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured; and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished. Through the operation, the final configuration is completed by operating in the entity type data structure, the view type data structure information can be modified while the entity type data structure information is configured, and the operation is not required to be performed for multiple times, so that the processing time of the whole operation is reduced, the query modification speed is improved, and the consistency of the associated data is ensured.
Drawings
FIG. 1 is a diagram of an application environment for a fast response method for a command line, according to one embodiment;
FIG. 2 is a flow diagram illustrating a fast response method for a command line in one embodiment;
FIG. 3 is a block diagram of a fast response mechanism for a command line in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The command line quick response method provided by the application can be applied to the application environment shown in FIG. 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 acquires a command instruction input by a user on a command line interface, and analyzes the command instruction to obtain command keyword information; the server 104 acquires view type data structure information corresponding to the command keyword information according to the command keyword information; the server 104 acquires entity class data structure information corresponding to the view class data structure information according to the view class data structure information; the server 104 executes the command instruction, and configures the entity class data structure information, and the view class data structure information is configured correspondingly; and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished. The terminal 102 may be, but not limited to, various personal computers, notebook computers, tablet computers, and the like, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a method for fast responding to a command line is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step 202, obtaining a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information.
Here, the command line interface is an interface capable of inputting an executable instruction under a user prompt, and generally does not support a mouse, a user inputs an instruction through a keyboard, and a server receives the instruction and executes the instruction; the command instruction refers to a command formula input by a user; the command keyword information is keyword information for execution acquired from a command expression.
Specifically, the server acquires a command instruction input by a user on a command line interface, and analyzes the acquired command instruction, so that command keyword information is obtained.
Step 204, acquiring view data structure information corresponding to the command keyword information according to the command keyword information;
here, according to the data source, the data is divided into entity class data and view class data, the entity class data includes entity class data structure information, and the entity class data structure information refers to data information designated when an entity class data structure is created; the view class data comprises view class data structure information, and the data of the view class data structure information is calculated by data matched with the entity class data structure information.
Specifically, since the command keyword information obtained by the parsing is defined in the view data structure information, the view data structure information corresponding to the command keyword information can be obtained according to the command keyword information.
And step 206, acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
Specifically, since the view type data structure information is derived from the entity type data structure information, the entity type data structure information corresponding to the view type data structure information can be obtained according to the view type data structure information, for example, according to the command key information, the total capacity of the storage pool is to be obtained, the total capacity of the storage pool is formed by the sum of all RAID capacities in the storage pool, and the sum of RAID capacities is derived from the entity type data structure information.
And step 208, executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured.
Specifically, the command instruction is executed, and the entity type data structure information and the view type data structure information are set in a matching manner, so that the view type data structure information is configured while the entity type data structure information is configured. Namely, the configuration of the bottom layer data in the memory is realized, and simultaneously the upper layer data associated with the bottom layer data is also configured.
And step 210, outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
Specifically, when the configuration only relates to the entity class data structure information, the configured entity class data structure information is output, and if the configuration of the entity class data structure information is completed, the view class data structure information is also configured correspondingly, that is, the view class data structure information is also output.
Firstly, acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information; then, acquiring view type data structure information corresponding to the command keyword information according to the command keyword information; acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information; finally, executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured; and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished. Through the operation, the final configuration is completed by operating in the entity type data structure, the view type data structure information can be modified while the entity type data structure information is configured, and the operation is not required to be performed for multiple times, so that the processing time of the whole operation is reduced, the query modification speed is improved, and the consistency of the associated data is ensured.
In one embodiment, the obtaining, according to the command keyword information, view type data structure information corresponding to the command keyword information includes:
view class data structure information defined for each command input line is acquired, the view class data structure information including all command key information corresponding to each command input line.
Here, view class data structure information is defined for each command instruction, i.e., command input line, which the user may input, the view class data structure information including all command key information corresponding to each command input line. For example, the view type data structure information includes a plurality of attributes of the storage pool, each attribute has a corresponding command key information, each command input line has a plurality of command key information after being parsed, and the command key information of each attribute corresponds to the command key information of each command input line one to one.
And acquiring view type data structure information corresponding to the command keyword information according to the command keyword information.
According to the command keyword information of the command input line, the attribute information of the storage object belonging to the view data structure information and corresponding to the command keyword information can be acquired.
In the above operation, by defining that the command keyword information of each attribute corresponds to the command keyword information of each command input line, the view type data structure information corresponding to the command keyword information can be acquired according to the command keyword information.
In one embodiment, the obtaining, according to the view class data structure information, entity class data structure information corresponding to the view class data structure information includes:
and acquiring entity class data structure information defined for each storage resource in the storage device.
As is well known, there are many kinds of resources in a storage device, such as cabinets, controllers, fans, hard disks, storage pools, volumes, hosts, host maps, local copies, remote copies, etc., and, of course, different vendors are different for the storage resource partitioning in their storage devices.
An entity class data structure is defined for each storage resource that contains two member variables, m _ summary and m _ items. And m _ summary is an entity class summary data structure of the storage resource. m _ items is a Map structure, which is used here because it does not need traversal and can directly obtain the desired data, and includes key and value, where key is the ID of each resource object and value is the entity class object data information corresponding to each ID, which are stored in the memory.
When managing storage resources, it is often necessary to store summary information of the resources, and therefore, the entity class data structure information includes entity class summary data structure information, for example, the entity class summary data structure information of volume resources includes a sum of total capacities of all volume resources, a sum of used capacities of all volume resources, and the number of all volumes.
For example, the Map structure of the volume resource includes a plurality of resource objects for each storage resource, such as volume 1, volume 2, volume 3, etc. Then, the ID of volume 1 is 1, and the Value includes the name, type, total capacity, used capacity, mapped host ID, belonging storage pool ID, etc. of the volume of volume 1 resource.
Acquiring view class data structure information defined for each command input line, wherein the view class data structure information is matched with the entity class data structure information;
specifically, the view type data structure information defined for each command input line is acquired, and since the view type data structure information is derived from the entity type data structure information, the view type data structure information and the entity type data structure information are matched.
And acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
For example, still using the above example, according to the command key information, the total capacity of the storage pool is to be obtained, the total capacity of the storage pool is formed by the sum of all RAID capacities in the storage pool, and the sum of all RAID capacities is the summary data structure information of RAID, and the used capacity of the storage pool is formed by the sum of used capacities of all volumes in the storage pool. The sum of the used capacity of all the volumes is the summarized data structure information of the volumes, so the view type data structure information is derived from the entity type data structure information corresponding to the view type data structure information. It should be further explained that RAID in the entity type data structure information refers to a disk array, and a volume refers to a storage area on a hard disk.
If the command key information is to obtain the total volume of the volume, since the volume itself belongs to the bottommost data, and the total volume of the volume is specified when the volume is created, this value is fixed and unchanged, so it is only necessary to obtain the entity class data structure information directly according to the view class data structure information corresponding to the command key information, and it needs to be further explained here that the two pieces of command key information, namely the volume and the total volume, are defined in the view class data structure information, so although it is equivalent to directly calling the entity class data structure information through the command key information without any calculation, it still needs to pass through the view class data structure information first, because the command key information needs to be identified through the view class data structure information.
Through the operation, the entity class data structure information is obtained according to the obtained view class data structure information, and the obtaining of the entity class data structure information in the memory is realized.
In one embodiment, the executing the command instruction configures entity class data structure information, where the view class data structure information is configured correspondingly, and includes:
the command instruction comprises a query command instruction and a configuration command instruction; and when the command instruction is a query command instruction, executing the command instruction, and querying the entity type data structure information and/or the view type data structure information.
Here, the configuration-class command instruction refers to a command instruction of addition and deletion. And when the command instruction is a query command instruction, executing the command instruction, and realizing query operation on the entity class data structure information and the view class data structure information through corresponding matching of the entity class data structure information and the view class data structure information.
When the command instruction is a configuration command instruction, analyzing the configuration command instruction to obtain modified keyword information;
here, if the command is a configuration command, the configuration command needs to be analyzed first to obtain the modification keyword information.
And executing the command instruction, and modifying the entity type data structure information according to the modifying key word information, wherein the view type data structure information is modified correspondingly.
And executing the command instruction, and modifying the entity class data structure information according to the modified keyword information obtained by analysis, wherein the data related to the view class data structure information is modified accordingly.
And the configuration operation of the entity type data structure information and the view type data structure information is realized by operating the two different types of command instructions.
In one embodiment, the step of modifying the entity-class data structure information according to the modification key information by the command executing instruction, and the step of modifying the view-class data structure information correspondingly includes:
and setting a mutual exclusion lock for the entity class data structure information. Specifically, the reason why the mutex lock is set is to prevent the situation that the final data is inconsistent due to the simultaneous execution of multiple threads, for example, two workers input a command instruction and execute at the same time, and the server does not know which thread is to be executed first, and if both threads are executed, the situation that the data is inconsistent is caused.
Executing the command instruction, and modifying the entity data structure information according to the modifying key word information;
specifically, after the mutual exclusion lock is set, the mutual interference condition does not exist, and the entity data structure can be directly modified according to the modification keyword information.
And unlocking the entity type data structure information, and outputting the modified entity type data structure information.
And after the entity data structure information is modified, unlocking the entity data structure information, and finally outputting the modified entity data structure information.
Through the operation of the mutual exclusion lock, the situation that data are inconsistent due to the fact that a plurality of threads are executed simultaneously can be prevented.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 3, there is provided a fast response apparatus for a command line, including: a first obtaining module 302, a second obtaining module 304, a third obtaining module 306, an executing module 308, and an outputting module 310, wherein:
a first obtaining module 302, configured to obtain a command instruction input by a user on a command line interface, and analyze the command instruction to obtain command keyword information;
a second obtaining module 304, configured to obtain, according to the command keyword information, view type data structure information corresponding to the command keyword information;
a third obtaining module 306, configured to obtain, according to the view class data structure information, entity class data structure information corresponding to the view class data structure information;
the execution module 308 is configured to execute the command instruction, configure the entity class data structure information, and configure the view class data structure information correspondingly;
and the output module 310 is configured to output the entity class data structure information and/or the view class data structure information after the configuration is completed.
In an embodiment, the second obtaining module 304 is further specifically configured to:
acquiring view class data structure information defined for each command input line, the view class data structure information including all command keyword information corresponding to each command input line;
and acquiring view type data structure information corresponding to the command keyword information according to the command keyword information.
In an embodiment, the third obtaining module 306 is further specifically configured to:
acquiring entity class data structure information defined for each storage resource in the storage equipment;
acquiring view class data structure information defined for each command input line, wherein the view class data structure information is matched with the entity class data structure information;
and acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
In an embodiment, the execution module 308 is further specifically configured to:
the command instruction comprises a query command instruction and a configuration command instruction;
when the command instruction is a query command instruction, executing the command instruction, and querying the entity data structure information and/or the view data structure information;
when the command instruction is a configuration command instruction, analyzing the configuration command instruction to obtain modified keyword information;
and executing the command instruction, and modifying the entity type data structure information according to the modifying key word information, wherein the view type data structure information is modified correspondingly.
In an embodiment, before the step of executing the command instruction, modifying the entity class data structure information according to the modification key information, and modifying the view class data structure information correspondingly, the apparatus further includes:
setting a mutual exclusion lock for the entity class data structure information;
executing the command instruction, and modifying the entity data structure information according to the modifying key word information;
unlocking entity class data structure information;
and outputting the modified entity class data structure information.
In one embodiment, the entity class data structure information in the device includes entity class summary data structure information and Map structure information; the entity class summary data structure information comprises summary data information of each resource object in each storage resource; the Map structure information includes an ID of each resource object and entity class object data information corresponding to each ID; the entity class data structure information is stored in the memory.
In one embodiment, the data of the view class data structure information in the device is calculated by data matched with the entity class data structure information; the entity class data structure information refers to data information specified when the entity class data structure is created.
For the specific definition of the fast response means of a command line, reference may be made to the above definition of the fast response method of a command line, which is not described herein again. The various modules in the command line rapid response apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a fast response method for a command line. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information;
acquiring view type data structure information corresponding to the command keyword information according to the command keyword information;
acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured;
and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
In one embodiment, when the processor executes the computer program to implement the above step of obtaining the view type data structure information corresponding to the command keyword information according to the command keyword information, the following steps are specifically implemented:
acquiring view class data structure information defined for each command input line, the view class data structure information including all command keyword information corresponding to each command input line;
and acquiring view type data structure information corresponding to the command keyword information according to the command keyword information.
In an embodiment, executing a computer program on a processor to implement the above-mentioned obtaining entity class data structure information corresponding to the view class data structure information according to the view class data structure information specifically implements the following steps:
acquiring entity class data structure information defined for each storage resource in the storage equipment;
acquiring view class data structure information defined for each command input line, wherein the view class data structure information is matched with the entity class data structure information;
and acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
In an embodiment, the processor executes a computer program to implement the above-mentioned command execution instruction, and configures the entity class data structure information, and the view class data structure information is configured correspondingly, and specifically implements the following steps:
the command instruction comprises a query command instruction and a configuration command instruction;
when the command instruction is a query command instruction, executing the command instruction, and querying the entity data structure information and/or the view data structure information;
when the command instruction is a configuration command instruction, analyzing the configuration command instruction to obtain modified keyword information;
and executing the command instruction, and modifying the entity type data structure information according to the modifying key word information, wherein the view type data structure information is modified correspondingly.
In an embodiment, before the step of implementing the above-mentioned command execution instruction by executing a computer program by a processor, modifying the entity class data structure information according to the modification key information, and modifying the view class data structure information correspondingly, the following steps are implemented:
setting a mutual exclusion lock for the entity class data structure information;
executing the command instruction, and modifying the entity data structure information according to the modifying key word information;
unlocking entity class data structure information;
and outputting the modified entity class data structure information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
the entity data structure information comprises entity summarized data structure information and Map structure information; the entity class summary data structure information comprises summary data information of each resource object in each storage resource; the Map structure information includes an ID of each resource object and entity class object data information corresponding to each ID; the entity class data structure information is stored in the memory.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
the data of the view type data structure information is calculated by data matched with the entity type data structure information; the entity class data structure information refers to data information specified when the entity class data structure is created.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a command instruction input by a user on a command line interface, and analyzing the command instruction to obtain command keyword information;
acquiring view type data structure information corresponding to the command keyword information according to the command keyword information;
acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information;
executing the command instruction, and configuring the entity class data structure information, wherein the view class data structure information is correspondingly configured;
and outputting the entity class data structure information and/or the view class data structure information after the configuration is finished.
In one embodiment, when the computer program is executed by the processor to perform the above step of obtaining the view type data structure information corresponding to the command keyword information according to the command keyword information, the following steps are specifically implemented:
acquiring view class data structure information defined for each command input line, the view class data structure information including all command keyword information corresponding to each command input line;
and acquiring view type data structure information corresponding to the command keyword information according to the command keyword information.
In an embodiment, when the computer program is executed by the processor to execute the above-mentioned method for obtaining the entity class data structure information corresponding to the view class data structure information according to the view class data structure information, the following steps are implemented:
acquiring entity class data structure information defined for each storage resource in the storage equipment;
acquiring view class data structure information defined for each command input line, wherein the view class data structure information is matched with the entity class data structure information;
and acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information.
In an embodiment, when the computer program is executed by the processor to execute the above-mentioned instruction for executing the command, the entity class data structure information is configured, and the view class data structure information is configured correspondingly, the following steps are specifically implemented:
the command instruction comprises a query command instruction and a configuration command instruction;
when the command instruction is a query command instruction, executing the command instruction, and querying the entity data structure information and/or the view data structure information;
when the command instruction is a configuration command instruction, analyzing the configuration command instruction to obtain modified keyword information;
and executing the command instruction, and modifying the entity type data structure information according to the modifying key word information, wherein the view type data structure information is modified correspondingly.
In an embodiment, before the computer program is executed by the processor to execute the above instruction for executing the command, and the step of modifying the entity class data structure information according to the modification key information and the step of modifying the view class data structure information correspondingly, the following steps are specifically implemented:
setting a mutual exclusion lock for the entity class data structure information;
executing the command instruction, and modifying the entity data structure information according to the modifying key word information;
unlocking entity class data structure information;
and outputting the modified entity class data structure information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
the entity data structure information comprises entity summarized data structure information and Map structure information; the entity class summary data structure information comprises summary data information of each resource object in each storage resource; the Map structure information includes an ID of each resource object and entity class object data information corresponding to each ID; the entity class data structure information is stored in the memory.
In one embodiment, the computer program when executed by the processor further performs the steps of:
the data of the view type data structure information is calculated by data matched with the entity type data structure information; the entity class data structure information refers to data information specified when the entity class data structure is created.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1.一种命令行的快速响应方法,所述方法包括:1. A quick response method for a command line, the method comprising: 获取用户在命令行界面输入的命令指令,对所述命令指令进行解析得到命令关键字信息;Obtain the command instruction input by the user on the command line interface, and parse the command instruction to obtain command keyword information; 根据所述命令关键字信息,获取对应于所述命令关键字信息的视图类数据结构信息;According to the command keyword information, obtain view class data structure information corresponding to the command keyword information; 根据所述视图类数据结构信息,获取对应于所述视图类数据结构信息的实体类数据结构信息;According to the view class data structure information, obtain entity class data structure information corresponding to the view class data structure information; 执行所述命令指令,对所述实体类数据结构信息进行配置,所述视图类数据结构信息对应配置;Execute the command instruction to configure the entity class data structure information, and the view class data structure information corresponds to the configuration; 输出配置完成后的实体类数据结构信息和/或视图类数据结构信息。Output the entity class data structure information and/or view class data structure information after the configuration is completed. 2.根据权利要求1所述的方法,其特征在于,所述根据所述命令关键字信息,获取对应于所述命令关键字信息的视图类数据结构信息,包括:2 . The method according to claim 1 , wherein the obtaining, according to the command keyword information, the view class data structure information corresponding to the command keyword information comprises: 2 . 获取为每个所述命令输入行定义的视图类数据结构信息,所述视图类数据结构信息包括对应于每个所述命令输入行的所有命令关键字信息;acquiring view class data structure information defined for each of the command input lines, the view class data structure information including all command keyword information corresponding to each of the command input lines; 根据所述命令关键字信息,获取对应于所述命令关键字信息的视图类数据结构信息。According to the command keyword information, the view class data structure information corresponding to the command keyword information is acquired. 3.根据权利要求2所述的方法,其特征在于,所述根据所述视图类数据结构信息,获取对应于所述视图类数据结构信息的实体类数据结构信息,包括:3 . The method according to claim 2 , wherein the acquiring entity class data structure information corresponding to the view class data structure information according to the view class data structure information comprises: 3 . 获取存储设备中为每种存储资源定义的实体类数据结构信息;Obtain the entity class data structure information defined for each storage resource in the storage device; 获取为每个所述命令输入行定义的视图类数据结构信息,所述视图类数据结构信息和所述实体类数据结构信息相匹配;Acquire the view class data structure information defined for each of the command input lines, where the view class data structure information matches the entity class data structure information; 根据所述视图类数据结构信息,获取对应于所述视图类数据结构信息的实体类数据结构信息。Obtain entity class data structure information corresponding to the view class data structure information according to the view class data structure information. 4.根据权利要求1所述的方法,其特征在于,所述执行所述命令指令,对所述实体类数据结构信息进行配置,所述视图类数据结构信息对应配置,包括:4 . The method according to claim 1 , wherein the executing the command instruction configures the entity class data structure information, and the corresponding configuration of the view class data structure information comprises: 4 . 所述命令指令包括查询类命令指令和配置类命令指令;The command instructions include query-type command instructions and configuration-type command instructions; 在所述命令指令为查询类命令指令时,执行所述命令指令,对所述实体类数据结构信息和/或视图类数据结构信息进行查询;When the command instruction is a query-type command instruction, execute the command instruction to query the entity-type data structure information and/or the view-type data structure information; 在所述命令指令为配置类命令指令时,解析所述配置类命令指令,得到修改关键字信息;When the command instruction is a configuration-type command instruction, parse the configuration-type command instruction to obtain modification keyword information; 执行所述命令指令,根据所述修改关键字信息对所述实体类数据结构信息进行修改,所述视图类数据结构信息对应修改。The command instruction is executed, and the entity class data structure information is modified according to the modification keyword information, and the view class data structure information is modified accordingly. 5.根据权利要求4所述的方法,其特征在于,所述执行所述命令指令,根据所述修改关键字信息对所述实体类数据结构信息进行修改,所述视图类数据结构信息对应修改的步骤之前,还包括:5 . The method according to claim 4 , wherein, by executing the command instruction, the entity class data structure information is modified according to the modification keyword information, and the view class data structure information is correspondingly modified. 6 . Before the steps, also include: 给所述实体类数据结构信息设置互斥锁;set a mutual exclusion lock for the entity class data structure information; 执行所述命令指令,根据所述修改关键字信息对所述实体类数据结构信息进行修改;Execute the command instruction, and modify the entity class data structure information according to the modification keyword information; 将所述实体类数据结构信息解锁;unlocking the entity class data structure information; 将修改完成后的实体类数据结构信息输出。Output the modified entity class data structure information. 6.根据权利要求1至5任意一项所述的方法,其特征在于,所述实体类数据结构信息包括实体类汇总数据结构信息和Map结构信息;所述实体类汇总数据结构信息包括每种存储资源中的每个资源对象的汇总数据信息;所述Map结构信息包括每个资源对象的ID和对应于每个ID的实体类对象数据信息;所述实体类数据结构信息均储存于内存中。6. The method according to any one of claims 1 to 5, wherein the entity class data structure information includes entity class summary data structure information and Map structure information; the entity class summary data structure information includes each The summary data information of each resource object in the storage resource; the Map structure information includes the ID of each resource object and the entity class object data information corresponding to each ID; the entity class data structure information is stored in the memory . 7.根据权利要求1至5任意一项所述的方法,其特征在于,所述视图类数据结构信息的数据是指由匹配于所述实体类数据结构信息的数据计算得到的;所述实体类数据结构信息是指在创建实体类数据结构时指定的数据信息。7. The method according to any one of claims 1 to 5, wherein the data of the view class data structure information is calculated from the data matching the entity class data structure information; the entity class The class data structure information refers to the data information specified when the entity class data structure is created. 8.一种命令行的快速响应装置,其特征在于,所述装置包括:8. A device for quick response to a command line, wherein the device comprises: 第一获取模块,用于获取用户在命令行界面输入的命令指令,对所述命令指令进行解析得到命令关键字信息;The first obtaining module is used to obtain the command instruction input by the user in the command line interface, and parse the command instruction to obtain command keyword information; 第二获取模块,用于根据所述命令关键字信息,获取对应于所述命令关键字信息的视图类数据结构信息;a second obtaining module, configured to obtain view class data structure information corresponding to the command keyword information according to the command keyword information; 第三获取模块,用于根据所述视图类数据结构信息,获取对应于所述视图类数据结构信息的实体类数据结构信息;a third obtaining module, configured to obtain entity class data structure information corresponding to the view class data structure information according to the view class data structure information; 执行模块,用于执行所述命令指令,对所述实体类数据结构信息进行配置,所述视图类数据结构信息对应配置;an execution module, configured to execute the command instruction, configure the entity class data structure information, and the view class data structure information corresponds to the configuration; 输出模块,用于输出配置完成后的实体类数据结构信息和/或视图类数据结构信息。The output module is used to output the entity class data structure information and/or the view class data structure information after the configuration is completed. 9.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述方法的步骤。9. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements any of claims 1 to 7 when the processor executes the computer program. A step of the method. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。10. A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
CN202111128939.2A 2021-09-26 2021-09-26 A command line quick response method, device and computer equipment Active CN113867975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111128939.2A CN113867975B (en) 2021-09-26 2021-09-26 A command line quick response method, device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111128939.2A CN113867975B (en) 2021-09-26 2021-09-26 A command line quick response method, device and computer equipment

Publications (2)

Publication Number Publication Date
CN113867975A true CN113867975A (en) 2021-12-31
CN113867975B CN113867975B (en) 2023-11-17

Family

ID=78994482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111128939.2A Active CN113867975B (en) 2021-09-26 2021-09-26 A command line quick response method, device and computer equipment

Country Status (1)

Country Link
CN (1) CN113867975B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1695397A (en) * 2002-11-08 2005-11-09 诺基亚有限公司 Method, terminal device and system allowing location services to be handled independently of a cellular communication system
US20080319957A1 (en) * 2007-06-19 2008-12-25 Microsoft Corporation Extensible command trees for entity data model platform
CN102902547A (en) * 2012-10-18 2013-01-30 上海师范大学 Command construction and analysis method of command line interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1695397A (en) * 2002-11-08 2005-11-09 诺基亚有限公司 Method, terminal device and system allowing location services to be handled independently of a cellular communication system
US20080319957A1 (en) * 2007-06-19 2008-12-25 Microsoft Corporation Extensible command trees for entity data model platform
CN102902547A (en) * 2012-10-18 2013-01-30 上海师范大学 Command construction and analysis method of command line interface

Also Published As

Publication number Publication date
CN113867975B (en) 2023-11-17

Similar Documents

Publication Publication Date Title
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN108563694B (en) SQL execution method and device for logic deletion, computer equipment and storage medium
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
US9003231B1 (en) System for instantiating service instances for testing in a known state
CN111061475A (en) Software code generation method and device, computer equipment and storage medium
CN111597422B (en) Buried point mapping method, device, computer equipment and storage medium
US9646048B2 (en) Declarative partitioning for data collection queries
CN109542962B (en) Data processing method, data processing device, computer equipment and storage medium
JP2022041859A5 (en)
CN114168533B (en) Snapshot query method and device, computer equipment and storage medium
WO2023193509A1 (en) Engineering machinery equipment modeling method and apparatus
CN113867975A (en) Method, device and computer equipment for quick response to command line
US11687490B2 (en) Management of contextual information for data
WO2021121130A1 (en) Method and apparatus for information collection, computer device, and storage medium
US20240256606A1 (en) Systems and methods for in-situ graph-based data processing
CN115061866A (en) Simulation data generation method and system and computer equipment
CN115437873A (en) Cluster resource management method and device and computer equipment
US10423578B2 (en) Management of contextual information for data
US12481782B2 (en) Data splintering in graph-based models
US12386899B2 (en) Systems and methods for contracts in graph-based models
CN112287428A (en) Building wall generation method and device, computer equipment and storage medium
US12287830B2 (en) In-situ tenancy in graph-based models
CN114546986B (en) Database architecture determining method and device
CN120929082B (en) Methods, apparatus, devices, and media for dynamically configuring window controls and layouts
CN114661301B (en) Graphics processing unit compiling method, device, compiling acceleration library 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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 215168 Jiangsu Province, Suzhou City, Wuzhong Economic Development Zone, Guoqiang Street, Guanpu Road No. 1, Building 9

Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: 215168 Jiangsu Province, Suzhou City, Wuzhong Economic Development Zone, Guoqiang Street, Guanpu Road No. 1, Building 9

Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China