Instruction execution method and device, electronic equipment and storage medium

By generating a knowledge graph and compliance rule base dynamically update storage resource metadata, the problem of insufficient understanding of user instruction context in the storage management system is solved, and more efficient instruction analysis and secure operation are achieved.

CN120508317AActive Publication Date: 2025-08-19INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511006596.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-08-19
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

The existing storage management system lacks a deep understanding of the context semantics in user instructions, resulting in frequent misoperation of instructions, limited intent recognition capabilities, poor scalability, high maintenance costs, and difficult to adapt to complex operations and new functions.

Method used

By generating a knowledge graph, training a natural language processing model, decomposing operation instructions into an atomic operation sequence, and performing compliance verification, generating operation results, combining compliance rule database and user permission management, dynamically update the storage resource metadata graph.

Benefits of technology

It improves the capabilities of the storage management system in intelligent instruction analysis, risk control and adaptive expansion, improves operation accuracy and security, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508317A_ABST
    Figure CN120508317A_ABST
Patent Text Reader

Abstract

The invention discloses an instruction execution method, which relates to the technical field of artificial intelligence, and comprises the following steps: receiving an operation instruction input by a user; generating a knowledge graph according to the storage resource object at the front end and the metadata of the storage resource object, and training the natural language processing model through the knowledge graph to obtain an instruction analysis model; decomposing the operation instruction through an instruction analysis model to generate an atomic operation sequence which comprises at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule base; and in response to the atomic operation sequence passing the compliance verification, executing an operation on the atomic operation sequence passing the compliance verification, and generating an operation result of the operation instruction, thereby solving the technical problems of lack of deep understanding of context semantics in the user instruction and poor expansibility. The technical effect of improving the capabilities of the storage management system in the aspects of intelligent instruction analysis, risk control and adaptive expansion is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an instruction execution method, device, electronic device, and storage medium. Background Art

[0002] Current storage management systems generally rely on web-based graphical user interfaces (GUIs) for resource management. These systems typically consist of pre-set functional modules and fixed interaction paths. They lack a deep understanding of the contextual semantics of user commands and the ability to dynamically model the system's internal resource structure. This design approach can easily lead to the following problems in practice: First, frequent command errors: Because the system cannot accurately understand user intent, incorrect operations are prone to execution, especially in complex or multi-step operations. Second, intent recognition capabilities are limited: GUI interfaces only support fixed entry points and are difficult to adapt to the needs of interpreting commands generated by natural language or free input. In addition, although some systems have attempted to introduce knowledge graph technology to improve semantic understanding and intelligent reasoning capabilities, these graphs are usually pre-built static domain knowledge graphs with obvious limitations: First, poor scalability: when the system adds new functions or resource types, the existing knowledge graphs are difficult to update and adapt quickly, resulting in the inability of the intelligent agent to support new functions in a timely manner; second, high maintenance costs: manual maintenance of knowledge graphs can easily lead to data inconsistencies, information omissions and other problems, affecting the accuracy and completeness of the system; third, insufficient functional coverage: as the system evolves, the original graph may not be able to cover new operation paths or resource relationships, resulting in delayed and missing functional support.

[0003] Therefore, in order to address the shortcomings of the prior art solutions, the present invention provides an instruction execution method. Summary of the Invention

[0004] The present application provides an instruction execution method, apparatus, device and storage medium to at least solve the problems in the related art of lacking a deep understanding of the contextual semantics in user instructions and poor scalability.

[0005] The present application provides an instruction execution method, which includes: receiving an operation instruction input by a user; generating a knowledge graph based on a front-end storage resource object and metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule library; in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

[0006] The present application also provides an instruction execution device, which includes: a first processing module for receiving operation instructions input by a user; a second processing module for generating a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects, and training the natural language processing model through the knowledge graph to obtain an instruction parsing model; a third processing module for decomposing the operation instructions through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; a fourth processing module for performing compliance verification on the atomic operation sequence according to a compliance rule library; and a fifth processing module for performing an operation on the atomic operation sequence that has passed the compliance verification in response to the atomic operation sequence passing the compliance verification to generate an operation result of the operation instruction.

