Instruction execution method and apparatus, electronic device, and storage medium

By generating knowledge graphs and training natural language processing models, decomposing and verifying user instructions for compliance, the problems of instruction misoperation and poor scalability in the storage management system are solved, dynamic modeling of storage resource objects and intelligent instruction parsing are achieved, and the accuracy and adaptability of the system are improved.

CN120508317BActive Publication Date: 2025-10-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing storage management systems lack a deep understanding of the contextual semantics in user commands, resulting in frequent misoperations, limited intent recognition capabilities, poor scalability, high maintenance costs, and difficulty in quickly updating and adapting existing knowledge graphs to new functions.

Method used

By generating knowledge graphs, training natural language processing models, decomposing operation instructions into atomic operation sequences, and performing compliance verification, and executing operations using a compliance rule base, dynamic modeling and semantic understanding of storage resource objects can be achieved.

Benefits of technology

It improves the storage management system's capabilities in intelligent instruction parsing, risk control, and adaptive expansion, reduces misoperations, improves the system's accuracy and executability, and has strong dynamic update capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508317B_ABST
    Figure CN120508317B_ABST
Patent Text Reader

Abstract

The application discloses an instruction execution method, 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 a storage resource object of a front end and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining an instruction analysis model; decomposing the operation instruction through the instruction analysis model, generating an atomic operation sequence, wherein the atomic operation sequence comprises at least one atomic operation; verifying the atomic operation sequence according to a compliance rule library; and in response to the atomic operation sequence passing the compliance verification, executing the atomic operation sequence that passes the compliance verification, generating an operation result of the operation instruction, and solving the technical problems of lacking deep understanding of context semantics in a user instruction and poor expansibility, so that the technical effect of improving the capability of a storage management system in 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 technical field of artificial intelligence, and in particular to an instruction execution method and device, an electronic device, and a storage medium. BACKGROUND

[0002] Current storage management systems generally rely on WEB-based graphical user interfaces (GUIs) for resource management operations. Such systems are usually composed of pre-set functional modules and fixed interaction paths, lack a deep understanding of the context semantics in user instructions, and lack the ability to dynamically structure model the internal resource structure of the system. This design approach can easily lead to the following problems in actual use: First, frequent instruction misoperations: due to the system's inability to accurately understand the user's intent, especially in complex or multi-step operations, it is easy to perform incorrect operations; second, limited intent recognition capability: the GUI interface only supports fixed operation entrances, making it difficult to adapt to instruction parsing requirements in natural language or free input forms. In addition, although some systems attempt to introduce knowledge graph technology to improve semantic understanding and intelligent reasoning capabilities, these graphs are usually pre-constructed static domain knowledge graphs, which have obvious limitations: first, poor scalability: when the system adds new functions or resource types, the existing knowledge graph is difficult to update and adapt quickly, causing the agent to be unable to support new functions in a timely manner; second, high maintenance cost: manual maintenance of the knowledge graph can lead to data inconsistencies, information omissions, and other problems, affecting the accuracy and integrity 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 a lag and lack of functional support.

[0003] Therefore, in view of the shortcomings of the prior art, the present application provides an instruction execution method. SUMMARY

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

[0005] The present application provides an instruction execution method, which includes: receiving an operation instruction input by a user; generating a knowledge graph according to a front-end storage resource object and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining 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; and in response to the atomic operation sequence passing the compliance verification, executing the atomic operation sequence that passes the compliance verification to generate an operation result of the operation instruction.

[0006] The application further provides an instruction execution device, which comprises: a first processing module configured to receive an operation instruction input by a user; a second processing module configured to generate a knowledge graph according to a front-end storage resource object and metadata of the storage resource object, train a natural language processing model through the knowledge graph, and obtain an instruction analysis model; a third processing module configured to decompose the operation instruction through the instruction analysis model, and generate an atomic operation sequence, wherein the atomic operation sequence comprises 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; and a fifth processing module configured to execute the atomic operation sequence that passes the compliance verification, and generate an operation result of the operation instruction in response to the atomic operation sequence passing the compliance verification.

[0007] The application further provides an electronic device, which comprises: a memory configured to store a computer program; and a processor configured to implement the following steps when executing the computer program: receiving an operation instruction input by a user; generating a knowledge graph according to a front-end storage resource object and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining an instruction analysis model; decomposing the operation instruction through the instruction analysis model, and generating an atomic operation sequence, wherein the atomic operation sequence comprises at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule library; and executing the atomic operation sequence that passes the compliance verification, and generating an operation result of the operation instruction in response to the atomic operation sequence passing the compliance verification.

