Command management method and device based on tool set, equipment and storage medium

Through the tool set-based command management method, the tool set-based command management method is parsed and managed, and the problems of numerous tools and high usage costs caused by different tool development languages ​​and habits are solved, and tool integration and cost reduction are achieved.

CN119512554APending Publication Date: 2025-02-25BEIJING JUEYING INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411215805.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the fields of autonomous driving and computer vision, the development language and habits of tools are different, resulting in a wide variety of tools, increasing the cost of using and learning tools.

Method used

Provides a tool set-based command management method, which can obtain input content and tool data structures of the tool set in the command line interface, parse content to be parsed, identify management commands, and perform command management on the tool set.

Benefits of technology

Through the unified management method of the tool set, we hide the differences in the development languages ​​of different tool, reduce the cost of tool access, quickly add tools to the tool set, realize the integration of different tools, and reduce the cost of using and learning of tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512554A_ABST
    Figure CN119512554A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a command management method and device based on a tool set, equipment and a storage medium, and the method comprises the steps: obtaining to-be-analyzed content input in a command line interface and a tool data structure corresponding to the tool set; the tool data structure comprises attribute information of each command in the tool set; based on the attribute information of each command in the tool set, analyzing the to-be-analyzed content to obtain an analysis result; and under the condition that the analysis result represents that the to-be-analyzed content is the management command in the tool set, performing command management on the tool set based on the management command corresponding to the to-be-analyzed content. Therefore, the abstract tool definition can be realized, the development language difference of different tools can be hidden, the integration of different tools can be realized, and the tool use and learning cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of tool integration, and in particular to a command management method, apparatus, device and storage medium based on a toolset. Background Art

[0002] Each R&D direction in the R&D field will have tool requirements. For example, in the fields of autonomous driving and computer vision, the tools of the development platform can achieve standardized and efficient development of related software and hardware engineering. Tools can achieve specific functions. Tools are generally managed and maintained separately by developers of each production line. Due to the different development languages ​​and habits of each tool, when there are many tools, users need to learn more knowledge to understand the use of each tool and adapt to the different usage habits of each tool. This increases the cost of using and learning the tools. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure at least provide a command management method, apparatus, device and storage medium based on a toolset.

[0004] The technical solution of the embodiment of the present disclosure is implemented as follows:

[0005] On the one hand, an embodiment of the present disclosure provides a command management method based on a toolset, the method comprising: obtaining content to be parsed input in a command line interface and a tool data structure corresponding to a toolset; the tool data structure comprising attribute information of each command in the toolset; parsing the content to be parsed based on the attribute information of each command in the toolset to obtain a parsing result; when the parsing result indicates that the content to be parsed is a management command in the toolset, command management of the toolset is performed based on the management command corresponding to the content to be parsed.

[0006] In the embodiment of the present disclosure, the input content to be parsed in the command line interface is parsed based on the tool data structure corresponding to the toolset to obtain a parsing result; when the parsing result indicates that the content to be parsed is a management command in the toolset, command management is performed on the toolset based on the management command corresponding to the content to be parsed. In this way, the tool data structure corresponding to the toolset is used to implement abstract tool definition, hide the differences in development languages ​​of different tools, and users can use a unified toolset usage method to input content in the command line interface, perform command management such as adding commands and deleting commands on the toolset, reduce tool access costs, quickly add a tool to the toolset, implement tool integration of different tools, and reduce tool usage and learning costs.

[0007] On the other hand, an embodiment of the present disclosure provides a command management device based on a toolset, the device comprising: an acquisition module, used to acquire the content to be parsed input in the command line interface and a tool data structure corresponding to the toolset; the tool data structure comprises attribute information of each command in the toolset; a parsing module, used to parse the content to be parsed based on the attribute information of each command in the toolset to obtain a parsing result; and a management module, used to perform command management on the toolset based on the management command corresponding to the content to be parsed when the parsing result indicates that the content to be parsed is a management command in the toolset.

[0008] On the other hand, an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0009] On the other hand, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements part or all of the steps in the above method when executed by a processor.

[0010] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0012] Figure 1 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 1 ;

[0013] Figure 2 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 2 ;

[0014] Figure 3 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 3 ;

[0015] Figure 4 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 4 ;

[0016] Figure 5 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 5 ;

[0017] Figure 6 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 6 ;

[0018] Figure 7 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 7 ;

[0019] Figure 8 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 8 ;

[0020] Fig. 9 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 9 ;

[0021] Fig.10 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 10 ;

[0022] Fig.11 A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 10 one;

[0023] Fig.12 A tree structure diagram provided for an embodiment of the present disclosure;

[0024] Fig.13 A schematic diagram of the composition structure of a command management device based on a toolset provided in an embodiment of the present disclosure;

[0025] Fig.14 A hardware entity schematic diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0027] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the present disclosure and are not intended to limit the present disclosure.

[0029] The embodiment of the present disclosure provides a command management method based on a toolset, which can be executed by a processor of a computer device, wherein the computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device) and other devices with data processing capabilities.

[0030] Each R&D direction of autonomous driving will have tool requirements, and the tools are maintained by developers of each production line. Due to the different development languages ​​and habits of each tool, when there are many tools, users need to learn more knowledge to understand the use of each tool and adapt to the different usage habits of each tool, which will increase the cost of using and learning the tools.

[0031] The disclosed embodiment provides a command management method based on a toolset, which obtains the input content to be parsed in the command line interface and the tool data structure corresponding to the toolset; the tool data structure includes the attribute information of each command in the toolset; the content to be parsed is parsed based on the attribute information of each command in the toolset to obtain the parsing result; when the parsing result indicates that the content to be parsed is a management command in the toolset, the toolset is managed based on the management command corresponding to the content to be parsed. In this way, the abstract tool definition is realized through the tool data structure corresponding to the toolset, and the differences in the development languages ​​of different tools are hidden. The user can use a unified toolset usage method, input content in the command line interface, and manage commands such as adding commands and deleting commands to the toolset, thereby reducing the tool access cost, quickly adding a tool to the toolset, realizing tool integration of different tools, and reducing the cost of using and learning the tools.

[0032] Figure 1A schematic diagram of an implementation process of a command management method based on a tool set provided in an embodiment of the present disclosure Figure 1 ,like Figure 1 As shown, the method includes the following steps S101 to S103:

[0033] Step S101: Obtain the input content to be parsed in the command line interface and the tool data structure corresponding to the tool set; the tool data structure includes attribute information of each command in the tool set.

[0034] Among them, the tool set is a system that integrates multiple tools and is used to implement the command management function of multiple tools. The tool is a command running in an operating system (for example, a Linux operating system) and is used to implement data processing. Exemplarily, the tool includes a tool for viewing the performance of the central processing unit (CPU) and a tool for capturing statistical data. The function of viewing the CPU performance is realized by executing the command for viewing the CPU performance, and the function of capturing statistical data is realized by executing the command for capturing statistical data.

[0035] There are multiple commands in the toolset, which can be divided into management commands and custom commands. Management commands are a type of public commands in the toolset, used to implement command management for the toolset. Management commands include adding commands, deleting commands, adding parameters, deleting parameters, and displaying structures. Custom commands are commands defined by users based on functional requirements and added to the toolset.

[0036] The tool data structure is a preset data structure used to determine the command object and parameter object in the command. The tool data structure includes the attribute information of each command in the tool set. Exemplarily, the attribute information of the command includes the command object and the parameter object corresponding to the command object. The command object is used to represent the name of the command, and the parameter object is used to represent the parameter name and parameter value.