[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; a processor for implementing the following steps when executing the computer program: receiving an operation instruction input by a user; generating a knowledge graph based on a front-end storage resource object and metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule base; in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein the steps implemented when the computer program is executed by a processor are as follows: receiving an operation instruction input by a user; generating a knowledge graph based on the storage resource object of the front end and the metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule library; in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

[0009] The present application also provides a computer program product, including a computer program, which implements the following steps when executed by a processor: receiving an operation instruction input by a user; generating a knowledge graph based on the storage resource object of the front end and the metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule library; in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

[0010] Through this application, since the operation instructions input by the user are received; a knowledge graph is generated according to the front-end storage resource objects and the metadata of the storage resource objects, the natural language processing model is trained through the knowledge graph to obtain an instruction parsing model; the operation instructions are decomposed through the instruction parsing model to generate an atomic operation sequence; the atomic operation sequence is compliance verified according to the compliance rule library; in response to the atomic operation sequence passing the compliance verification, the operation is performed on the atomic operation sequence that passes the compliance verification to generate the operation result of the operation instruction. Therefore, a storage resource metadata graph mechanism is automatically constructed and continuously updated, combined with source code parsing and natural language processing technology, to achieve dynamic modeling and semantic understanding of storage resource objects and their operation behaviors, thereby improving the storage management system's capabilities in intelligent instruction parsing, risk control and adaptive expansion. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 A flowchart of an instruction execution method provided in an embodiment of the present application; Figure 2 A schematic diagram of a framework of an instruction execution method provided in an embodiment of the present application; Figure 3 A structural block diagram of an instruction execution device provided in an embodiment of the present application; Figure 4 This is a diagram of the internal structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0014] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0015] It should be noted that the terms "S1", "S2", etc. are used only for the purpose of describing the steps and do not specifically refer to the order or sequence, nor are they used to limit this application. They are merely for the convenience of describing the method of this application and should not be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0017] The embodiments of the present application provide an instruction execution method, and the method is described in detail in conjunction with the execution flow of the instruction execution method.

[0018] S101: receiving an operation instruction input by a user.

[0019] Here, the operation instruction is a natural language instruction, such as "view storage pool A" or "create a pool and create a volume with a capacity of 1 TB".

[0020] The operation instructions may include query instructions and configuration instructions.

[0021] The operation instruction is used in the storage system to operate the storage objects in the storage system.

[0022] The execution subject may be an intelligent agent, specifically a storage system management intelligent agent.

[0023] S102: Generate a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects, and train the natural language processing model through the knowledge graph to obtain an instruction parsing model.

[0024] Here, the front end refers to the part responsible for the user interface and user experience, directly interacting with the user, displaying information and receiving user input.

[0025] Here, storage resource objects can include resource pool, disk, raid, vdisk, host, vdisk_host_map, user, snapshot, clone, backup, enclosure, battery, power_supply, fan, etc.

[0026] Here, the metadata of the storage resource object may include attributes, operation type, operation risk level, operation-related API, and relationship with other storage resource objects.

[0027] Here, a knowledge graph is a model used to represent and store knowledge, usually consisting of nodes and edges, where nodes refer to objects or concepts in the knowledge graph and edges define the connections between nodes.

[0028] Here, the natural language processing (NLP) model can be an LLM (Large Language Model), a deep learning model (such as a recurrent neural network, a convolutional neural network, a Transformer architecture, etc.), a rule-based model, a statistical model, a multimodal model, or transfer learning.

[0029] Among them, the natural language processing model is a model pre-trained based on data in the storage system.

[0030] Among them, the instruction parsing model is embedded after the knowledge graph is trained.

[0031] In one embodiment, training a natural language processing model through a knowledge graph may include: encoding the knowledge graph through a graph neural network, converting each node and edge in the knowledge graph into a vector, randomly collecting node paths based on the graph, combining the edges in the path into an operation sequence, converting the operation sequence into a vector, and inputting the vector corresponding to the operation sequence, the vector corresponding to the node, and the vector corresponding to the edge as additional features into the natural language processing model to train the natural language processing model.

[0032] Specifically, node paths can be collected through random walks, weight-based walks, or task-based target paths.

[0033] In this way, the graph path can provide contextual background and improve the model's ability to understand complex instructions; at the same time, the operation sequence can serve as a structural constraint to prevent the model from outputting illegal paths; based on the operation path of the knowledge graph, the model can generalize new paths from known paths and improve parsing capabilities.

[0034] S103: Decompose the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation.

[0035] Here, atomic operation refers to an operation that cannot be interrupted during execution and has the characteristic of "all or nothing".

[0036] Here, the atomic operation sequence is a sequence of multiple atomic operations arranged in a logical order of operations.

[0037] For example, assuming the operation instruction is "create a pool and create a volume with a capacity of 1T", through the instruction parsing model, the operation instruction of "create a pool and create a volume with a capacity of 1T" is parsed into three atomic operations: "create a storage pool", "create RAID" and "create a volume", and then formed into the atomic operation sequence of "create a storage pool, create RAID, create a volume" in the logical order of the operations.

[0038] S104: Perform compliance verification on the atomic operation sequence according to the compliance rule base.

[0039] The compliance rule base may be generated according to the current storage system, or may be a predefined fixed rule base, or may be a rule base generated according to the current storage system combined with a predefined rule base.

[0040] Compliance verification can include permission verification, regularity verification, required field verification, input range verification, and precondition verification.

[0041] S105: In response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification, and generating an operation result of the operation instruction.

[0042] Specifically, a storage system application programming interface (API), such as a command-line interface (CLI), may be called to execute corresponding instructions.

[0043] Specifically, the operation result may be sent to the user interface, which may include displaying the operation result in the user interface through readable semantic text description, displaying the result in a structured chart, automatically jumping to a target page, etc.

[0044] Specifically, for configuration operations, the details of the relevant configuration operation objects can be displayed to the user in a tabular form while returning the result of a successful operation; for query operations, if there is a lot of attribute information, it can be displayed in a tabular form in the user interface; if there is less attribute information, it can be displayed in the user interface as semantic content. For data that needs to be displayed in charts, the WEB page can be automatically switched to the target page.

[0045] It should be noted that this application realizes dynamic modeling and semantic understanding of storage resource objects and their operation behaviors through an automatically constructed and continuously updated storage resource metadata map mechanism, combined with source code parsing and natural language processing technology, thereby enhancing the storage management system's capabilities in intelligent instruction parsing, risk control and adaptive expansion.

[0046] In some specific implementations, generating a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects includes: Parse the front-end source code files to determine the storage resource objects and their metadata; Determine the relationship between storage resource objects based on the metadata of the storage resource objects; The storage resource objects are regarded as nodes and the relationships between the storage resource objects are regarded as edges to generate a knowledge graph.

[0047] Here, the front-end source code files may include HTML source code files and JavaScript source code files.

[0048] The HTML (Hyper Text Markup Language) source code file is the source code corresponding to the table component and the attribute display component. By parsing the HTML source code file, the attribute list of the storage resource object and the corresponding operation name can be obtained.

[0049] Among them, the JavaScript source code file may include the front-end code logic. By parsing the JavaScript source code file, the operation risk level, operation API, etc. can be obtained.

[0050] Here, the relationship between storage resource objects may include inclusion, dependency, conversion, association, connection, association, etc.

[0051] Among them, the storage resource objects and the relationships between storage resource objects are automatically integrated according to a structured method to generate a knowledge graph.

[0052] Specifically, the preset knowledge graph framework can be as follows: raid,contains,drive pool,contains,raid pool,contains,vdisk vdisk,map,host … Specifically, the knowledge graph example can be as follows: { "nodes":[ { “nodeName”:”pool”, "nodeProperties":["id","name",…], "relatedNodes":[ { “nodeName”:“drive”, "relationship":"contains", "action":"add nodeA to nodeB" "actionLevel":"Normal", }, { “nodeName”:”vdisk”, "relationship","contains", "action":"create nodeA from nodeB", "actionLevel":"Warning", "actionTooltip": "This operation may cause..., do you want to continue?", } … ], "apis":[ { "apiName":"createPool", "apiInput":["name","ext"], … }, … ] }, … ]} In this way, the association network between storage resource objects can be intuitively displayed, providing a structured domain knowledge foundation for the natural language processing model.

[0053] In some specific implementations, the operation instruction is decomposed through the instruction parsing model to generate an atomic operation sequence, including: Identifying instruction keywords in the operation instruction through the instruction parsing model and determining at least one atomic operation, wherein the atomic operation includes a storage resource object and an operation type; Based on at least one atomic operation, determine whether the storage resource object and operation type in the atomic operation are logical through the knowledge graph; In response to the storage resource object and the operation type not being logically consistent, returning a result of the modification operation instruction; In response to the storage resource object and the operation type being logically consistent, determining a risk level of at least one atomic operation through a knowledge graph, where the risk levels include a first level, a second level, and a third level; In response to the existence of any atomic operation with a danger level of the first or second level, returning a result confirmed by the user; In response to the danger level of at least one atomic operation being the third level, the order of the at least one atomic operation is determined through the knowledge graph to obtain an atomic operation sequence.

[0054] Among them, the atomic operation also includes the API interface corresponding to the operation.

[0055] The first level may be a critical level, the second level may be a warning level, and the third level may be a normal level.

[0056] Whether the storage resource object and operation type are logically consistent refers to whether the node information of the storage resource object node in the knowledge graph indicates whether the storage resource node supports the corresponding operation type. For example, if the storage resource object is "storage pool" and the operation type is "create", the information of the storage pool node in the knowledge graph will determine whether the create operation is included.

[0057] Specifically, the need for user reconfirmation and verification is determined based on the risk level of the operation. Critical-level operations require the user to enter a password for confirmation and are accompanied by a corresponding impact prompt stored in the knowledge graph. Warning-level operations require a single click to confirm again, with a corresponding impact prompt defined in the knowledge graph. Normal-level operations do not require user reconfirmation and verification, and the request is issued directly.

[0058] In one embodiment, the instruction parsing model can supplement missing steps based on the atomic operations and knowledge graph obtained through parsing. For example, if the instruction is "Help me create a pool and a volume with a capacity of 1TB," the instruction parsing model will identify the instruction keywords "create pool" and "create volume." The instruction parsing model will also recognize from the knowledge graph that the "create RAID" step is required between creating the pool and creating the volume, and thus supplement the "create RAID" step.

[0059] Specifically, for the "create pool" atomic operation, where the storage resource object is the storage pool and the operation type is create, whether the creation operation is supported is determined based on whether the storage pool node in the knowledge graph supports the creation operation. When it does not exist in the knowledge graph, the result that needs to be modified is returned to the user interface. When it exists in the knowledge graph, based on the danger level of the current operation in the knowledge graph, it is determined whether it is necessary to return to the user interface and let the user confirm the verification operation again.

[0060] Specifically, after each atomic operation instruction passes the logic check and the danger level check, the relationship between the atomic operations is obtained according to the node relationship in the knowledge graph, thereby obtaining the atomic operation sequence.

[0061] In this way, converting high-level semantics into low-level executable actions can improve the accuracy and executableness of the system.

[0062] In some specific implementations, compliance verification is performed on an atomic operation sequence according to a compliance rule library, including: Based on the compliance rule base, check whether the atomic operation sequence meets the user's permissions; In response to the atomic operation sequence satisfying the user authority, detecting whether parameters of the atomic operation sequence satisfy parameter rules according to a compliance rule library; In response to the atomic operation sequence satisfying the parameter rule, it is determined that the atomic operation sequence passes the compliance verification.

[0063] User permissions vary depending on the user role, which can include administrator, auditor, etc.

[0064] Specifically, based on the current operating user role, it is checked whether there is permission to execute the atomic operation sequence. After the permission check is passed, it is further checked whether the parameters of the atomic operation sequence meet the parameter rules.

[0065] For example, auditors cannot perform configuration operations such as creating a storage pool.

[0066] For example, if the number of storage pools reaches the maximum specification, when the user issues a "create a storage pool" operation instruction, the modification and error reason will be automatically returned to the user interface.

[0067] In this way, unauthorized and illegal operations of operating instructions can be avoided, improving usability and security.

[0068] In some embodiments, the method further comprises: Parse the front-end source code file to obtain user permissions and parameters; Generate permission rule base based on user permissions; Generate parameter rule base according to parameters; Generate a compliance rule base based on the permission rule base and parameter rule base.

[0069] Here, the parameter rule base may include regularity check, required field check, input range check, precondition check, etc.

[0070] Specifically, regular check can be used to check whether the characters in the operation instruction are within the preset length range, etc., mandatory check can be used to check whether the missing parameters in the operation instruction are required or empty, input range check can be used to check whether the parameter range in the operation instruction is qualified, and precondition check can be used to check whether the system status meets the execution conditions and whether the dependent fields exist.

[0071] Specifically, the HTML source code file and JavaScript source code file of the front end are obtained, the source code files are parsed, the permissions corresponding to each user are obtained, and a permission rule library is generated.

[0072] Specifically, the HTML source code file and JavaScript source code file of the front end are obtained, the source code files are parsed, the parameter range corresponding to each parameter is obtained, and a parameter rule library is generated. For example, the parameter range may include: the number of storage pools is less than 512.

[0073] Specifically, the compliance rule base can be as follows: { "api": "createPool", "param_constraints": [ {"name": "ext", "type": "integer", "range": [1024, 2048,4096}, {"name": "name", "type": "string", "pattern": "^[a-zA-Z0-9_-]+$"} ], "condition_checks": [ {"condition": "pool_count<512"}, ]} In one embodiment, when a user edits the front-end source code, the knowledge graph and compliance rule base will be regenerated based on the edited front-end source code, which can achieve efficient synchronous upgrade of the instruction execution system when new functions are added to the front-end.

[0074] In some embodiments, the method further comprises: In response to an atomic operation in the atomic operation sequence failing compliance verification, returning a result confirmed by the user; Receive confirmation from the user that the atomic operation is valid; Obtain user permissions and parameters corresponding to the atomic operation, update the compliance rule base according to the user permissions and parameters, and obtain an updated compliance rule base.

[0075] Specifically, after compliance verification fails, if the user confirms that the atomic operation is valid, he or she can force the request to be resent. At this time, the atomic operation will not be intercepted, and the restrictions in the compliance rule library will be adjusted autonomously according to the parameters of the current atomic operation.

[0076] For example, assume that the compliance rule base specifies that the range of values for the extended block size parameter for pool creation is [1024, 2048, 4096]. A user enters the command "Create a storage pool with an extended block size of 512." Initially, the operation is intercepted because compliance verification fails. The user clicks "Confirm parameters are correct" in the feedback result, forcing the operation again. At this point, 512 is added to the extended block size parameter value range.

[0077] In this way, the compliance rule base is dynamically updated to improve judgment accuracy.

[0078] In some embodiments, the method further comprises: Obtain at least one operation instruction input by a user within a preset period, calculate the similarity between the operation instruction and a previous operation instruction, and determine the operation instruction whose similarity is greater than a preset value; From the operation instructions whose similarity is greater than a preset value, filter the operation instructions and the operation instructions whose previous operation instructions have not passed the compliance verification, and count the number of operation instructions; The number is used as the penalty coefficient of the instruction parsing model, and the instruction parsing model is fed back and learned through the penalty coefficient.

[0079] Here, the penalty coefficient represents the negative impact of a decision or behavior.

[0080] The penalty coefficient can be a linear penalty, an exponential penalty, or a Boolean penalty.

[0081] Among them, feedback learning can include reinforcement learning, rule weight update, loss function optimization or log-driven tuning.

[0082] Specifically, the preset period is set to T, and every time a preset period comes, each operation instruction information I recorded in the preset period is counted. i 1, i 2,..., in}; Calculate the number of consecutive similar instructions that have not passed compliance verification within the preset period using formula (1), which is as follows: (1) in, S ( i j , i k ) is the instruction i j With instructions i k Similarity function (value [0, 1]), is the similarity threshold, which can be any value between 0.7 and 0.9. E is the set of operation instructions that have passed compliance verification. N is the number of similar instructions. [] indicates that it takes 1 when the condition is met and takes 0 otherwise. The formula indicates that if both the current instruction and the previous instruction fail compliance verification and the similarity is greater than or equal to the similarity threshold τ, the count N is incremented by 1.

[0083] For example, assume that there is an instruction sequence in the time window (similarity threshold τ=0.8), and there are five operation instructions: Command 1. "Expand Volume A" (Compliance Verification Passed); Instruction 2: "Expand Volume A" (failed compliance verification, similarity to instruction 1: 0.9); Instruction 3: "Increase Volume A Capacity" (failed compliance verification, similarity to instruction 2: 0.85); Instruction 4. "Delete logs" (pass compliance verification); Instruction 5: "Remove log files" (failed compliance verification, similarity to instruction 4: 0.6).

[0084] The operation instruction is calculated using formula 1, and the process is as follows: Instruction 2: The previous instruction 1 passed the compliance verification, but did not meet the conditions, and the value was 0; Instruction 3: Instruction 3 fails compliance verification, the previous instruction 2 fails compliance verification, and the similarity between instructions 3 and 2 is greater than the threshold. The condition is met and the value is 1; Instruction 4: Passes compliance verification, fails to meet the conditions, and takes the value 0; Instruction 5: The previous instruction 4 passed the compliance verification, and the similarity is lower than the threshold. The condition is not met and the value is 0; Final result: N = 0 + 1 + 0 + 0 = 1.

[0085] In this way, the instruction parsing model can be corrected in time according to the historical operation instruction records to improve the accuracy of instruction parsing.

[0086] In one embodiment, Figure 2 This is a schematic diagram of the framework in the embodiment of the present application, such as Figure 2 As shown, the framework in this application includes: a model adjustment module, an instruction parsing module, a compliance verification module, a resource operation module and a feedback generation module.

[0087] Specifically, the model adjustment module is used to record and count the user's historical instruction information within a certain period, measure the accuracy of instruction parsing based on the number of times the user corrects the instruction, and use this as a basis to reversely correct the instruction parsing model parameters to improve the accuracy of user instruction understanding.

[0088] Specifically, the instruction parsing module includes a knowledge graph generation module, a semantic parsing module, and an operation decomposition module. The knowledge graph generation module is used to automatically parse the front-end framework source code files based on the initial storage resource object information and automatically generate a knowledge graph of the storage resource metadata. The knowledge graph uses each storage resource object as a node, and connects each object with object associations and operation names. Each node contains the attribute information, associated APIs, and other information of the resource object. The knowledge graph will be used to train the instruction parsing model; the semantic parsing model is used to perform preliminary recognition and parsing of user input instructions; and the operation decomposition module is used to decompose natural language instructions into executable atomic API operation sequences.

[0089] Specifically, the compliance verification module includes a compliance rule generation module, a permission verification module, and a constraint verification module. The compliance rule generation module automatically generates a compliance detection rule base based on the existing storage web management interface; the permission verification module automatically intercepts unauthorized operations based on user roles (e.g., administrator, auditor); and the constraint verification module automatically intercepts illegal operations based on constraints.

[0090] Specifically, the resource operation module is used to call the storage system API (such as CLI) to execute instructions.

[0091] Specifically, the feedback generation module is used to display the results in a friendly manner according to different processing scenarios of the request, including readable semantic text descriptions, structured display of results in charts, and automatic jump to the target page.

[0092] It should be understood that although Figure 1 and Figure 2The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 and Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0094] An embodiment of the present application also provides an instruction execution device, which includes: a first processing module 301, used to receive operation instructions input by a user; a second processing module 302, used to generate a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects, and train the natural language processing model through the knowledge graph to obtain an instruction parsing model; a third processing module 303, used to decompose the operation instructions through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; a fourth processing module 304, used to perform compliance verification on the atomic operation sequence according to a compliance rule base; a fifth processing module 305, used to perform an operation on the atomic operation sequence that has passed the compliance verification in response to the atomic operation sequence passing the compliance verification, and generate an operation result of the operation instruction.