[0008] The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the following steps: receiving an operation instruction input by a user; generating a knowledge graph according to a front-end storage resource object and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining an instruction analysis model; decomposing the operation instruction through the instruction analysis model, and generating an atomic operation sequence, wherein the atomic operation sequence comprises at least one atomic operation; performing compliance verification on the atomic operation sequence according to a compliance rule library; and executing the atomic operation sequence that passes the compliance verification, and generating an operation result of the operation instruction in response to the atomic operation sequence passing the compliance verification.

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

[0010] According to the application, the operation instruction input by the user is received, the knowledge graph is generated according to the storage resource object at the front end and the metadata of the storage resource object, the natural language processing model is trained through the knowledge graph, the instruction analysis model is obtained, the operation instruction is decomposed through the instruction analysis model, the atomic operation sequence is generated, the compliance verification is performed on the atomic operation sequence according to the compliance rule library, and in response to the atomic operation sequence passing the compliance verification, the operations are performed on the atomic operation sequence that passes the compliance verification, and the operation result of the operation instruction is generated. Therefore, the storage resource metadata graph mechanism that is automatically constructed and continuously updated is combined with source code analysis and natural language processing technology to realize dynamic modeling and semantic understanding of the storage resource object and the operation behavior, thereby improving the capability of the storage management system in intelligent instruction analysis, risk control and adaptive expansion. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the application, the drawings required in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0012] Figure 1 A flowchart of an instruction execution method provided by an embodiment of the application;

[0013] Figure 2 A framework diagram of an instruction execution method provided by an embodiment of the application;

[0014] Figure 3 A structural block diagram of an instruction execution device provided by an embodiment of the application;

[0015] Figure 4 An internal structural diagram of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION

[0016] With reference to the drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0017] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0018] It should be noted that the terms "S1", "S2" and the like are only used for the purpose of describing the steps, and do not particularly indicate the order or sequence, nor limit the present application. They are only used to facilitate the description of the method of the present application, and cannot be understood as indicating the sequence of the steps. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of those of ordinary skill in the art. When the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist, nor within the protection scope of the present application.

[0019] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

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

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

[0022] Here, the operation instruction is a natural language instruction, such as "viewing storage pool A" or "creating a pool and creating a volume with a capacity of 1T".

[0023] The operation instruction can include a query instruction and a configuration instruction.

[0024] The operation instruction is used for a storage system, and is used for operating a storage object in the storage system.

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

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

[0027] 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.

[0028] Here, the storage resource objects can include resource pool, drive, raid, vdisk, host, vdisk_host_map, user, snapshot, clone, backup, enclosure, battery, power supply, fan, etc.

[0029] Here, the metadata of the storage resource objects can include attributes, operation types, operation risk levels, operation associated APIs, and relationships with other storage resource objects.

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

[0031] 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 multi-modal model, or a transfer learning model.

[0032] The natural language processing model is a pre-trained model based on data in the storage system.

[0033] The knowledge graph trains the instruction parsing model and embeds the instruction parsing model.

[0034] In one embodiment, training the natural language processing model through the knowledge graph can 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.

[0035] Specifically, the node path can be collected through a random walk, a weight-based walk or a task-based target path.

[0036] In this way, the context background can be provided through the graph path, and the ability of the model to understand complex instructions can be improved. Meanwhile, the operation sequence can be used as a structured constraint to avoid illegal paths output by the model. Based on the operation path of the knowledge graph, the model can generalize new paths from known paths, thereby improving the parsing ability.

[0037] S103: An instruction parsing model is used to decompose the operation instruction to generate an atomic operation sequence, wherein the atomic operation sequence includes at least one atomic operation.

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

[0039] Here, the atomic operation sequence is a sequence in which a plurality of atomic operations are arranged according to the operation logic sequence.

[0040] For example, assuming that the operation instruction is "create a pool and create a volume with a capacity of 1T", the instruction parsing model parses the operation instruction "create a pool and create a volume with a capacity of 1T" into three atomic operations "create a storage pool", "create RAID" and "create a volume", and arranges them in the operation logic sequence to form the atomic operation sequence "create a storage pool, create RAID and create a volume".

[0041] S104: The atomic operation sequence is subjected to compliance verification according to a compliance rule library.

[0042] The compliance rule library can be generated according to the current storage system, can be a predefined fixed rule library, or can be a combination of the rule library generated according to the current storage system and the predefined rule library.