[0037] The format of the tool data structure can be JSON (JavaScript Object Notation) or other formats, such as YAML (Ain't a Markup Language), XML (eXtensible Markup Language). The command content contained in the tool data structure in different formats is consistent, but the expression form is different. For example, the JSON format defines the tool data structure through brackets and key-value pairs, and the XML format defines the tool data structure through tags and attributes.

[0038] Among them, the command line interface is the user operation interface corresponding to the toolset, which is used to input commands, output results and display information.

[0039] The content to be parsed is the content input in the command line interface, that is, the input command.

[0040] In some embodiments, in order to solve the problem that different tools have different development languages ​​and habits, resulting in high tool usage and learning costs when there are many tools, a tool set needs to be developed to manage the commands of the tool set. In this way, the commands of different tools are integrated together through the tool set, which can reduce the tool usage and learning costs.

[0041] In some embodiments, when performing command management on a toolset, it is first necessary to obtain the content to be parsed input in the command line interface and the tool data structure corresponding to the toolset. After obtaining the content to be parsed and the tool data structure, the content to be parsed can be parsed based on the tool data structure.

[0042] Exemplarily, the input content to be parsed in the command line interface is "test-aa", and the attribute information of the command includes a command object and a parameter object corresponding to the command object.

[0043] Step S102: Parse the content to be parsed based on the attribute information of each command in the tool set to obtain a parsing result.

[0044] Among them, after obtaining the content to be analyzed, it is necessary to parse the content to be analyzed based on the attribute information of each command in the tool set to obtain the analysis result.

[0045] The parsing result represents the command type corresponding to the content to be parsed, and the command type includes management commands and custom commands.

[0046] In some embodiments, the tool data structure includes a command object, a parameter object corresponding to the command object, and a legality requirement corresponding to the parameter object. After obtaining the content to be parsed, the content to be parsed is divided into sub-contents to obtain an array to be parsed; based on a preset parameter object prefix, the sub-contents in the array to be parsed are distinguished in order to determine the discrimination result of the sub-content; the discrimination result is used to determine whether the sub-content is a command object or a parameter object; if the parameter object meets the legality requirement, the parsing result is generated based on the obtained command object and parameter object.

[0047] In some embodiments, based on a preset parameter object prefix, the parameter name in the array to be parsed is identified, and the sub-content in the array to be parsed is divided, the sub-content before the parameter name in the array to be parsed is determined as a command object, and the sub-content after the parameter name in the array to be parsed is determined as a parameter object; the combination of the command object and the parameter object is taken as the parsing result.

[0048] In some embodiments, after obtaining the parsing results, the command object in the content to be parsed can be determined, and the command object in the content to be parsed can be compared with the command objects of each command in the toolset to obtain the command type corresponding to the content to be parsed, such as adding a command, deleting a command, etc.

[0049] Step S103: When the analysis result indicates that the content to be analyzed is a management command in the tool set, command management is performed on the tool set based on the management command corresponding to the content to be analyzed.

[0050] Management commands are a type of public commands in the toolset, used to implement command management for the toolset. Management commands include add command, delete command, add parameter, delete parameter, and display structure. Add command is used to add custom commands to the toolset, delete command is used to delete custom commands from the toolset, add parameter is used to add corresponding parameter objects for custom commands, delete parameter is used to delete corresponding parameter objects for custom commands, and display structure is used to display all commands in the toolset.

[0051] In some embodiments, after obtaining the parsing result, it is necessary to determine whether to perform command management on the toolset based on the parsing result. If the parsing result indicates that the content to be parsed is a management command in the toolset, command management is performed on the toolset based on the management command corresponding to the content to be parsed. If the parsing result indicates that the content to be parsed is not a management command, command management is not performed.

[0052] In some embodiments, the management command includes an add command. When the parsing result indicates that the content to be parsed is an add command, the add command is executed based on the tool data structure corresponding to the toolset.

[0053] In some embodiments, the management command includes a delete command. When the parsing result indicates that the content to be parsed is a delete command, the command object corresponding to the serial number is deleted from the custom command based on the deleted serial number.

[0054] In some embodiments, the management command includes a display structure, and when the parsing result indicates that the content to be parsed is a display structure, all command objects are displayed in a tree structure.

[0055] Exemplarily, the content to be parsed input in the command line interface is "del_commands", and the parsing result indicates that the content to be parsed is a delete command in the toolset, and a delete command operation is performed on the toolset.

[0056] In the embodiment of the present disclosure, the input content to be parsed in the command line interface and the tool data structure corresponding to the toolset are obtained; the tool data structure includes the attribute information of each command in the toolset; the content to be parsed is parsed based on the attribute information of each command in the toolset to obtain the parsing result; when the parsing result indicates that the content to be parsed is a management command in the toolset, the toolset is managed based on the management command corresponding to the content to be parsed. In this way, the abstract tool definition is realized through the tool data structure corresponding to the toolset, and the differences in the development languages ​​of different tools are hidden. The user can use a unified toolset usage method, input content in the command line interface, and manage commands such as adding commands and deleting commands to the toolset, thereby reducing the tool access cost, quickly adding a tool to the toolset, realizing tool integration of different tools, and reducing the cost of using and learning the tools.

[0057] Figure 2 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 2 , the method can be executed by a processor of a computer device. Figure 1 , the attribute information of the command includes a command object, a parameter object corresponding to the command object, and a legality requirement corresponding to the parameter object; Figure 1 S102 in can be updated to S201 to S203, which will be combined Figure 2 The steps shown are explained.

[0058] Step S201: Divide the content to be parsed into sub-contents to obtain an array to be parsed.

[0059] The array to be parsed is an array containing at least one sub-content, and each sub-content is a part of the content to be parsed. The array to be parsed is used to divide the content to be parsed.

[0060] In some embodiments, the data to be parsed input in the command line interface is in the form of a string, and the input string data needs to be converted into an array form, and each sub-content in the array to be parsed is judged to obtain a parsing result.

[0061] Among them, in the content to be parsed, different sub-contents are separated by spaces. Therefore, the spaces in the content to be parsed entered in the command line interface can be identified, and the content between two adjacent spaces can be used as sub-content, and then the content to be parsed can be divided into sub-contents to obtain an array to be parsed.

[0062] Exemplarily, the content to be parsed is "test-aa", which contains two spaces. Therefore, based on the two spaces, "test-aa" is divided into three sub-contents "test", "-a", and "a", and the array to be parsed is [test, -a, a].

[0063] In some embodiments, when the array to be parsed is empty, or the number of sub-contents in the array to be parsed (array length) is 0, the parsing process is stopped.

[0064] Among them, when the array to be parsed is empty, or the number of sub-contents in the array to be parsed (array length) is 0, no content to be parsed is input in the command line interface, so there is no need to parse the content to be parsed, and the parsing process is stopped at this time.

[0065] Step S202: based on a preset parameter object prefix, the sub-contents in the array to be parsed are sequentially identified to determine the identification result of the sub-contents; the identification result is used to determine whether the sub-content is a command object or a parameter object.

[0066] The parameter object prefix is ​​the “-” sign before the parameter object, which is used to determine the position of the parameter object.

[0067] The command object is the name of the command in the data to be parsed, and the parameter object is the parameter name and parameter value in the data to be parsed.

[0068] In some embodiments, the format of the content to be parsed is preset as "main command name sub-command name-parameter name parameter value". The index of the first sub-content in the array to be parsed is 0, and the index of the second sub-content is 1. The prefix of each sub-content in the array to be parsed is identified as "-" in the order of the indexes to determine whether each sub-content is a command object or a parameter object.

[0069] When it is identified that the prefix of a sub-content is "-", the remaining sub-contents before the sub-content are determined as command objects, and the sub-content and the sub-contents after the sub-content are determined as parameter objects.

[0070] Exemplarily, the array to be parsed is [test-a a], and each sub-content in the array to be parsed is identified according to the index order of the array, and it is determined that the prefix of the second sub-content is "-". Therefore, "test" is determined as a command object, and "-a" and "a" are determined as parameter objects.

[0071] Step S203: When the parameter object meets the legality requirement, generate the parsing result based on the obtained command object and parameter object.

[0072] The legality requirement refers to whether the parameter object input in the command line interface meets the requirements of the parameter object corresponding to the command object.

[0073] In some embodiments, the parameter object includes a parameter name, and the command object is configured with a preset parameter list. When the parameter name does not belong to the parameter list, the parameter name entered in the command line interface does not meet the requirements, and therefore the parameter object does not meet the legality requirements.

[0074] In some embodiments, the command object is configured with a required parameter name. When the required parameter name does not belong to the parameter object, the required parameter is not entered, and thus the parameter object does not meet the legality requirement.

[0075] In some embodiments, the parameter object includes a parameter value, and the command object is configured with an optional range of the parameter value. When the parameter value does not fall within the optional range, the parameter value entered in the command line interface does not meet the requirements, and thus the parameter object does not meet the legality requirements.

[0076] In the case where the parameter object meets the legality requirement, the content to be parsed inputted in the command line interface is legal. Therefore, in this case, a parsing result is generated based on the obtained command object and parameter object.

[0077] In some embodiments, the parsing result is represented in the form of a key-value pair, where the key represents the two fields of the command object and the parameter object, and the value represents the command object and the parameter object in the content to be parsed.

[0078] In some embodiments, in response to obtaining the parsing result, the parsed command object and parameter object are displayed through the command line interface.

[0079] For example, the content to be parsed is "test-aa", the content to be parsed is divided, and the array to be parsed is [test-a a]. The sub-content in the array to be parsed is identified, and "test" is determined as a command object, and "-a" and "a" are determined as parameter objects. The final display result is displayed in the command line interface in the form of key-value pairs, and the final display result is "command: test, commandArgs: [-aa]".

[0080] In the disclosed embodiment, the content to be parsed is divided into sub-contents to obtain an array to be parsed; based on a preset parameter object prefix, the sub-contents in the array to be parsed are distinguished in order to determine the discrimination result of the sub-contents; the discrimination result is used to determine whether the sub-content is a command object or a parameter object; when the parameter object meets the legality requirements, the parsing result is generated based on the obtained command object and parameter object. In this way, the command object and parameter object can be accurately parsed from the content to be parsed to obtain an accurate parsing result.

[0081] Figure 3 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 3, the method can be executed by a processor of a computer device. Figure 2 , the command object includes at least one level of command objects; Figure 2 S202 in can be updated to S301 to S302, which will be combined Figure 3 The steps shown are explained.

[0082] Step S301, sequentially obtain the sub-contents in the array to be parsed, and when it is determined based on a preset parameter object prefix that the first n sub-contents are all command objects, sequentially determine the first n sub-contents as command objects of the first to nth levels; n is a positive integer.

[0083] The command object has a corresponding hierarchy, and the hierarchy is used to determine the parent-child relationship between different command objects.

[0084] In some embodiments, a command object may have multiple different sub-command objects, and the functions implemented by the command object are divided, and different sub-command objects may implement different functions. Therefore, each command object has a corresponding level, and the parent-child relationship between related command objects is determined by the level. Exemplarily, command object A has corresponding sub-command objects B and C, and sub-command object B has a corresponding sub-command object D. Therefore, the level of command object A is set to 1, the levels of sub-command objects B and C are set to 2, and the level of sub-command object D is set to 3.

[0085] In some embodiments, the command object includes at least one level of command objects. When it is identified that the prefix of the n+1th sub-content in the array to be parsed is "-", the 1st to nth sub-contents are determined as command objects, and the n+1th sub-content and subsequent sub-contents are determined as parameter objects.

[0086] The format of the content to be parsed is preset as "main command name sub-command name 1 sub-command name 2 ... - parameter name parameter value", and there is a parent-child relationship between two adjacent command objects. Therefore, when the first n sub-contents are determined to be command objects based on the preset parameter object prefix, the level of the first sub-content can be obtained as 1, the level of the second sub-content is 2, and so on, and the first n sub-contents are determined as command objects of the first to nth levels in sequence; n is a positive integer.

[0087] Step S302: determine the remaining sub-contents as parameter objects of the command object at the nth level.

[0088] The format of the content to be parsed is "main command name sub-command name 1 sub-command name 2 ... - parameter name parameter value". After determining that the first n sub-contents in the array to be parsed are command objects of the nth level, the remaining sub-contents in the array to be parsed are parameter objects, so the remaining sub-contents are determined as parameter objects of the command object of the nth level.

[0089] In some embodiments, when the first sub-content is determined to be a parameter object based on a preset parameter object prefix, the parsing process is terminated. Wherein, when the first sub-content is a parameter object, there is no command object in the content to be parsed, so the content to be parsed does not meet the legality requirement, and the parsing process is terminated.

[0090] In some embodiments, when the first sub-content is determined to be a command object based on a preset parameter object prefix, the array to be parsed includes two sub-contents, and the second sub-content is a parameter object, the first sub-content is determined to be a command object, and the second sub-content is determined to be a parameter object corresponding to the command object.

[0091] In some embodiments, when the first sub-content and the second sub-content are determined to be command objects based on a preset parameter object prefix, and there are other sub-contents, the first sub-content is determined to be the main command object, the second sub-content is determined to be the sub-command object, and the other sub-contents are determined to be parameter objects corresponding to the sub-command objects.

[0092] In some embodiments, the method further includes: in response to obtaining the parsing result, displaying the command objects of the at least one level and the parameter objects of the command objects of the nth level through the command line interface.

[0093] The parsing result is represented in the form of a key-value pair, where the key represents each command object and parameter object, and the value represents at least one level of command objects and the parameter objects of the nth level of command objects in the content to be parsed.

[0094] For example, the array to be parsed is [test1 test2 test3–aa], the first three sub-contents in the array to be parsed are determined to be command objects, test1 is determined as the command object of the first level, test2 is determined as the command object of the second level, test3 is determined as the command object of the third level, and [-aa] is determined as the parameter object of test3. The parsing result is displayed in the command line interface in the form of key-value pairs, and the parsing result is "command: test1, subCommand1: test2, subCommand2: test3, commandArgs: [-aa]".

[0095] In the embodiment of the present disclosure, the sub-contents in the array to be parsed are obtained in sequence, and when the first n sub-contents are determined to be command objects based on the preset parameter object prefix, the first n sub-contents are determined to be command objects of the nth level in sequence; n is a positive integer; and the remaining sub-contents are determined to be parameter objects of the command objects of the nth level. In this way, command objects of different levels can be accurately parsed, and the accuracy of parsing can be improved.

[0096] Figure 4 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 4 , the method can be executed by a processor of a computer device. Figure 2 , the parameter object includes a parameter name and a parameter value; the method includes the following steps S401 to S402.

[0097] Step S401: group the parameter objects in the array to be parsed to obtain at least one parameter data.

[0098] The parameter data includes the parameter name and the corresponding parameter value.

[0099] The parameter object is an array. The parameter objects in the array to be parsed are grouped based on the parameter name prefix. The sub-contents in the parameter object that contain the parameter name prefix belong to the parameter name, and the sub-contents that do not contain the parameter name prefix belong to the parameter value.

[0100] In some embodiments, the parameter object in the array to be parsed includes two sub-contents, and the parameter objects in the array to be parsed are grouped to obtain a parameter name and a parameter value. Among them, the first sub-content contains the parameter name prefix "-", and the first sub-content is removed from the prefix "-" to obtain the parameter name; the second sub-content does not contain the parameter name prefix "-", and the second sub-content is the parameter value.

[0101] In some embodiments, the parameter object in the array to be parsed includes four sub-contents, and the parameter objects in the array to be parsed are grouped to obtain two parameter names and two parameter values. Among them, the first sub-content and the third sub-content contain the parameter name prefix "-", and the first sub-content and the third sub-content are removed from the prefix "-" to obtain two parameter names; the second sub-content and the fourth sub-content do not contain the parameter name prefix "-", and the second sub-content and the fourth sub-content are parameter values. The first sub-content and the second sub-content are one parameter data, and the third sub-content and the fourth sub-content are another parameter data.

[0102] In some embodiments, the parameter name and the parameter value are associated in the form of a key-value pair, where the key is the parameter name and the value is the corresponding parameter value.

[0103] For example, the parameter object is [-aa–bb], and the parameter object is grouped to obtain two parameter data. The first parameter data is {-a:a}, and the second parameter data is {-b:b}.

[0104] Step S402: Perform a validity check on each parameter data based on the validity condition corresponding to the command object to obtain a validity check result.

[0105] The validity condition refers to whether the parameter data input in the command line interface meets the requirements of the parameter data corresponding to the command object. Exemplarily, the validity condition includes the necessary parameters corresponding to the command object, the parameter list corresponding to the command object, and the valid range of the parameter value corresponding to each parameter name.

[0106] The validity check results include whether the parameter data is valid or not.

[0107] In some embodiments, the parameter data includes a parameter name, and a necessary parameter corresponding to the command object is obtained; based on the necessary parameter and the parameter name corresponding to the command object, a legality detection result is determined. If the necessary parameter belongs to the parameter name corresponding to the command object, the parameter data is determined to be legal; if the necessary parameter does not belong to the parameter name corresponding to the command object, the parameter data is determined to be illegal.

[0108] In some embodiments, the parameter data includes a parameter name and a corresponding parameter value, and a valid range of the parameter value corresponding to each parameter name is obtained; based on the valid range of the parameter value corresponding to each parameter name and the parameter value corresponding to each parameter name, a legality detection result is determined. If the parameter value corresponding to the parameter name is within the valid range of the parameter value corresponding to the parameter name, the parameter data is determined to be legal; if the parameter value corresponding to the parameter name is not within the valid range of the parameter value corresponding to the parameter name, the parameter data is determined to be illegal.

[0109] In the disclosed embodiment, the parameter objects in the array to be parsed are grouped to obtain at least one parameter data; and the legitimacy of each parameter data is checked based on the legitimacy condition corresponding to the command object to obtain a legitimacy test result. In this way, whether the parameter data input in the command line interface is legal can be effectively determined based on the legitimacy condition corresponding to the command object.

[0110] Figure 5 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 5 , the method can be executed by a processor of a computer device. Figure 4 , the parameter data includes parameter name, Figure 4 S402 in can be updated to S501 to S502, which will be combined Figure 5 The steps shown are explained.

[0111] Step S501: Obtain necessary parameters corresponding to the command object.

[0112] The required parameters are the parameter names that must be configured for the command object.

[0113] In some embodiments, the command object is configured with some necessary parameters. Each time a command is executed, it is necessary to determine whether these necessary parameters are input in the command line interface. The command can be executed based on these necessary parameters. Therefore, it is necessary to obtain the necessary parameters corresponding to the command object.

[0114] Step S502: Determine the validity detection result based on the necessary parameters and the parameter name corresponding to the command object.

[0115] The parameter name corresponding to the command object includes the parameter name in all parameter data corresponding to the command object.

[0116] The validity detection result is determined by judging whether the necessary parameters belong to the parameter names corresponding to the command object.

[0117] In some embodiments, the command object has one necessary parameter and one parameter name. The necessary parameter is compared with the parameter name corresponding to the command object. If the necessary parameter is consistent with the parameter name corresponding to the command object, the parameter data is determined to be legal; if the necessary parameter is inconsistent with the parameter name corresponding to the command object, the parameter data is determined to be illegal.

[0118] In some embodiments, the command object corresponds to at least two necessary parameters, and the command object corresponds to at least two parameter names. Each necessary parameter is compared with each parameter name corresponding to the command object. If all necessary parameters belong to the at least two parameter names corresponding to the command object, the parameter data is determined to be legal; if any necessary parameter does not belong to the at least two parameter names corresponding to the command object, the parameter data is determined to be illegal.

[0119] If the parameter data is illegal, the command line interface will display information indicating that the required parameters have not been entered and the names of the required parameters.

[0120] In the disclosed embodiment, the necessary parameters corresponding to the command object are obtained; and the legality detection result is determined based on the necessary parameters and the parameter name corresponding to the command object. In this way, it is possible to accurately determine whether the necessary parameters corresponding to the command object are input, and obtain an accurate legality detection result.

[0121] Figure 6 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 6, the method can be executed by a processor of a computer device. Figure 4 , the parameter data includes a parameter name and a corresponding parameter value, Figure 4 S402 in can be updated to S601 to S602, which will be combined Figure 6 The steps shown are explained.

[0122] Step S601: Obtain the valid range of parameter values ​​corresponding to each parameter name.

[0123] The parameter value valid range is a preset range used to determine the valid parameter value. For example, when the parameter value is a Boolean type, the parameter value valid range is {0,1}.

[0124] The parameter name is configured with the corresponding valid range of parameter values. Each time a command is executed, it is necessary to ensure that the parameter value entered in the command line interface is within the valid range of parameter values ​​before the command can be executed. Therefore, it is necessary to obtain the valid range of parameter values ​​corresponding to each parameter name.

[0125] Step S602: Determine the validity detection result based on the valid range of the parameter value corresponding to each parameter name and the parameter value corresponding to each parameter name.

[0126] The validity detection result is determined by judging whether the parameter value corresponding to the parameter name is within the valid range of the parameter value corresponding to the parameter name.

[0127] In some embodiments, the parameter name is one, and the parameter value corresponding to the parameter name is compared with the valid range of the parameter value corresponding to the parameter name. When the parameter value is within the valid range of the parameter value, the parameter data is determined to be legal; when the parameter value is not within the valid range of the parameter value, the parameter data is determined to be illegal.

[0128] In some embodiments, there are at least two parameter names, and the parameter values ​​corresponding to the at least two parameter names are compared with the corresponding valid range of the parameter values. If all parameter values ​​are within the valid range of the parameter values, the parameter data is determined to be legal; if any parameter value is not within the valid range of the parameter values, the parameter data is determined to be illegal.

[0129] If the parameter data is illegal, the command line interface will display information indicating that the parameter value input is illegal and the valid range of the parameter value.

[0130] In the disclosed embodiment, the valid range of parameter values ​​corresponding to each parameter name is obtained; based on the valid range of parameter values ​​corresponding to each parameter name and the parameter value corresponding to each parameter name, the validity detection result is determined. In this way, it is possible to accurately determine whether the parameter value input in the command line interface is valid and obtain an accurate validity detection result.

[0131] Figure 7 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 7 , the method can be executed by a processor of a computer device. Figure 4 , the parameter data includes parameter name, Figure 4 S402 in can be updated to S701 to S702, which will be combined Figure 7 The steps shown are explained.

[0132] Step S701: Obtain a parameter list corresponding to the command object.

[0133] The parameter list is an optional parameter configured for the command object, and the parameter list includes at least one parameter name.

[0134] In some embodiments, the command object is configured with a parameter list, and each time a command is executed, it is necessary to determine that the parameter name entered in the command line interface belongs to the parameter list before the command can be executed. Therefore, it is necessary to obtain the parameter list corresponding to the command object.

[0135] Step S702: Determine the validity detection result based on the parameter list and the parameter name corresponding to the command object.

[0136] The validity test result is determined by judging whether the parameter name belongs to the parameter list.

[0137] In some embodiments, there is one parameter name, and the parameter name is compared with each parameter name in the parameter list. When the parameter name is consistent with a parameter name in the parameter list, the parameter data is determined to be legal; when the parameter name is inconsistent with all parameter names in the parameter list, the parameter data is determined to be illegal.

[0138] In some embodiments, there are at least two parameter names, and the at least two parameter names are compared with the parameter list. When all parameter names belong to the parameter list, the parameter data is determined to be legal; when any parameter name does not belong to the parameter list, the parameter data is determined to be illegal.

[0139] If the parameter data is illegal, the command line interface will display information indicating that the parameter name input is illegal and a parameter list.

[0140] In the disclosed embodiment, the valid range of parameter values ​​corresponding to each parameter name is obtained; based on the valid range of parameter values ​​corresponding to each parameter name and the parameter value corresponding to each parameter name, the validity detection result is determined. In this way, it is possible to accurately determine whether the parameter value input in the command line interface is valid and obtain an accurate validity detection result.

[0141] Figure 8This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 8 , the method can be executed by a processor of a computer device. Figure 5 , the method further includes steps S801 to S802:

[0142] Step S801: When necessary parameters exist in the command object and there are no parameter objects in the array to be parsed, the guide data of the necessary parameters are displayed in the command line interface based on the necessary parameters corresponding to the command object; the guide data is used to indicate the valid range of the parameter value of the necessary parameter.

[0143] The guide data is the guide information displayed on the command line interface, which is used to guide the input of parameter values.

[0144] In some embodiments, after the sub-content in the array to be parsed is identified, the command object of the array to be parsed is obtained, and it is determined that the array to be parsed does not contain a parameter object. At this time, it is necessary to further determine whether the command object has necessary parameters. The corresponding command can only be executed when the command object has necessary parameters and the parameter object is input in the command line interface. Therefore, when the command object has necessary parameters and the array to be parsed does not have a parameter object, it is necessary to display the guide data of the necessary parameters in the command line interface so as to guide the input of the necessary parameters through the guide data.

[0145] The guide data includes the parameter name and description of the required parameter. For example, the guide data is "The input parameter is empty, and the number of parameters to be input is not 0, start the guide input mode! Please enter the first parameter a:". ​​The parameter name of the required parameter is a, and the description is the first parameter.

[0146] In some embodiments, the guidance data further includes a valid range of parameter values ​​of the necessary parameters. For example, the guidance data is "Please enter the first parameter b (valid range of parameter value: {-1, 1}):".

[0147] In some embodiments, the guide data also includes default values ​​of necessary parameters. Exemplarily, the guide data is "Please enter the first parameter c (default value: 1):".

[0148] In some embodiments, the guide data further includes the type of the necessary parameter. Exemplarily, the guide data is "Please enter the first parameter d (type: string):".

[0149] Step S802: receiving an input parameter value through the command line interface, and combining the parameter value with the parameter name of the required parameter to form parameter data corresponding to the required parameter when the parameter value satisfies the valid range of the parameter value.

[0150] In some embodiments, the guide data includes the parameter name of the necessary parameter. After the guide data of the necessary parameter is displayed through the command line interface, the user enters the parameter value of the necessary parameter in the command line interface. At this time, it is necessary to receive the parameter value entered by the user through the command line interface, compare the parameter value entered by the user with the valid range of the parameter value, and when the parameter value meets the valid range of the parameter value, the parameter value entered by the user is combined with the parameter name of the necessary parameter to form the parameter data corresponding to the necessary parameter. The parameter data corresponding to the necessary parameter includes the parameter name of the necessary parameter and the parameter value of the necessary parameter.

[0151] In some embodiments, the command object has at least two necessary parameters. When the command object has at least two necessary parameters and the array to be parsed does not have a parameter object, based on the at least two necessary parameters, the guide data of the at least two necessary parameters are displayed in the command line interface.

[0152] The first necessary parameter is first guided and inputted through the guide data, and when the parameter value of the first necessary parameter is received through the command line interface and the parameter value satisfies the valid range of the parameter value, the second necessary parameter is guided and inputted. In this way, at least two necessary parameters can be guided and inputted through the guide data to obtain at least two parameter data.

[0153] In some embodiments, the command object includes non-essential parameters. If the command object has non-essential parameters and the array to be parsed does not have parameter objects, the command line interface displays the guidance data of the non-essential parameters based on the non-essential parameters corresponding to the command object.

[0154] In the disclosed embodiment, when there are necessary parameters in the command object and there are no parameter objects in the array to be parsed, the guide data of the necessary parameters are displayed in the command line interface based on the necessary parameters corresponding to the command object; the input parameter value is received through the command line interface, and when the parameter value meets the valid range of the parameter value, it is combined with the parameter name of the necessary parameter to form the parameter data corresponding to the necessary parameter. In this way, the necessary parameters are guided to be input through the guide data, and the user can be accurately guided to input a complete command in the command line interface, so as to complete the rapid learning and use of the command and reduce the learning cost.

[0155] Fig. 9 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 9 , the method can be executed by a processor of a computer device. Figure 1 , the management command includes an add command; Figure 1 S102 in can be updated to S901 to S902, which will be combined Fig. 9 The steps shown are explained.

[0156] Step S901, when the parsing result indicates that the content to be parsed is the add command, based on the tool data structure corresponding to the toolset, the second guide data of the add command is displayed on the command line interface; the second guide data is used to indicate the field name in the tool data structure that needs to be added.

[0157] Among them, the add command is a type of management command, which is used to add commands to the toolset.

[0158] The tool data structure is a preset data structure used to determine the relevant fields of the command object and the parameter object. Exemplarily, the tool data structure includes a command node and a command parameter. The command node is used to determine the relevant fields of the command object, and the command parameter is used to determine the relevant fields of the parameter object. The command node and the command parameter have a corresponding relationship, and one command node corresponds to one command parameter.

[0159] The second guide data is guide information displayed on the command line interface, and is used to guide the input of field values ​​corresponding to field names in the tool data structure.

[0160] Where fieldName is the name of the associated field in the tool data structure.

[0161] In some embodiments, in order to integrate commands of different tools and manage commands for the tool set, it is necessary to define a unified tool data structure, in which the relevant fields of the command object and the relevant fields of the parameter object are described. Based on the unified tool data structure, command management is performed for the tool set.

[0162] In some embodiments, the command node includes a name field, a description field, and an executable field. The name field is used to determine the name of the command object, the description field is used to describe the function and meaning of the command object, and the executable field is used to determine whether the command object is executable.

[0163] Among them, commands include executable commands and non-executable commands. An executable command means that the command entered in the command line interface can be executed based on the command execution path to obtain the execution result; a non-executable command means that the command entered in the command line interface cannot be executed directly, and help information will be displayed in the command line interface.

[0164] In some embodiments, the command parameter includes a parameter name field, a description field, a required field, a type field, an optional value field, and a default value field. The parameter name field is used to determine the name of the parameter object, the description field is used to describe the function and meaning of the parameter object, the required field is used to determine whether the parameter object is a necessary parameter, the type field is used to determine the type of the parameter value, the optional value field is used to determine the optional range of the parameter value, and the default value field is used to determine the default parameter value.

[0165] The parameter value has three types: integer, string, and path. Integer means the input parameter value is a numeric type, string means the input parameter value is a string type, and path means the input parameter value is in the format of a path.

[0166] In some embodiments, the content to be parsed input in the command line interface is parsed to obtain a parsed command object. The add command is pre-stored in the toolset, and the add command is a management command preset in the toolset. Whether the command object is an add command is determined based on whether the content of the command object is consistent with the content of the add command. When the parsing result indicates that the content to be parsed is an add command, the add command is executed based on the tool data structure corresponding to the toolset. Exemplarily, the add command is "add_commands".

[0167] In the process of executing the add command, based on the command nodes and command parameters defined in the tool data structure, the second guide data of the add command is displayed in the command line interface, and the user is guided to enter field values ​​related to the command object and parameter object based on the second guide data.

[0168] Among them, the second guide data indicates the field name that needs to be added. When executing the add command, the command object is added based on the command node: first guide the user to enter the name of the command object to be added in the command line interface, then guide the user to enter the description of the command object in the command line interface, and finally guide the user to enter whether the command object is executable in the command line interface. Add parameter objects based on command parameters: first guide the user to enter the name of the parameter object to be added in the command line interface, then guide the user to enter the description of the parameter object in the command line interface, then guide the user to enter whether the parameter object is a required parameter in the command line interface, then guide the user to enter the type of parameter value in the command line interface, and finally guide the user to enter the optional range of the parameter value and the default parameter value in the command line interface.

[0169] In some embodiments, the command node further includes a parameter list, a sub-command set, a level, an execution path, and a version number. The parameter list is used to determine all parameter names corresponding to the command object, the sub-command set is used to determine all sub-command objects corresponding to the command object, the level is used to determine the level at which the command object is located, the execution path is used to determine the path where the first executable file of the command object is located, and the version number is used to determine the version corresponding to the command object.

[0170] When executing the add command, the second guide data guides the user to enter the parameter list corresponding to the command object, the sub-command set corresponding to the command object, the level corresponding to the command object, the execution path corresponding to the command object and the version number corresponding to the command object in the command line interface.

[0171] Step S902: receiving the input field value through the command line interface, and combining it with the field name to form field data of the add command.

[0172] The field data includes a field name and a field value. The field name is determined based on the tool data structure, and the field value is obtained by guiding the user input based on the second guiding data.

[0173] In some embodiments, when executing the add command, the field name to be added is indicated in the command line interface through the second guide data, and the user enters the corresponding field value in the command line interface based on the field name. The input field value is received through the command line interface and combined with the field name to form the field data of the add command. In this way, the add command can be completed.

[0174] In some embodiments, the command object has at least two parameter data. When adding data, the second guide data first indicates the first parameter data to be added in the command line interface, then indicates the second parameter data to be added, and so on. After all parameter data are added, the process of adding the command is completed.

[0175] In some embodiments, a command object has at least one sub-command object. When adding data, the second guide data first indicates the first command object to be added in the command line interface, and then indicates the sub-command object to be added, and so on. After all command objects are added, parameter data is added to complete the process of adding commands.

[0176] Exemplarily, the command line interface displays the second boot data of the add command as:

[0177] "Start by adding the first command:

[0178] Please enter the command name: test

[0179] Please enter command description: test

[0180] Is it executable? True means it is executable, false means it is not executable: 1.true 2.false

[0181] Please enter the selected value: 1

[0182] The command test is added successfully. Start adding parameters to the command. You can exit directly if you don’t need them.

[0183] Start adding the first parameter:

[0184] Please enter the parameter name: a

[0185] Please enter parameter description: First parameter

[0186] Is it required? True is required, false is not required: 1.true 2.false

[0187] Please enter the selected value: 2

[0188] Optional types: 1. string 2. path 3. int

[0189] Please enter the selected value: 1

[0190] Please enter an optional value, skip if not entered:

[0191] Please enter a default value:

[0192] Parameter a has been added successfully, start adding the next parameter, if not needed, exit directly".

[0193] In the disclosed embodiment, when the parsing result indicates that the content to be parsed is to add a command, based on the tool data structure corresponding to the toolset, the second guide data for adding the command is displayed in the command line interface, and the input field value is received through the command line interface, and combined with the field name to form the field data for adding the command. In this way, by guiding the user to add commands to the toolset through the guide data, the process of adding commands can be accurately completed, tools can be quickly added to the toolset, and the cost of tool access can be reduced. In addition, for tools developed in different development languages, they can be added to the toolset by adding commands. It is only necessary to guide the user to enter the corresponding field value according to the relevant field name in the tool data structure. The management method is unified, and the differences between different tool development languages ​​can be hidden.

[0194] Fig.10 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 10 , the method can be executed by a processor of a computer device. Figure 1 , the management command includes a delete command; Figure 1 S102 in can be updated to S1001, which will be combined with Fig.10 The steps shown are explained.

[0195] Step S1001: when the parsing result indicates that the content to be parsed is the delete command, delete the command object corresponding to the serial number in the custom command set based on the deleted serial number.

[0196] The delete command is a management command used to delete commands from a toolset.

[0197] The deleted sequence number is the sequence number corresponding to the command object to be deleted.

[0198] The custom command set includes all custom commands added to the toolset through the add command. Different from management commands, custom commands are commands defined by users in the command line interface and added to the toolset through the add command.

[0199] In some embodiments, the user needs to perform a delete operation on a custom command in the tool set. The delete command is pre-stored in the tool set, and the delete command is a management command preset in the tool set. According to whether the content of the command object is consistent with the content of the delete command, it is determined whether the command object is a delete command. If the parsing result indicates that the content to be parsed is a delete command, the delete command is executed.

[0200] Wherein, when the parsing result indicates that the content to be parsed is a deletion command, all custom commands that can be deleted are displayed through the command line interface, and each custom command has a corresponding serial number. The command line interface displays the guide data of the deletion command, and the user is guided to enter the serial number of the command object to be deleted in the command line interface through the guide data. Based on the deleted serial number, the command object corresponding to the serial number is deleted from the custom command set.

[0201] In some embodiments, when a delete command is executed, all field data of the command object will be deleted, including all field names and all field values ​​corresponding to the command object.

[0202] In some embodiments, when executing a delete command, if the command object to be deleted has a sub-command object, the command object and field data corresponding to all associated sub-command objects are deleted together.

[0203] For example, when the delete command is executed, the command line interface is displayed as follows:

[0204] "Subcommands that can be removed:

[0205] 1.config 2.offline 3.online 4.deploy 5.board 6.bag 7.monitor

[0206] Please enter the sequence number to be deleted:".

[0207] In the embodiment of the present disclosure, when the parsing result indicates that the content to be parsed is a delete command, the command object corresponding to the serial number is deleted from the custom command set based on the deleted serial number. In this way, the command deletion process can be completed accurately and the tool can be quickly deleted from the tool set.

[0208] Fig.11 This is a schematic diagram of the implementation process of a command management method based on a tool set provided by an embodiment of the present disclosure. Figure 10 , the method can be executed by a processor of a computer device. Figure 1 , the management command includes a display command; Figure 1 S102 in can be updated to S1101, which will be combined with Fig.11 The steps shown are explained.

[0209] Step S1101: when the parsing result indicates that the content to be parsed is the display command, all command objects are displayed in a tree structure based on the hierarchical relationship between command objects.

[0210] Among them, the display command is a type of management command, which is used to display all command objects in the toolset.

[0211] The tree structure is a hierarchical data structure used to represent the hierarchical relationship between command objects. The tree structure includes a root node, branch nodes, and leaf nodes.

[0212] In some embodiments, the command object has a corresponding level and sub-command set, and the parent-child relationship between related command objects is determined by the level and sub-command set. Based on the parent-child relationship between command objects, the command objects of all custom commands can be displayed in a tree structure. When displaying command objects, first determine the command object with level 1 and display it under the root node; then determine the command object with level 2 corresponding to each command object with level 1, and display it under the command object with level 1; and so on, to obtain a tree structure of all command objects.

[0213] In some embodiments, when executing the display command, the command objects of all custom commands and the command objects of all management commands are simultaneously displayed in the command line interface through a tree structure, wherein the level of the management command is set to 1.

[0214] For example, the command object at level 1 includes the configuration command config, the offline command offline, and the online command online. Under the command object config, the command object at level 2 includes the installation command install_ci and the output command echo. Therefore, all custom commands are displayed in a tree structure as follows: the root node tools, the root node includes three branch nodes config, offline, and online at level 1, and the branch node config includes two branch nodes install_ci and echo at level 2.

[0215] In the embodiment of the present disclosure, when the parsing result indicates that the content to be parsed is a display command, all command objects are displayed in a tree structure. In this way, by displaying the full picture of the commands in the tool set in a tree structure, the full picture of the tool set can be easily viewed in the command line interface, and the functions of the tool set can be quickly understood.

[0216] In some embodiments, the management command includes adding parameters; when the parsing result indicates that the content to be parsed is the adding parameter, based on the tool data structure corresponding to the tool set, the third guide data of the adding parameter is displayed on the command line interface; the third guide data is used to indicate the field name in the command parameter to be added. The field value of the command parameter input is received through the command line interface and combined with the field name to form the field data of the adding parameter.

[0217] The content to be parsed includes a command object and added parameters. The third guide data is displayed on the command line interface based on the field name of the command parameter in the tool data structure, and corresponding parameter data is added to the command object.

[0218] In some embodiments, the management command includes a deletion parameter; when the parsing result indicates that the content to be parsed is the deletion parameter, the parameter name corresponding to the serial number is deleted from the parameter list of the command object based on the serial number of the deleted parameter name.

[0219] The content to be parsed includes the command object and the deletion parameter. All parameter names corresponding to the command object are displayed on the command line interface, and each parameter name has a corresponding serial number. When executing the deletion parameter, all field data of the parameter name will be deleted, including all field names and all field values ​​corresponding to the parameter name.

[0220] In some embodiments, the method further includes: in response to a command line interface startup event, loading a configuration file of the toolset from a preset configuration file storage address; decoding the configuration file based on a decoding function to obtain a data structure object that can be called by the command line interface.

[0221] The command line interface startup event is an event for starting the command line interface and running the toolset.

[0222] The configuration file is the configuration file of the toolset, and the configuration file includes relevant fields of all custom commands added in the toolset.

[0223] The decoding function is a preset function used to parse the content of the configuration file into a defined data structure.

[0224] The data structure object is a data structure corresponding to the toolset, and is used to store the content of the parsed configuration file.

[0225] In some embodiments, when using a toolset for command management, it is first necessary to load a configuration file corresponding to the toolset, and load the configuration file into the preset memory of the toolset to use the contents of the configuration file. The configuration file includes field data related to all command objects, that is, the configuration information of all custom commands and the configuration information of all management commands are stored in the configuration file. After loading and parsing the configuration file, all command objects in the toolset can be used.

[0226] When the command line interface is started, the latest configuration file needs to be loaded into the preset memory of the toolset. The configuration file is stored in the configuration file storage address, and in response to the command line interface startup event, the configuration file of the toolset is loaded from the preset configuration file storage address. Exemplarily, the format of the configuration file is a JSON file, and the configuration file is loaded based on the load function in the json library.

[0227] In some embodiments, in order to be able to call the contents of the configuration file normally, after loading the configuration file, it is necessary to parse the configuration file into a data structure object that can be called by the command line interface. Based on the format of the configuration file and the format of the tool data structure, a decoding function is determined, and through the decoding function, the configuration file is parsed into a format corresponding to the preset tool data structure to obtain a decoded data structure object. The command line interface can call the decoded data structure object to implement the command management function of the tool set.

[0228] Among them, it is necessary to determine the corresponding decoding function according to the format of the tool data structure, and decode the configuration file into the format of the preset tool data structure.

[0229] In some embodiments, the method further includes: in response to obtaining the data structure object, displaying the data structure object through the command line interface. The data structure object stores the field data of all command objects parsed in the configuration file. Exemplarily, the configuration file includes the name field, description field, and whether the field is executable of three custom commands, and the parameter name field, description field, and whether the field is required of the corresponding command parameters. After obtaining the data structure object, the parsed field data of the three custom commands are displayed through the command line interface. Displaying the data structure object through the command line interface can clearly display the contents of the decoded configuration file.

[0230] In the embodiment of the present disclosure, in response to a command line interface startup event, the configuration file of the tool set is loaded from a preset configuration file storage address; the configuration file is decoded based on a decoding function to obtain a data structure object that can be called by the command line interface. In this way, by loading and decoding the configuration file, the data structure object required for the command line interface call can be accurately obtained, ensuring the normal use of the tool set.

[0231] In some embodiments, in response to a data saving event, a data structure object corresponding to the toolset is encoded to generate a configuration file of the toolset; and the configuration file of the toolset is stored based on a preset configuration file storage address.

[0232] The data saving event is an event for saving the contents of the configuration file of the modified toolset.

[0233] After the toolset is managed, the configuration file of the toolset will be modified. At this time, the modified configuration file needs to be saved to the configuration file to obtain the latest configuration file. For example, after adding a command to the toolset, the configuration file will add data corresponding to the added command.

[0234] In response to the data saving event, the decoded data structure object is re-encoded to obtain the configuration file of the tool set, and the configuration file is stored according to the preset configuration file storage address. Exemplarily, the decoded data structure object is converted into the format required by the configuration file through the dump function in the json library and saved in the configuration file.

[0235] In the disclosed embodiment, in response to a data saving event, the data structure object corresponding to the toolset is encoded to generate a configuration file of the toolset; the configuration file of the toolset is stored based on a preset configuration file storage address. In this way, after the toolset is command-managed, the modified configuration file content can be saved in time to obtain an accurate configuration file.

[0236] In some embodiments, when the parsing result indicates that the content to be parsed is a custom command in the toolset and the first executable file corresponding to the custom command is executable, the custom command is executed; when the parsing result indicates that the content to be parsed is a custom command in the toolset and the custom command is not executable, help information is displayed.

[0237] Among them, custom commands are commands defined by users according to functional requirements and added to the toolset. When integrating tools based on the toolset, the tool commands need to be added to the toolset in the form of custom commands.

[0238] The custom commands include executable custom commands and non-executable custom commands. If the custom command is executable, the custom command is executed based on the first executable file corresponding to the custom command; if the custom command is not executable, help information is displayed in the command line interface.

[0239] The first executable file is an executable file under the execution path of the custom command. The custom command is executed by executing the first executable file.

[0240] In some embodiments, when executing the add command, for each custom command that needs to be added, a field is configured to indicate whether the custom command is executable. For executable custom commands, the execution path of the custom command needs to be configured, and the first executable file corresponding to the custom command is stored in the execution path. When the content to be parsed is a custom command and the first executable file corresponding to the custom command is executable, the custom command is executed by executing the first executable file. For non-executable custom commands, help information is directly displayed in the command line interface.

[0241] Exemplarily, for executable custom commands, when the first executable file is executable, the system function os.system is called to execute the first executable file; for non-executable custom commands, help information is displayed in the command line interface, and the help information may be inputtable management commands, inputtable parameter data, and current version.

[0242] In the embodiment of the present disclosure, when the parsing result indicates that the content to be parsed is a custom command in the tool set and the first executable file corresponding to the custom command is executable, the custom command is executed; when the parsing result indicates that the content to be parsed is a custom command in the tool set and the custom command is not executable, help information is displayed. In this way, the function corresponding to the command is realized by executing the custom command, and the tool set can be better used by displaying the help information.

[0243] In some embodiments, the method further includes: packaging the script data of the toolset based on a packaging program, generating a second executable file and placing the second executable file in a first preset path.

[0244] The packaging program is a preset script file used to implement the packaging of script data.

[0245] The second executable file is an executable file corresponding to the script data of the tool set, and the tool set can be used by running the second executable file.

[0246] The first preset path is a path for storing the second executable file.

[0247] In some embodiments, in order to conveniently use the toolset in any scenario, the script data of the toolset needs to be packaged to generate a second executable file corresponding to the toolset, and the toolset can be used through the second executable file by placing the second executable file in the first preset path.

[0248] Exemplarily, the packaging program is package.sh. The packaging program is run in a command line interface to generate a second executable file tool, and the second executable file is placed in the sudo cp tool / usr / bin / path.

[0249] In the embodiment of the present disclosure, the script data of the toolset is packaged based on the packaging program, a second executable file is generated and the second executable file is placed in the first preset path. In this way, by packaging the script data of the toolset, the toolset can be packaged and released, and the toolset can be migrated to the project.

[0250] In some embodiments, the method further includes: generating an automatic completion script based on a configuration file and placing the automatic completion script in a second preset path.

[0251] The auto-completion script is a script file used to implement tab completion and prompts in the command line interface.

[0252] The second preset path is a path for storing the automatic completion script.

[0253] Among them, after running the packaging program, the content of the configuration file is automatically read, and an automatic completion script is generated according to a specific template. The automatic completion script is placed in the second preset path. By turning on automatic completion or reopening the command line interface, tab completion and prompts of the command line interface are realized.

[0254] For example, after running the packaging program package.sh, an automatic completion script tool_completion.sh is generated and placed in the sudo cp tool_completion.sh / usr / share / bash-completion / completions / tool ​​path. Tab completion and prompts are implemented by enabling automatic completion source~ / .barshrc or reopening the command line interface.

[0255] In the disclosed embodiment, based on the configuration file, an automatic completion script is generated and placed in the second preset path. In this way, tab completion can be implemented, and the efficiency of command input in the command line interface can be improved.

[0256] The following describes the application of the command management method based on the toolset provided by the embodiment of the present disclosure in actual scenarios.

[0257] Each R&D direction of autonomous driving has its own tool requirements. At the same time, the tools are maintained by developers of each production line. Due to the different development languages ​​and habits, there are many tools. Users need to learn more knowledge to understand the use of each tool and adapt to the different usage habits of each tool. This will lead to the following intuitive problems:

[0258] 1. Increased tool usage and learning costs.

[0259] 2. The various tools are not unified and cannot be connected to the project in a unified way, which increases the migration cost.

[0260] 3. Tools are developed in different languages, which makes it impossible to uniformly implement tab completion and prompts in the command line interface.

[0261] 4. It is not possible to view the full picture of the toolset in the command line interface.

[0262] The embodiments of the present disclosure provide a tool integration and management method, which can be used to quickly develop a command line tool set and provide functions such as command management, parameter management, help, display and command execution.

[0263] In some embodiments, a tool data structure is defined, and the format can be json, yaml or xml. Two basic types are defined in the tool data structure: command node CommandNode, which is used to represent a node on the tree corresponding to the toolset, and is divided into two types: executable and non-executable; command parameter CommandParameter, which is used to represent the parameters supported by the node, and the supported parameters include string, path, int, etc.

[0264] In the command node, define the name, description, executable, parameter list, subcommand set, level, execution path, and version number. In the command parameter, define the parameter name, description, required, type, optional value, whether to check the optional value input range, and default value.

[0265] In some embodiments, it is necessary to execute configuration file loading, parse the configuration into a defined data structure, save the data as a file and print the corresponding parsed content.

[0266] Among them, when the command is loaded, the configuration file config.json is loaded through the load function, and the configuration file is parsed into the data structure object command_node through the decoding function CommandNodeDecode.

[0267] Among them, after obtaining the parsed command_node, the parsed content can be printed out on the command line interface through the dumps function.

[0268] Among them, the data structure object command_node is saved as a configuration file through the dump function.

[0269] In some embodiments, the input of the command line interface is parsed in the format of tools command sub_command[-param_name param_value], and the input is parsed into the CommandParser class.

[0270] The string inputted in the command line interface is divided by spaces to obtain the array args to be parsed of the command line input. A set of attributes are defined and initialized through the initialization function __init__. The attributes include the source array __source_args__, the command command, the subcommand subcommand, the parameter object commandArgs, and the type type.

[0271] In some embodiments, the parameter array is parsed, the parameters are checked, and if there are no parameters, it is determined whether the user needs to be guided to fill in the parameters. If the required parameters are not entered, a prompt is given in the command line interface, the necessary parameters corresponding to the command object are obtained, and the legality detection result is determined based on the necessary parameters and the parameter names corresponding to the command object.

[0272] In some embodiments, the command is executed according to the parsed data. According to the parsed command input, the node is searched in the data structure after the configuration file is loaded, and it is determined whether the command is a public command. In the case where the command is a public command, the corresponding public command function is executed, and the public command function includes adding commands, deleting commands, adding parameters, deleting parameters and displaying structures; in the case where the command is not a public command, it is determined whether the command is executable. In the case where the command is executable, it is determined whether the first executable file exists and whether the first executable file is executable. In the case where the first executable file is executable, os.system is called to execute the first executable file; in the case where the command is not executable, help information is displayed. Among them, in the case of starting the boot input, it is necessary to determine whether the user input during the boot process is legal.

[0273] Exemplarily, the process of adding commands displayed in the command line interface is as follows:

[0274] ~ / ws / data / gitee / scripts / tool$python3 tool.py add_commands

[0275] Start adding the first command:

[0276] Please enter the command name name (default: ): test

[0277] Please enter command description description (default: ): test

[0278] Is it executable? True means it is executable, false means it is not executable:

[0279] 1.true 2.false

[0280] Please enter the value of your choice number (default value: ): 1

[0281] [INFO] Command test is added successfully. Start adding parameters to the command. If not needed, exit and start adding the first parameter:

[0282] Please enter the parameter name (exit if not entered) name (default value: ): a

[0283] Please enter the command description description (default value:): The first parameter

[0284] Is it required? True is required, false is not required:

[0285] 1.true 2.false

[0286] Please enter the value of your choice number (default value: ): 2

[0287] Optional Types

[0288] 1. string 2. path 3. int

[0289] Please enter the value of your choice number (default value: ): 1

[0290] Please enter an optional value, skip if not entered optional (default value:):

[0291] Please enter the default value (default value:):

[0292] [INFO] Parameter a was added successfully. Start adding the next parameter. You can exit directly if you don't need it.

[0293] Start adding the second parameter:

[0294] Please enter the parameter name (exit if not entered) name (default value:):

[0295] Start adding the second command:

[0296] Please enter the command name nme (default: ):

[0297] For example, the show command is used to display the entire tree-structured toolset in the command line interface. Fig.12 A tree structure diagram is provided for an embodiment of the present disclosure. Fig.12 As shown, under the root node 1201 (tools), there are 7 branch nodes: configuration command 1202 (config), offline command 1203 (offline), online command 1204 (online), deployment command 1205 (deploy), capture command 1206 (bag) and monitoring command 1207 (monitor). Under the configuration command 1202, there are 2 leaf nodes: installation command 1208 (install_ci) and output command 1209 (echo). Under the capture command 1206, there are 3 leaf nodes: list command 1210 (list), download command 1211 (download) and upload command 1212 (upload). Under the monitoring command 1207, there is one leaf node: performance command 1213 (perf).

[0298] By way of example, the subcommands that can be deleted can be displayed through the command line interface:

[0299] 1.config 2.offline 3.online 4.deplay 5.board 6.bag 7.monitor

[0300] Please enter the sequence number to be deleted (default value:):

[0301] In some embodiments, the final executable tool set needs to be packaged and delivered. Enter $. / package.sh in the command line interface to package the script data, generate the second executable file tool and the automatic completion script tool_completion.sh, and these two files are the packaged deliverables. The generated data is displayed in the command line interface in the form of a file tree.

[0302] In some embodiments, when using the packaged deliverable, place the second executable file in the sudo cptool / usr / bin / directory. Place the script completion file in the sudo cp tool_completion.sh / usr / share / bash-completion / completions / tool ​​directory. Enable auto-completion source ~ / .barshrc or reopen the command line interface.

[0303] In the disclosed embodiments, the management method is unified to hide the differences between the development of different tools; tab completion improves the efficiency of command input on the command line; the tree structure displays the full picture of the command set to quickly understand the functions of the toolset; through guided input, a tool is quickly added to the toolset step by step to reduce the learning cost; through guided input, a tool is quickly learned and used step by step to reduce the learning cost. The toolset tool is used to uniformly manage the toolset, so that all commands can be uniformly managed, maintained, and integrated, and can be quickly migrated to other projects. Autonomous driving integration uses the toolset to encapsulate multiple tools to achieve unified management and maintenance of the toolset, while providing convenient tab completion and a tree structure to display the full picture of the toolset, making feedback more convenient and friendly to use.

[0304] In the disclosed embodiment, tab completion and prompts of the command line interface are automatically generated according to the configuration of the toolset; the overall picture of the toolset is displayed in the form of a file tree; a unified method of using the toolset is used: tools command sub_command[-param_name param_value]; the cost of tool access is reduced, and a tool can be quickly added to the toolset; the differences in development languages ​​of different tools are hidden, and tools can be developed in languages ​​such as C++, Python, and shell, and can also be added to the toolset; and the toolset is packaged and released.

[0305] Based on the foregoing embodiments, the embodiments of the present disclosure provide a command management device based on a toolset, which includes the units included and the modules included in the units, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0306] Fig.13 A schematic diagram of the composition structure of a command management device based on a toolset provided in an embodiment of the present disclosure is shown in FIG. Fig.13 As shown, the command management device 1300 includes: an acquisition module 1310, a parsing module 1320, and a management module 1330, wherein:

[0307] The acquisition module 1310 is used to acquire the input content to be parsed in the command line interface and the tool data structure corresponding to the tool set; the tool data structure includes the attribute information of each command in the tool set;

[0308] The parsing module 1320 is used to parse the content to be parsed based on the attribute information of each command in the tool set to obtain a parsing result;

[0309] The management module 1330 is configured to perform command management on the toolset based on the management command corresponding to the content to be parsed, if the parsing result indicates that the content to be parsed is a management command in the toolset.

[0310] In some embodiments, the attribute information of the command includes a command object, a parameter object corresponding to the command object, and a legitimacy requirement corresponding to the parameter object; the parsing module 1320 is also used to divide the content to be parsed into sub-contents to obtain an array to be parsed; based on a preset parameter object prefix, the sub-contents in the array to be parsed are judged in order to determine the judgment result of the sub-content; the judgment result is used to determine whether the sub-content is a command object or a parameter object; when the parameter object meets the legitimacy requirement, the parsing result is generated based on the obtained command object and parameter object.

[0311] In some embodiments, the command object includes at least one level of command objects; the parsing module 1320 is also used to sequentially obtain the sub-contents in the array to be parsed, and when it is determined that the first n sub-contents are all command objects based on a preset parameter object prefix, the first n sub-contents are determined as command objects of the first to nth levels in turn; n is a positive integer; and the remaining sub-contents are determined as parameter objects of the command objects of the nth level.