[0095] As a preferred implementation method, in an embodiment of the present application, the second processing module 302 is specifically used to: parse the source code file of the front end to determine the storage resource objects and the metadata of the storage resource objects; determine the relationship between the storage resource objects based on the metadata of the storage resource objects; use the storage resource objects as nodes and the relationships between the storage resource objects as edges to generate a knowledge graph.

[0096] As a preferred implementation method, in an embodiment of the present application, the third processing module 303 is specifically used to: identify instruction keywords in the operation instruction through an instruction parsing model, and determine at least one atomic operation, wherein the atomic operation includes a storage resource object and an operation type; based on at least one atomic operation, determine whether the storage resource object and the operation type in the atomic operation are logical through a knowledge graph; in response to the storage resource object and the operation type being illogical, return the result of modifying the operation instruction; in response to the storage resource object and the operation type being logical, determine the danger level of at least one atomic operation through a knowledge graph, wherein the danger level includes the first level, the second level, and the third level; in response to the existence of any atomic operation with a danger level of the first level or the second level, return a user-confirmed result; in response to the danger level of at least one atomic operation being the third level, determine the order of at least one atomic operation through a knowledge graph to obtain an atomic operation sequence.

[0097] As a preferred implementation method, in an embodiment of the present application, the fourth processing module 304 is specifically used to: detect whether the atomic operation sequence satisfies user permissions based on the compliance rule base; in response to the atomic operation sequence satisfying the user permissions, detect whether the parameters of the atomic operation sequence satisfy the parameter rules based on the compliance rule base; in response to the atomic operation sequence satisfying the parameter rules, determine that the atomic operation sequence passes the compliance verification.