[0043] The compliance verification can include permission verification, regular verification, mandatory verification, input range verification and precondition verification.

[0044] S105: In response to the atomic operation sequence passing the compliance verification, the atomic operation sequence that passes the compliance verification is executed to generate an operation result of the operation instruction.

[0045] Specifically, the storage system API (Application Programming Interface, application programming interface) (such as CLI (Command-Line Interface, command line interface)) can be called to execute the corresponding instruction.

[0046] Specifically, the operation result can be sent to the user interface, and the operation result can be displayed on the user interface in the form of readable semantic text description, result display in a table structure, automatic jump to a target page, etc.

[0047] Specifically, for a configuration operation, details of a relevant configuration operation object can be displayed to the user in a table form while returning a result indicating that the operation is successful; for a query operation, if attribute information is more, the attribute information can be displayed to the user in a table form on the user interface, if the attribute information is less, the attribute information can be displayed to the user in a semantic form on the user interface, and for data that needs to be displayed in a chart, the WEB page can be automatically switched to a target page.

[0048] It should be noted that, by means of the storage resource metadata graph mechanism that is automatically constructed and continuously updated, in combination with source code analysis and natural language processing technology, dynamic modeling and semantic understanding of storage resource objects and operation behaviors thereof are realized, so that the capability of the storage management system in intelligent instruction analysis, risk control and adaptive expansion is improved.

[0049] In some specific embodiments, a knowledge graph is generated according to storage resource objects and metadata of the storage resource objects of a front end, including:

[0050] A source code file of the front end is analyzed to determine the storage resource objects and the metadata of the storage resource objects.

[0051] According to the metadata of the storage resource objects, relationships between the storage resource objects are determined.

[0052] The storage resource objects are taken as nodes, and the relationships between the storage resource objects are taken as edges, to generate the knowledge graph.

[0053] Here, the source code file of the front end can include an HTML source code file and a JavaScript source code file.

[0054] The HTML (Hyper Text Markup Language) source code file is source code corresponding to a table component and an attribute display component, and by analyzing the HTML source code file, a list of attributes of the storage resource objects and corresponding operation names can be obtained.

[0055] The JavaScript source code file can include front-end code logic, and by analyzing the JavaScript source code file, operation risk levels, operation APIs, etc. can be obtained.

[0056] Here, the relationships between the storage resource objects can include containing, dependency, conversion, association, connection, association, etc.

[0057] 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.

[0058] Specifically, the preset knowledge graph framework can be as follows:

[0059] raid,contains,drive

[0060] pool,contains,raid

[0061] pool,contains,vdisk

[0062] vdisk,map,host

[0063]

[0064] Specifically, the knowledge graph example can be as follows:

[0065] {

[0066] "nodes":[

[0067] {

[0068] “nodeName”:”pool”,

[0069] "nodeProperties":["id","name",…],

[0070] "relatedNodes":[

[0071] {

[0072] “nodeName”:“drive”,

[0073] "relationship":"contains",

[0074] "action":"add nodeA to nodeB"

[0075] "actionLevel":"Normal",

[0076] },

[0077] {

[0078] “nodeName”:”vdisk”,

[0079] "relationship","contains",

[0080] "action": "create nodeA from nodeB",

[0081] "actionLevel": "Warning",

[0082] "actionTooltip": "This operation may cause …, do you continue?",

[0083] }

[0084]

[0085] ],

[0086] "apis": [

[0087] {

[0088] "apiName": "createPool",

[0089] "apiInput": ["name", "ext"],

[0090]

[0091] },

[0092] … ]

[0094] },

[0095] … ]

[0097] }

[0098] In this way, the association network between the storage resource objects can be intuitively displayed, and a structured domain knowledge base is provided for a natural language processing model.

[0099] In some specific embodiments, the operation instruction is decomposed by the instruction parsing model to generate an atomic operation sequence, including:

[0100] The instruction keywords in the operation instruction are identified by the instruction parsing model, and at least one atomic operation is determined, wherein the atomic operation includes a storage resource object and an operation type;

[0101] Based on the at least one atomic operation, it is determined by the knowledge graph whether the storage resource object and the operation type in the atomic operation are logical;

[0102] In response to the storage resource object and the operation type being not logical, a result of modifying the operation instruction is returned;

[0103] In response to the storage resource object and the operation type being logical, a danger level of at least one atomic operation is determined through the knowledge graph, wherein the danger level includes a first level, a second level, and a third level.