[0312] In some embodiments, the parameter object includes a parameter name and a parameter value; the parsing module 1320 is also used to group the parameter objects in the array to be parsed to obtain at least one parameter data; and perform a legitimacy check on each parameter data based on the legitimacy condition corresponding to the command object to obtain a legitimacy check result.

[0313] In some embodiments, the parameter data includes parameter names; the parsing module 1320 is further used to obtain necessary parameters corresponding to the command object; and determine the legitimacy detection result based on the necessary parameters and the parameter names corresponding to the command object.

[0314] In some embodiments, the parameter data includes parameter names and corresponding parameter values; the parsing module 1320 is also used to obtain the valid range of parameter values ​​corresponding to each of the parameter names; based on the valid range of parameter values ​​corresponding to each of the parameter names and the parameter values ​​corresponding to each of the parameter names, the legitimacy detection result is determined.

[0315] In some embodiments, the parameter data includes parameter names; the parsing module 1320 is further used to obtain a parameter list corresponding to the command object; and determine the legitimacy detection result based on the parameter list and the parameter name corresponding to the command object.

[0316] In some embodiments, the parsing module 1320 is also used to display first guide data of the necessary parameters on the command line interface based on the necessary parameters corresponding to the command object when the command object has necessary parameters and the array to be parsed does not have parameter objects; the first guide data is used to indicate the valid range of parameter values ​​of the necessary parameters; the input parameter value is received through the command line interface, and when the parameter value satisfies the valid range of the parameter value, the parameter value is combined with the parameter name of the necessary parameter to form parameter data corresponding to the necessary parameter.