[0098] As a preferred implementation method, in the embodiment of the present application, the device also includes a generation module, which is specifically used to: parse the front-end source code file to obtain user permissions and parameters; generate a permission rule base based on user permissions; generate a parameter rule base based on parameters; and generate a compliance rule base based on the permission rule base and the parameter rule base.

[0099] As a preferred implementation method, in an embodiment of the present application, the device also includes an update module, which is specifically used to: return a user-confirmed result in response to an atomic operation in the atomic operation sequence that fails compliance verification; receive confirmation from the user that the atomic operation is valid; obtain user permissions and parameters corresponding to the atomic operation, and update the compliance rule library according to the user permissions and parameters to obtain an updated compliance rule library.

[0100] As a preferred implementation, in an embodiment of the present application, the device also includes a feedback module, which is specifically used to: obtain at least one operation instruction input by the user within a preset period, calculate the similarity between the operation instruction and the previous operation instruction, and determine the operation instruction whose similarity is greater than the preset value; from the operation instructions with a similarity greater than the preset value, filter the operation instructions and the operation instructions that have not passed the compliance verification of the previous operation instruction, and count the number of operation instructions; use the number as a penalty coefficient of the instruction parsing model, and perform feedback learning on the instruction parsing model through the penalty coefficient.

[0101] For the description of the features in the embodiment corresponding to the instruction execution device, please refer to the relevant description of the embodiment corresponding to the instruction execution method, and no further details will be given here.