[0104] In response to the danger level of any atomic operation being the first level or the second level, a result of user confirmation is returned.

[0105] In response to the danger level of at least one atomic operation being the third level, an order of the at least one atomic operation is determined through the knowledge graph, to obtain an atomic operation sequence.

[0106] The atomic operation further includes an API interface corresponding to the operation.

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

[0108] The storage resource object and the operation type being logical means that, in the knowledge graph, whether the node information of the storage resource object node supports the corresponding operation type. For example, the storage resource object is a storage pool, and the operation type is creation. According to the information of the storage pool node in the knowledge graph, it is determined whether the creation operation is included.

[0109] Specifically, according to the operation danger level, it is determined whether user secondary confirmation verification of the operation is needed. The critical level operation needs the user to input a password for confirmation, and a corresponding impact prompt stored in the knowledge graph is given. The warning level operation only needs to be clicked to confirm again, and a corresponding impact prompt defined in the knowledge graph is given. The normal level operation does not need user secondary confirmation verification, and a request is directly issued.

[0110] In an embodiment, the instruction parsing model can supplement a missing step according to the parsed atomic operation and the knowledge graph. For example, the operation instruction is “help me create a pool and create a volume with a capacity of 1T”. Through the instruction parsing model, the instruction keywords “create pool” and “create volume” are recognized. The instruction parsing model recognizes that there needs to be a “create RAID” step between creating the pool and creating the volume according to the knowledge graph, and the “create RAID” step is supplemented.

[0111] Specifically, for the "create pool" atomic operation, where the storage resource object is a storage pool and the operation type is creation, it is determined whether the creation operation is supported according to whether the storage pool node in the knowledge graph supports the creation operation. When the knowledge graph does not exist, a result that needs to be modified is returned to the user interface. When the knowledge graph exists, it is determined whether secondary confirmation of the operation is required according to the dangerous level of the current operation in the knowledge graph, and the user interface is returned to the user for secondary confirmation of the operation.

[0112] Specifically, after each atomic operation instruction is detected by logic and dangerous level, the relationship between atomic operations is obtained according to the node relationship in the knowledge graph, so as to obtain the atomic operation sequence.

[0113] In this way, high-level semantics are converted into low-level executable actions, which can improve the accuracy and executability of the system.

[0114] In some specific embodiments, the atomic operation sequence is verified for compliance according to a compliance rule library, including:

[0115] According to the compliance rule library, it is detected whether the atomic operation sequence meets the user permission;

[0116] In response to the atomic operation sequence meeting the user permission, it is detected according to the compliance rule library whether the parameters of the atomic operation sequence meet the parameter rule;

[0117] In response to the atomic operation sequence meeting the parameter rule, it is determined that the atomic operation sequence passes the compliance verification.

[0118] Wherein, the user permission is different according to different user roles. The user roles can include administrators, auditors, etc.

[0119] Specifically, according to the current operation user role, it is checked whether there is permission to execute the atomic operation sequence. After the permission check passes, it is further checked whether the parameters of the atomic operation sequence meet the parameter rule.

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

[0121] For example, after the number of storage pools reaches the maximum specification, the user issues an operation instruction to "create a storage pool", which will automatically return a modification and error reason to the user interface.

[0122] In this way, the overreach and illegal operation of the operation instruction are avoided, and the ease of use and safety are improved.

[0123] In some specific embodiments, the method further includes:

[0124] Parsing the source code file of the front end to obtain user permissions and parameters;

[0125] According to the user permissions, a permission rule library is generated;

[0126] According to the parameters, a parameter rule library is generated;

[0127] According to the permission rule library and the parameter rule library, a compliance rule library is generated.

[0128] Here, the parameter rule library can include regular verification, mandatory verification, input range verification, precondition verification, etc.

[0129] Specifically, through regular verification, it can be verified whether the characters in the operation instruction are within the preset length range, etc. Through mandatory verification, it can be verified whether the missing parameters in the operation instruction are mandatory or empty. Through input range verification, it can be verified whether the parameter range in the operation instruction is qualified. Through precondition verification, it can be verified whether the system state meets the execution condition, whether the dependent field exists, etc.

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

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

[0132] Specifically, the compliance rule library can be as follows:

[0133] {

[0134] "api": "createPool",

[0135] "param_constraints": [

[0136] {"name": "ext", "type": "integer", "range": [1024, 2048,4096},

[0137] {"name": "name", "type": "string", "pattern": "^[a-zA-Z0-9_-]+$"}

[0138] ],

[0139] "condition_checks": [

[0140] {"condition": "pool_count<512"}, ]

[0142] }

[0143] In one embodiment, when the user edits the front-end source code by editing, the knowledge graph and the compliance rule library will be regenerated according to the edited front-end source code, and the synchronization upgrade of the instruction execution system can be efficiently completed when the front-end new function is added.

[0144] In some specific embodiments, the method further comprises:

[0145] In response to the existence of an atomic operation that fails to pass the compliance verification in the sequence of atomic operations, returning a result confirmed by the user;

[0146] Receiving the confirmation of the user that the atomic operation is valid;

[0147] Obtaining the user authority and parameters corresponding to the atomic operation, updating the compliance rule library according to the user authority and parameters, and obtaining the updated compliance rule library.

[0148] Specifically, after the compliance verification fails, the user can force to resend the request if the user confirms that the atomic operation is valid, at this time the atomic operation will not be intercepted, and the restriction condition in the compliance rule library is adjusted automatically according to the parameters of the current atomic operation.

[0149] For example, assume that the parameter value input range of the extension block size of the created pool in the compliance rule library is [1024, 2048, 4096]. The user inputs the instruction as "create 1 storage pool with an extension block size of 512". First, the operation is intercepted because the compliance verification fails, the user clicks to confirm that the parameters are correct in the feedback result, and the operation is forced to execute again, at this time 512 is added to the parameter value input range list of the extension block size.

[0150] In this way, the compliance rule library is dynamically updated, and the judgment accuracy is improved.

[0151] In some specific embodiments, the method further comprises:

[0152] Obtaining at least one operation instruction input by the user within a preset period, calculating the similarity between the operation instruction and the last operation instruction, and determining the operation instruction with a similarity greater than a preset value;

[0153] From the operation instruction with a similarity greater than a preset value, filtering the operation instruction and the last operation instruction that fails to pass the compliance verification, and counting the number of operation instructions;

[0154] The number is used as a penalty coefficient of the instruction parsing model, and the instruction parsing model is fed back and learned through the penalty coefficient.

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

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

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

[0158] 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:

[0159] (1)

[0160] 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.

[0161] For example, assume that there is an instruction sequence in the time window (similarity threshold τ=0.8), and there are five operation instructions:

[0162] Command 1. "Expand Volume A" (Compliance Verification Passed);

[0163] Instruction 2: "Expand Volume A" (failed compliance verification, similarity to instruction 1: 0.9);

[0164] Instruction 3: "Increase Volume A Capacity" (failed compliance verification, similarity to instruction 2: 0.85);

[0165] Instruction 4. "Delete logs" (pass compliance verification);

[0166] Instruction 5: "Remove log files" (failed compliance verification, similarity to instruction 4: 0.6).

[0167] The operation instruction is calculated by formula 1, and the process is as follows:

[0168] Instruction 2: The previous instruction 1 passes the compliance verification, does not meet the condition, and takes the value 0;

[0169] Instruction 3: Instruction 3 does not pass the compliance verification, the previous instruction 2 does not pass the compliance verification, the similarity between instruction 3 and 2 is greater than the threshold value, meets the condition, and takes the value 1;

[0170] Instruction 4: Passes the compliance verification, does not meet the condition, and takes the value 0;

[0171] Instruction 5: The previous instruction 4 passes the compliance verification, and the similarity is lower than the threshold value, does not meet the condition, and takes the value 0;

[0172] Final result: N = 0 + 1 + 0 + 0 = 1.

[0173] In this way, the instruction analysis model is corrected in time according to the historical operation instruction record, and the instruction analysis accuracy is improved.

[0174] In one embodiment, Figure 2 The framework in the embodiment of the application is shown in FIG. 1. Figure 2 As shown in FIG. 1, the framework in the application includes a model adjustment module, an instruction analysis module, a compliance verification module, a resource operation module, and a feedback generation module.

[0175] Specifically, the model adjustment module is used to record and count the historical instruction information of the user within a certain period, measure the accuracy of instruction analysis according to the number of times of user correction instructions, and reverse correct the instruction analysis model parameters on this basis to improve the accuracy of user instruction understanding.

[0176] Specifically, the instruction analysis module includes a knowledge graph generation module, a semantic analysis module, and an operation decomposition module. The knowledge graph generation module is used to automatically analyze the front-end framework source code file in combination with the initial storage resource object information, automatically generate the knowledge graph of the storage resource metadata, and the knowledge graph takes each storage resource object as a node, connects each object with the object association relationship and operation name, and each node contains the attribute information, associated API, and other information of the resource object. The knowledge graph will be used for training of the instruction analysis model; the semantic analysis module is used for preliminary identification and analysis of the input instruction of the user; and the operation decomposition module is used for decomposing the natural language instruction into an executable atomic API operation sequence.

[0177] Specifically, the compliance verification module includes a compliance rule generation module, an authority verification module, and a restriction constraint verification module. The compliance rule generation module is configured to automatically generate a compliance detection rule library according to an existing storage WEB management interface; the authority verification module is configured to automatically intercept unauthorized operations according to user roles (for example, an administrator and an auditor); and the restriction constraint verification module is configured to automatically intercept illegal operations according to constraint restrictions.

[0178] Specifically, the resource operation module is configured to call a storage system API (for example, a CLI) to execute instructions.

[0179] Specifically, the feedback generation module is configured to display results in a friendly manner according to different processing scenarios of requests, including readable semantic text descriptions, structured results in a chart, and automatic target page jumping.

[0180] It should be understood that, although Figure 1 the steps in the flowcharts of Figure 2 are displayed in sequence according to the arrows, these steps are not necessarily executed in sequence according to the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, Figure 1 at least some of the steps in Figure 2 may include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least some of other steps or sub-steps or stages of other steps.

[0181] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a general hardware platform as necessary, and of course can also be realized by hardware, but in many cases the former is a better embodiment.

[0182] The embodiment of the application further provides an instruction execution device, which comprises: a first processing module 301 configured to receive an operation instruction input by a user; a second processing module 302 configured to generate a knowledge graph according to a storage resource object and metadata of the storage resource object in a front end, train a natural language processing model through the knowledge graph, and obtain an instruction analysis model; a third processing module 303 configured to decompose the operation instruction through the instruction analysis model and generate an atomic operation sequence, wherein the atomic operation sequence comprises at least one atomic operation; a fourth processing module 304 configured to perform compliance verification on the atomic operation sequence according to a compliance rule library; and a fifth processing module 305 configured to execute the atomic operation sequence that passes the compliance verification to generate an operation result of the operation instruction in response to the atomic operation sequence passing the compliance verification.

[0183] As a preferred implementation, in the embodiment of the application, the second processing module 302 is specifically configured to: analyze a source code file in the front end, determine the storage resource object and the metadata of the storage resource object, determine the relationship between the storage resource objects according to the metadata of the storage resource objects, and generate the knowledge graph by taking the storage resource objects as nodes and the relationship between the storage resource objects as edges.

[0184] As a preferred implementation, in the embodiment of the application, the third processing module 303 is specifically configured to: identify an instruction keyword in the operation instruction through the instruction analysis model, determine at least one atomic operation, wherein the atomic operation comprises a storage resource object and an operation type; determine whether the storage resource object and the operation type in the atomic operation conform to logic through the knowledge graph based on the at least one atomic operation; return a result of modifying the operation instruction in response to the storage resource object and the operation type not conforming to the logic; determine a danger level of the at least one atomic operation through the knowledge graph in response to the storage resource object and the operation type conforming to the logic, wherein the danger level comprises a first level, a second level and a third level; return a result of user confirmation in response to the danger level of any atomic operation being the first level or the second level; and determine an order of the at least one atomic operation through the knowledge graph in response to the danger level of the at least one atomic operation being the third level, and obtain the atomic operation sequence.

[0185] As a preferred implementation, in the embodiment of the application, the fourth processing module 304 is specifically configured to: detect whether the atomic operation sequence satisfies a user permission according to the compliance rule library; detect whether parameters of the atomic operation sequence satisfy a parameter rule according to the compliance rule library in response to the atomic operation sequence satisfying the user permission; and determine that the atomic operation sequence passes the compliance verification in response to the atomic operation sequence satisfying the parameter rule.

[0186] As a preferred implementation, in the embodiment of the present application, the device further comprises a generation module, which is specifically configured to: parse the source code file of the front end to obtain user permissions and parameters; generate a permission rule library according to the user permissions; generate a parameter rule library according to the parameters; and generate a compliance rule library according to the permission rule library and the parameter rule library.

[0187] As a preferred implementation, in the embodiment of the present application, the device further comprises an update module, which is specifically configured to: return a result confirmed by the user in response to the fact that there is an atomic operation that fails to pass the compliance verification in the atomic operation sequence; receive the confirmation of the user that the atomic operation is valid; obtain the user permissions and parameters corresponding to the atomic operation, and update the compliance rule library according to the user permissions and the parameters to obtain an updated compliance rule library.

[0188] As a preferred implementation, in the embodiment of the present application, the device further comprises a feedback module, which is specifically configured to: obtain at least one operation instruction input by the user within a preset period, calculate the similarity between the operation instruction and the last operation instruction, and determine the operation instruction with a similarity greater than a preset value; from the operation instructions with a similarity greater than the preset value, filter the operation instruction that fails to pass the compliance verification together with the last operation instruction, and count the number of the operation instructions; and take the number as a penalty coefficient of the instruction parsing model, and perform feedback learning on the instruction parsing model through the penalty coefficient.

[0189] The description of the features in the embodiment of the instruction execution device can refer to the related description of the embodiment of the instruction execution method, which will not be repeated here.

[0190] Embodiments of the present application also provide an electronic device, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 4 The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the electronic device is configured 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 operating system and the computer program in the non-volatile storage medium to run. The network interface of the electronic device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement an instruction execution method. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the electronic device, or an external keyboard, touchpad or mouse, etc.

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

[0192] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the following steps when executing the computer program: S1: receiving an operation instruction input by a user; S2: generating a knowledge graph according to a storage resource object of a front end and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining an instruction analysis model; S3: decomposing the operation instruction through the instruction analysis model, and generating 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 library; and S5: in response to the atomic operation sequence passing the compliance verification, executing the atomic operation sequence that passes the compliance verification to generate an operation result of the operation instruction.

[0193] In one embodiment, the processor further implements the following steps when executing the computer program: parsing a source code file of the front end to determine the storage resource object and the metadata of the storage resource object; determining the relationship between the storage resource objects according to the metadata of the storage resource objects; and generating the knowledge graph by taking the storage resource objects as nodes and the relationship between the storage resource objects as edges.

[0194] In one embodiment, the processor further implements the following steps when executing the computer program: identifying an instruction keyword in the operation instruction through the instruction analysis model, and determining at least one atomic operation, wherein the atomic operation includes a storage resource object and an operation type; determining whether the storage resource object and the operation type in the atomic operation conform to logic based on the at least one atomic operation through the knowledge graph; in response to the storage resource object and the operation type not conforming to the logic, returning a result of modifying the operation instruction; in response to the storage resource object and the operation type conforming to the logic, determining a danger level of the at least one atomic operation through the knowledge graph, wherein the danger level includes a first level, a second level, and a third level; in response to the danger level of any atomic operation being the first level or the second level, returning a result of user confirmation; and in response to the danger level of the at least one atomic operation being the third level, determining an order of the at least one atomic operation through the knowledge graph to obtain the atomic operation sequence.

[0195] In an embodiment, the processor, when executing the computer program, further implements the following steps: detecting, according to the compliance rule library, whether the sequence of atomic operations meets the user permission; in response to the sequence of atomic operations meeting the user permission, detecting, according to the compliance rule library, whether the parameters of the sequence of atomic operations meet the parameter rule; in response to the sequence of atomic operations meeting the parameter rule, determining that the sequence of atomic operations passes the compliance verification.

[0196] In an embodiment, the processor, when executing the computer program, further implements the following steps: parsing the source code file of the front end to obtain the user permission and the parameters; generating the permission rule library according to the user permission; generating the parameter rule library according to the parameters; and generating the compliance rule library according to the permission rule library and the parameter rule library.

[0197] In an embodiment, the processor, when executing the computer program, further implements the following steps: in response to the sequence of atomic operations including an atomic operation that does not pass the compliance verification, returning a result of user confirmation; receiving the user's returned confirmation that the atomic operation is valid; obtaining the user permission and the parameters corresponding to the atomic operation, updating the compliance rule library according to the user permission and the parameters, and obtaining an updated compliance rule library.

[0198] In an embodiment, the processor, when executing the computer program, further 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 last operation instruction, and determining the operation instruction with a similarity greater than a preset value; from the operation instructions with a similarity greater than the preset value, filtering the operation instruction that does not pass the compliance verification with the last operation instruction, counting the number of operation instructions; taking the number as a penalty coefficient of the instruction parsing model, and performing feedback learning on the instruction parsing model through the penalty coefficient.

[0199] In an embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the following steps: S1: receiving an operation instruction input by a user; S2: generating a knowledge graph according to a storage resource object of a front end and metadata of the storage resource object, training a natural language processing model through the knowledge graph, and obtaining an instruction parsing model; S3: decomposing the operation instruction through the instruction parsing model to generate a sequence of atomic operations, wherein the sequence of atomic operations includes at least one atomic operation; S4: performing compliance verification on the sequence of atomic operations according to a compliance rule library; and S5: in response to the sequence of atomic operations passing the compliance verification, performing an operation on the sequence of atomic operations that passes the compliance verification to generate an operation result of the operation instruction.

[0200] In an embodiment, the computer program, when executed by the processor, further implements the following steps: parsing the source code file of the front end, determining the storage resource object and the metadata of the storage resource object; determining the relationship between the storage resource objects according to the metadata of the storage resource object; generating a knowledge graph by taking the storage resource object as a node and the relationship between the storage resource objects as an edge.

[0201] In an embodiment, the computer program, when executed by the processor, further implements the following steps: identifying the instruction keywords in the operation instruction by the instruction parsing model, and determining at least one atomic operation, wherein the atomic operation includes the storage resource object and the operation type; determining whether the storage resource object and the operation type in the atomic operation conform to the logic based on the at least one atomic operation through the knowledge graph; in response to the storage resource object and the operation type not conforming to the logic, returning the result of modifying the operation instruction; in response to the storage resource object and the operation type conforming to the logic, determining the danger level of the at least one atomic operation through the knowledge graph, wherein the danger level includes a first level, a second level and a third level; in response to the danger level of any atomic operation being the first level or the second level, returning the result of user confirmation; in response to the danger level of the at least one atomic operation being the third level, determining the order of the at least one atomic operation through the knowledge graph to obtain an atomic operation sequence.

[0202] In an embodiment, the computer program, when executed by the processor, further implements the following steps: detecting whether the atomic operation sequence meets the user permission according to the compliance rule library; in response to the atomic operation sequence meeting the user permission, detecting whether the parameters of the atomic operation sequence meet the parameter rule according to the compliance rule library; in response to the atomic operation sequence meeting the parameter rule, determining that the atomic operation sequence passes the compliance verification.

[0203] In an embodiment, the computer program, when executed by the processor, further implements the following steps: parsing the source code file of the front end, obtaining the user permission and the parameters; generating a permission rule library according to the user permission; generating a parameter rule library according to the parameters; and generating a compliance rule library according to the permission rule library and the parameter rule library.

[0204] In an embodiment, the computer program, when executed by the processor, further implements the following steps: in response to there being an atomic operation in the atomic operation sequence that does not pass the compliance verification, returning the result of user confirmation; receiving the user's returned confirmation that the atomic operation is valid; obtaining the user permission and the parameters corresponding to the atomic operation, updating the compliance rule library according to the user permission and the parameters to obtain an updated compliance rule library.

[0205] In one embodiment, the computer program, when executed by the processor, further implements the following steps: obtaining at least one operation instruction input by the user in a preset period, calculating the similarity between the operation instruction and the previous operation instruction, determining the operation instruction with a similarity greater than a preset value; from the operation instruction with a similarity greater than the preset value, screening the operation instruction that does not pass the compliance verification with the previous operation instruction, and counting the number of operation instructions; taking the number as a penalty coefficient of the instruction parsing model, and performing feedback learning on the instruction parsing model through the penalty coefficient.

[0206] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM) and the like.

[0207] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0208] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope 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 current front-end storage resource object and the metadata of the storage resource object, 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, performing an operation on the atomic operation sequence that passed the compliance verification to generate an operation result of the operation instruction; The step of generating a knowledge graph based on the storage resource object of the current front end and the metadata of the storage resource object includes: Parsing the source code file of the current 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; Among them, the training of the natural language processing model through the knowledge graph includes: encoding the knowledge graph through a graph neural network, converting each node and edge in the knowledge graph into a vector corresponding to the node and a vector corresponding to the edge, randomly collecting node paths based on the knowledge graph, combining the edges in the node paths into an operation sequence, converting the operation sequence into a vector corresponding to the operation sequence, 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.

2. 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.

3. 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.

4. The instruction execution method according to claim 3, wherein: 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.

5. The instruction execution method according to claim 4, 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.

6. 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.

7. An instruction execution device for implementing the instruction execution method according to any one of claims 1 to 6, 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.

8. 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 6 when executing a computer program.

9. 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 6 are implemented.

Citation Information

Patent Citations

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

    CN119416881A