[0317] In some embodiments, the management command includes an add command; the management module 1330 is also used to display the second guide data of the add command on the command line interface based on the tool data structure corresponding to the toolset when the parsing result represents that the content to be parsed is the add command; the second guide data is used to indicate the field name in the tool data structure that needs to be added; the input field value is received through the command line interface, and combined with the field name to form the field data of the add command.

[0318] In some embodiments, the management command includes a delete command; the management module 1330 is further used to delete the command object corresponding to the serial number in the custom command set based on the deleted serial number when the parsing result indicates that the content to be parsed is the delete command.

[0319] In some embodiments, the management command includes a display command; the management module 1330 is further used to display all command objects in a tree structure based on the hierarchical relationship between command objects when the parsing result indicates that the content to be parsed is the display command.

[0320] In some embodiments, the management module 1330 is further used to load the configuration file of the toolset from a preset configuration file storage address in response to a command line interface startup event; decode the configuration file based on a decoding function to obtain a data structure object that can be called by the command line interface.

[0321] In some embodiments, the management module 1330 is further used to encode the data structure object corresponding to the toolset in response to a data saving event to generate a configuration file of the toolset; and store the configuration file of the toolset based on a preset configuration file storage address.

[0322] In some embodiments, the management module 1330 is further configured to execute the custom command when the parsing result indicates that the content to be parsed is a custom command in the toolset and the first executable file corresponding to the custom command is executable.