[0102] The embodiment of the present application further provides an electronic device, which may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an instruction execution method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0103] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0104] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: S1: receiving an operation instruction input by a user; S2: generating a knowledge graph based on a front-end storage resource object and metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; S3: decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; S4: performing compliance verification on the atomic operation sequence according to a compliance rule base; S5: in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passes the compliance verification to generate an operation result of the operation instruction.

[0105] In one embodiment, when the processor executes the computer program, it also implements the following steps: parsing the source code file of the front end to determine the storage resource objects and the metadata of the storage resource objects; determining the relationship between the storage resource objects based on the metadata of the storage resource objects; and generating a knowledge graph using the storage resource objects as nodes and the relationships between the storage resource objects as edges.

[0106] In one embodiment, when the processor executes the computer program, it also implements the following steps: identifying instruction keywords in the operation instruction through the instruction parsing model, determining at least one atomic operation, wherein the atomic operation includes a storage resource object and an operation type; based on the at least one atomic operation, determining whether the storage resource object and the operation type in the atomic operation are logical through the knowledge graph; in response to the storage resource object and the operation type being illogical, returning the result of modifying the operation instruction; in response to the storage resource object and the operation type being logical, determining the danger level of at least one atomic operation through the knowledge graph, wherein the danger level includes the first level, the second level and the third level; in response to the existence of any atomic operation with a danger level of the first level or the second level, returning a user-confirmed result; in response to the danger level of at least one atomic operation being the third level, determining the order of at least one atomic operation through the knowledge graph to obtain an atomic operation sequence.

[0107] In one embodiment, when the processor executes the computer program, it also implements the following steps: according to the compliance rule base, detecting whether the atomic operation sequence satisfies the user authority; in response to the atomic operation sequence satisfying the user authority, detecting whether the parameters of the atomic operation sequence satisfy the parameter rules according to the compliance rule base; in response to the atomic operation sequence satisfying the parameter rules, determining that the atomic operation sequence passes the compliance verification.

[0108] In one embodiment, when executing a computer program, the processor further implements the following steps: parsing the source code file of the front end to obtain user permissions and parameters; generating a permission rule base based on the user permissions; generating a parameter rule base based on the parameters; and generating a compliance rule base based on the permission rule base and the parameter rule base.

[0109] In one embodiment, when the processor executes the computer program, it also implements the following steps: in response to an atomic operation in the atomic operation sequence failing compliance verification, returning a result confirmed by the user; receiving confirmation returned by the user that the atomic operation is valid; obtaining user permissions and parameters corresponding to the atomic operation, and updating the compliance rule library according to the user permissions and parameters to obtain an updated compliance rule library.

[0110] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining at least one operation instruction input by the user within a preset period, calculating the similarity between the operation instruction and the previous operation instruction, and determining the operation instruction whose similarity is greater than a preset value; from the operation instructions whose similarity is greater than the preset value, filtering the operation instructions and the operation instructions that have not passed the compliance verification of the previous operation instruction, and counting the number of operation instructions; using the number as a penalty coefficient of the instruction parsing model, and performing feedback learning on the instruction parsing model through the penalty coefficient.