[0323] In some embodiments, the management module 1330 is further configured to display help information when the parsing result indicates that the content to be parsed is a custom command in the toolset and the custom command is not executable.

[0324] In some embodiments, the management module 1330 is further used to package the script data of the toolset based on a packaging program, generate a second executable file and place the second executable file in a first preset path.

[0325] In some embodiments, the management module 1330 is further configured to generate an automatic completion script based on the configuration file and place the automatic completion script in a second preset path.

[0326] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.

[0327] It should be noted that in the embodiments of the present disclosure, if the above-mentioned command management method based on the tool set is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0328] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0329] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0330] An embodiment of the present disclosure provides a computer program, including a computer-readable code. When the computer-readable code is executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0331] The present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0332] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product disclosed in the present invention, please refer to the description of the method embodiment disclosed in the present invention for understanding.

[0333] Fig.14 A hardware entity diagram of a computer device provided in an embodiment of the present disclosure, such as Fig.14 As shown, the hardware entity of the computer device 1400 includes: a processor 1401 and a memory 1402, wherein the memory 1402 stores a computer program that can be run on the processor 1401, and the processor 1401 implements the steps in the method of any of the above embodiments when executing the program.

[0334] The memory 1402 stores computer programs that can be run on the processor. The memory 1402 is configured to store instructions and applications executable by the processor 1401. It can also cache data to be processed or processed by the processor 1401 and various modules in the computer device 1400 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0335] When the processor 1401 executes the program, the steps of any of the above-mentioned command management methods based on the toolset are implemented. The processor 1401 generally controls the overall operation of the computer device 1400 .