[0111] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: S1: receiving an operation instruction input by a user; S2: generating a knowledge graph based on a front-end storage resource object and metadata of the storage resource object, and training a natural language processing model through the knowledge graph to obtain an instruction parsing model; S3: decomposing the operation instruction through the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; S4: performing compliance verification on the atomic operation sequence according to a compliance rule base; S5: in response to the atomic operation sequence passing the compliance verification, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: parsing the source code file of the front end to determine the storage resource objects and the metadata of the storage resource objects; determining the relationship between the storage resource objects based on the metadata of the storage resource objects; using the storage resource objects as nodes and the relationship between the storage resource objects as edges to generate a knowledge graph.

[0113] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: through the instruction parsing model, the instruction keywords in the operation instruction are identified to determine at least one atomic operation, wherein the atomic operation includes a storage resource object and an operation type; based on the at least one atomic operation, through the knowledge graph, whether the storage resource object and the operation type in the atomic operation are logical; in response to the storage resource object and the operation type being illogical, the result of modifying the operation instruction is returned; in response to the storage resource object and the operation type being logical, the danger level of at least one atomic operation is determined through the knowledge graph, wherein the danger level includes the first level, the second level and the third level; in response to the existence of any atomic operation with a danger level of the first level or the second level, a user-confirmed result is returned; in response to the danger level of at least one atomic operation being the third level, the order of at least one atomic operation is determined through the knowledge graph to obtain an atomic operation sequence.

[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the compliance rule base, whether the atomic operation sequence satisfies the user authority is detected; in response to the atomic operation sequence satisfying the user authority, according to the compliance rule base, whether the parameters of the atomic operation sequence satisfy the parameter rules; in response to the atomic operation sequence satisfying the parameter rules, determining that the atomic operation sequence passes the compliance verification.

[0115] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: parsing the source code file of the front end to obtain user permissions and parameters; generating a permission rule base based on the user permissions; generating a parameter rule base based on the parameters; generating a compliance rule base based on the permission rule base and the parameter rule base.

[0116] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to an atomic operation in the atomic operation sequence failing compliance verification, returning a result confirmed by the user; receiving confirmation returned by the user that the atomic operation is valid; obtaining user permissions and parameters corresponding to the atomic operation, and updating the compliance rule library according to the user permissions and parameters to obtain an updated compliance rule library.

[0117] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining at least one operation instruction input by the user within a preset period, calculating the similarity between the operation instruction and the previous operation instruction, and determining the operation instruction whose similarity is greater than a preset value; from the operation instructions whose similarity is greater than the preset value, filtering the operation instructions and the operation instructions that have not passed the compliance verification of the previous operation instruction, and counting the number of operation instructions; using the number as a penalty coefficient of the instruction parsing model, and performing feedback learning on the instruction parsing model through the penalty coefficient.

[0118] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0119] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make numerous variations and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application.

Claims

1. A method for executing an instruction, characterized in that: The method comprises: Receive operation instructions input by the user; Generate a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects, and train a natural language processing model through the knowledge graph to obtain an instruction parsing model; Decomposing the operation instruction by using the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; Performing compliance verification on the atomic operation sequence according to a compliance rule base; In response to the atomic operation sequence passing the compliance verification, an operation is performed on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction.

2. The instruction execution method according to claim 1, wherein: Generating a knowledge graph based on the front-end storage resource object and the metadata of the storage resource object includes: Parsing the source code file of the front end to determine the storage resource object and metadata of the storage resource object; determining, based on metadata of the storage resource objects, the relationship between the storage resource objects; The knowledge graph is generated by taking the storage resource objects as nodes and the relationships between the storage resource objects as edges.

3. The instruction execution method according to claim 1, wherein: Decomposing the operation instruction by the instruction parsing model to generate an atomic operation sequence includes: Identifying instruction keywords in the operation instruction through the instruction parsing model and determining at least one atomic operation, wherein the atomic operation includes the storage resource object and the operation type; Based on the at least one atomic operation, determining, through the knowledge graph, whether the storage resource object in the atomic operation and the operation type are logical; In response to the storage resource object and the operation type not being logically consistent, returning a result of modifying the operation instruction; In response to the storage resource object and the operation type being logically consistent, determining a risk level of the at least one atomic operation through the knowledge graph, wherein the risk level includes a first level, a second level, and a third level; In response to the existence of any atomic operation with a danger level of the first or second level, returning a result confirmed by the user; In response to the danger level of the at least one atomic operation being the third level, the order of the at least one atomic operation is determined through the knowledge graph to obtain the atomic operation sequence.

4. The instruction execution method according to claim 1, wherein: The step of performing compliance verification on the atomic operation sequence according to the compliance rule base includes: According to the compliance rule library, detecting whether the atomic operation sequence satisfies user permissions; In response to the atomic operation sequence satisfying the user authority, detecting whether parameters of the atomic operation sequence satisfy parameter rules according to the compliance rule library; In response to the atomic operation sequence satisfying the parameter rule, it is determined that the atomic operation sequence passes the compliance verification.

5. The instruction execution method according to claim 4, characterized in that: The method further comprises: Parse the source code file of the front end to obtain user permissions and parameters; Generate a permission rule library based on the user permissions; generating a parameter rule base according to the parameters; The compliance rule base is generated according to the authority rule base and the parameter rule base.

6. The instruction execution method according to claim 5, characterized in that: The method further comprises: In response to an atomic operation in the atomic operation sequence failing the compliance verification, returning a result confirmed by the user; Receiving confirmation from the user that the atomic operation is valid; User permissions and parameters corresponding to the atomic operation are obtained, and the compliance rule base is updated according to the user permissions and the parameters to obtain an updated compliance rule base.

7. The instruction execution method according to claim 1, wherein: The method further comprises: Obtain at least one operation instruction input by a user within a preset period, calculate the similarity between the operation instruction and a previous operation instruction, and determine the operation instruction whose similarity is greater than a preset value; From the operation instructions whose similarity is greater than a preset value, filter the operation instructions and the operation instructions whose previous operation instructions have not passed the compliance verification, and count the number of the operation instructions; The number is used as a penalty coefficient of the instruction parsing model, and feedback learning is performed on the instruction parsing model through the penalty coefficient.

8. An instruction execution device, characterized in that: The device comprises: A first processing module is used to receive an operation instruction input by a user; The second processing module is used to generate a knowledge graph based on the front-end storage resource objects and the metadata of the storage resource objects, and train the natural language processing model through the knowledge graph to obtain an instruction parsing model; A third processing module is configured to decompose the operation instruction using the instruction parsing model to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation; a fourth processing module, configured to perform compliance verification on the atomic operation sequence according to a compliance rule library; The fifth processing module is configured to, in response to the atomic operation sequence passing the compliance verification, perform an operation on the atomic operation sequence that has passed the compliance verification, and generate an operation result of the operation instruction.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the instruction execution method according to any one of claims 1 to 7 when executing a computer program.

10. A computer-readable storage medium, characterized in that A computer program is stored in a computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the instruction execution method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for translating natural language question to SQL (Structured Query Language) based on atlas

    CN115062052A

  • Instruction processing method and device, electronic equipment and storage medium

    CN116954719A

  • Instruction processing method based on training system, training system and storage medium

    CN119356766A

  • Control method and device for intelligent agent with body and readable storage medium

    CN119416881A

  • Configuration method and apparatus, and analysis method and apparatus for entities in knowledge graph

    WO2023169072A1