[0336] An embodiment of the present disclosure provides a computer storage medium storing one or more programs, which can be executed by one or more processors to implement the steps of the tool set-based command management method of any of the above embodiments.

[0337] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.

[0338] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, which is not specifically limited in the embodiments of the present disclosure.

[0339] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0340] The above description is only an implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure.

Claims

1. A command management method based on a toolset, characterized in that: The method comprises: Obtaining the input content to be parsed in the command line interface and the tool data structure corresponding to the tool set; the tool data structure includes attribute information of each command in the tool set; Parsing the content to be parsed based on the attribute information of each command in the tool set to obtain a parsing result; When the analysis result indicates that the content to be analyzed is a management command in the toolset, command management is performed on the toolset based on the management command corresponding to the content to be analyzed.

2. The method according to claim 1, characterized in that The attribute information of the command includes a command object, a parameter object corresponding to the command object, and a legality requirement corresponding to the parameter object; the content to be parsed is parsed based on the attribute information of each command in the tool set to obtain a parsing result, including: Divide the content to be parsed into sub-contents to obtain an array to be parsed; Based on a preset parameter object prefix, the sub-contents in the array to be parsed are sequentially discriminated to determine a discrimination result of the sub-contents; the discrimination result is used to determine whether the sub-contents are command objects or parameter objects; In the case where the parameter object meets the legality requirement, the parsing result is generated based on the obtained command object and parameter object.

3. The method according to claim 2, characterized in that The command object includes at least one level of command objects; the sub-contents in the array to be parsed are sequentially identified based on the preset parameter object prefix to determine the identification result of the sub-contents, including: The sub-contents in the array to be parsed are sequentially acquired, and when it is determined based on a preset parameter object prefix that the first n sub-contents are all command objects, the first n sub-contents are sequentially determined as command objects of the first to nth levels; n is a positive integer; The remaining sub-contents are determined as parameter objects of the command object at the nth level.

4. The method according to claim 2, characterized in that: The parameter object includes a parameter name and a parameter value; the method further includes: Grouping the parameter objects in the array to be parsed to obtain at least one parameter data; Based on the legality condition corresponding to the command object, a legality check is performed on each parameter data to obtain a legality check result.

5. The method according to claim 4, characterized in that The parameter data includes a parameter name; the legitimacy check is performed on each parameter data based on the legitimacy condition corresponding to the command object to obtain a legitimacy check result, including: Obtain necessary parameters corresponding to the command object; The legality detection result is determined based on the necessary parameters and the parameter names corresponding to the command object.

6. The method according to claim 4, characterized in that The parameter data includes a parameter name and a corresponding parameter value; the legitimacy check is performed on each parameter data based on the legitimacy condition corresponding to the command object to obtain a legitimacy check result, including: Obtain the valid range of parameter values ​​corresponding to each of the parameter names; The legality detection result is determined based on the valid range of the parameter value corresponding to each of the parameter names and the parameter value corresponding to each of the parameter names.

7. The method according to claim 4, characterized in that The parameter data includes a parameter name; the legitimacy check is performed on each parameter data based on the legitimacy condition corresponding to the command object to obtain a legitimacy check result, including: Get the parameter list corresponding to the command object; The validity check result is determined based on the parameter list and the parameter name corresponding to the command object.

8. The method according to claim 5, characterized in that The method further comprises: In the case where the command object has necessary parameters and the array to be parsed does not have parameter objects, first guide data of the necessary parameters are displayed on the command line interface based on the necessary parameters corresponding to the command object; the first guide data is used to indicate the valid range of parameter values ​​of the necessary parameters; The parameter value input is received through the command line interface, and when the parameter value satisfies the parameter value valid range, it is combined with the parameter name of the necessary parameter to form parameter data corresponding to the necessary parameter.

9. The method according to any one of claims 1 to 8, characterized in that: The management command includes an add command; and when the parsing result indicates that the content to be parsed is a management command in the tool set, command management is performed on the tool set based on the management command corresponding to the content to be parsed, including: In the case where the parsing result indicates that the content to be parsed is the add command, based on the tool data structure corresponding to the toolset, second guide data of the add command is displayed on the command line interface; the second guide data is used to indicate the field name in the tool data structure to be added; The field value input is received through the command line interface and combined with the field name to form the field data of the add command.

10. The method according to any one of claims 1 to 9, characterized in that: The management command includes a delete command; and when the parsing result indicates that the content to be parsed is a management command in the toolset, command management is performed on the toolset based on the management command corresponding to the content to be parsed, including: In the case that the parsing result indicates that the content to be parsed is the deletion command, the command object corresponding to the sequence number is deleted from the custom command set based on the deleted sequence number.

11. The method according to any one of claims 1 to 10, characterized in that: The management command includes a display command; and when the parsing result indicates that the content to be parsed is a management command in the tool set, command management is performed on the tool set based on the management command corresponding to the content to be parsed, including: When the parsing result indicates that the content to be parsed is the display command, all command objects are displayed in a tree structure based on the hierarchical relationship between command objects.

12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises at least one of the following: In response to a command line interface startup event, loading a configuration file of the toolset from a preset configuration file storage address, and decoding the configuration file based on a decoding function to obtain a data structure object that can be called by the command line interface; In response to a data saving event, encoding a data structure object corresponding to the toolset, generating a configuration file of the toolset, and storing the configuration file of the toolset based on a preset configuration file storage address; If the parsing result indicates that the content to be parsed is a custom command in the toolset, and the first executable file corresponding to the custom command is executable, executing the custom command; When the parsing result indicates that the content to be parsed is a custom command in the tool set and the custom command is not executable, displaying help information; Packaging the script data of the tool set based on a packaging program, generating a second executable file and placing the second executable file in a first preset path; Based on the configuration file, an automatic completion script is generated and placed in a second preset path.

13. A command management device based on a toolset, characterized in that: The device comprises: An acquisition module, used to acquire the input content to be parsed in the command line interface and the tool data structure corresponding to the tool set; the tool data structure includes attribute information of each command in the tool set; A parsing module, used for parsing the content to be parsed based on the attribute information of each command in the tool set to obtain a parsing result; The management module is used to perform command management on the toolset based on the management command corresponding to the content to be analyzed when the analysis result indicates that the content to be analyzed is a management command in the toolset.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 12 are implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 12 are implemented.