Script generation method and device
By receiving operation and maintenance prompt information and generating script appeal words, using script analysis model to generate and optimize operation and maintenance scripts, the problem of high workload and difficulty of writing scripts by operation and maintenance personnel is solved, and efficient automatic generation and optimization of operation and maintenance scripts is achieved. .
Patent Information
- Application Number
- CN202411324907.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-03
AI Technical Summary
Operations and maintenance personnel need to write various scripts according to different operation and maintenance scenarios, resulting in high workload, high difficulty and low writing efficiency.
By receiving operation and maintenance prompt information, generating script appeal words, and using the script analysis model to generate initial operation and maintenance scripts, testing and updating, and finally generating optimization operation and maintenance scripts, automatically generating and optimizing operation and maintenance scripts.
It reduces the workload and difficulty of operation and maintenance personnel, improves the efficiency of writing operation and maintenance scripts, and realizes the ability to automatically generate and optimize operation and maintenance scripts.
Smart Images

Figure CN119248627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system operation and maintenance, and in particular to a script generation method and device. Background Art
[0002] With the vigorous development of various business systems, the data volume and operation and maintenance of the systems are getting larger and larger. Operation and maintenance personnel need to run different operation and maintenance scripts according to different operation and maintenance scenarios and requirements, and promptly troubleshoot various problems that arise during system operation to ensure that the business system can run normally and continuously. Operation and maintenance personnel usually need to manually write various operation and maintenance scripts. The workload and operation and maintenance difficulty of operation and maintenance personnel are large, and the efficiency of writing operation and maintenance scripts is also low. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a script generation method and device, which can reduce the workload and difficulty of operation and maintenance personnel and improve the efficiency of writing operation and maintenance scripts.
[0004] In a first aspect, an embodiment of the present invention provides a script generation method, comprising:
[0005] Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information;
[0006] Generate script appeal words according to the operation and maintenance prompt information and the execution information;
[0007] Inputting the script demand words into the script analysis model, and obtaining an initial operation and maintenance script according to the output result of the script analysis model;
[0008] Performing script testing on the initial operation and maintenance script to obtain test results, and determining an update strategy based on the test results;
[0009] According to the update strategy, the script appeal words are updated to obtain updated appeal words;
[0010] According to the update request words, an optimized operation and maintenance script corresponding to the initial operation and maintenance script is generated.
[0011] Optionally, before inputting the script appeal words into the script analysis model, the method further includes:
[0012] Get multiple stock scripts;
[0013] For each of the stock scripts: determining result data corresponding to the stock script; combining the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script;
[0014] The initial analysis model is trained using the stock samples corresponding to each of the stock scripts to obtain the script analysis model.
[0015] Optionally, generating a script appeal word according to the operation and maintenance prompt information and the execution information includes:
[0016] Determining at least one appeal word example according to the operation and maintenance prompt information and the execution information;
[0017] displaying an appeal word list including the at least one appeal word example;
[0018] receiving a first editing operation for a target example in the appeal word list;
[0019] The script appeal words are generated according to the edited target example.
[0020] Optionally, before obtaining the update demand words according to the initial operation and maintenance script, the method further includes:
[0021] Scanning the initial operation and maintenance script for high-risk commands;
[0022] In response to the initial operation and maintenance script failing the high-risk command scan, high-risk command adjustment processing is performed on the initial operation and maintenance script.
[0023] Optionally, the update strategy is manual editing;
[0024] The updating process of the script appeal words according to the updating strategy to obtain updated appeal words includes:
[0025] The test result and the script appeal word are displayed; a second editing operation of the user on the script appeal word is received; and the edited script appeal word is determined as the updated appeal word.
[0026] Optionally, generating an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand word includes:
[0027] Inputting the update appeal words into the script analysis model;
[0028] The optimized operation and maintenance script is obtained according to the output result of the script analysis model.
[0029] Optionally, after generating the optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words, the method further includes:
[0030] Determine the result data of the optimized operation and maintenance script in the production environment;
[0031] Combining the optimized operation and maintenance script and the result data corresponding to the optimized operation and maintenance script to generate an operation and maintenance sample corresponding to the optimized operation and maintenance script;
[0032] The script analysis model is trained using the operation and maintenance samples corresponding to the optimized operation and maintenance script.
[0033] In a second aspect, an embodiment of the present invention provides a script generation device, including:
[0034] An information determination module, used to receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information;
[0035] A demand word generation module, used to generate a script demand word according to the operation and maintenance prompt information and the execution information;
[0036] A script generation module, used to input the script appeal words into a script analysis model, and obtain an initial operation and maintenance script according to the output result of the script analysis model;
[0037] A strategy determination module is used to perform script testing on the initial operation and maintenance script, obtain test results, and determine an update strategy based on the test results;
[0038] An appeal word updating module, used for updating the script appeal words according to the update strategy to obtain updated appeal words;
[0039] The script optimization module is used to generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words.
[0040] Optionally, it also includes:
[0041] Model training module, used to obtain multiple stock scripts;
[0042] For each of the stock scripts: determining result data corresponding to the stock script; combining the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script;
[0043] The initial analysis model is trained using the stock samples corresponding to each of the stock scripts to obtain the script analysis model.
[0044] Optionally, the appeal word generation module is specifically used for:
[0045] Determining at least one appeal word example according to the operation and maintenance prompt information and the execution information;
[0046] displaying an appeal word list including the at least one appeal word example;
[0047] receiving a first editing operation for a target example in the appeal word list;
[0048] The script appeal words are generated according to the edited target example.
[0049] Optionally, the script optimization module is further used to:
[0050] Scanning the initial operation and maintenance script for high-risk commands;
[0051] In response to the initial operation and maintenance script failing the high-risk command scan, high-risk command adjustment processing is performed on the initial operation and maintenance script.
[0052] Optionally, the update strategy is manual editing;
[0053] The appeal word updating module is specifically used for:
[0054] Displaying the test results and the script appeal words;
[0055] Receiving a second editing operation of the user on the script appeal word;
[0056] The edited script appeal word is determined as the update appeal word.
[0057] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0058] one or more processors;
[0059] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0060] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the above embodiments.
[0061] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed by a processor.
[0062] An embodiment of the above invention has the following advantages or beneficial effects: an initial operation and maintenance script is obtained according to the script claim words. According to the test results of the initial operation and maintenance script, the update strategy and the update claim words corresponding to the initial operation and maintenance script are determined, and an optimized operation and maintenance script is generated according to the update claim words. The scheme of the embodiment of the present application can automatically generate an operation and maintenance script and optimize the operation and maintenance script. Compared with the method of manually writing operation and maintenance scripts, it can reduce the workload and difficulty of operation and maintenance personnel, and improve the efficiency of writing operation and maintenance scripts.
[0063] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0065] Figure 1 is a flowchart of a script generation method provided by the first embodiment of the present invention;
[0066] Figure 2 is a flowchart of a script generation method provided by the second embodiment of the present invention;
[0067] Figure 3 is a schematic diagram of a script generation process provided by the third embodiment of the present invention;
[0068] Figure 4 is a schematic diagram of a script generation process provided by the fourth embodiment of the present invention;
[0069] Figure 5 is a structural schematic diagram of a script generating device provided by an embodiment of the present invention;
[0070] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0072] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0073] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0074] Figure 1 is a flowchart of a script generation method provided by the first embodiment of the present invention, such as Figure 1As shown, the method includes:
[0075] Step 101: Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information.
[0076] The operation and maintenance prompt information is the system-related information collected or generated during the operation of the system. The operation and maintenance prompt information may be system error information, log information, and system operation and maintenance information entered by the operation and maintenance personnel.
[0077] Execution information may include: domain information, faulty application, faulty module, role information, etc. Domain information may include: storage, server, platform, network, virtualization, application, etc. Role information may include: administrator, department administrator, first-level department manager, second-level department manager, application manager, etc.
[0078] Step 102: Generate script appeal words according to the operation and maintenance prompt information and execution information.
[0079] Script claim words are used to represent the function of the script, the problem to be solved, etc. For example, the script claim words can be: Generate a FullGC emergency response shell script for the application manager. FullGC represents the garbage collection operation, and shell is a script type. Script claim words can also be: Generate a script for resource optimization of the login system, etc.
[0080] The operation and maintenance prompt information and execution information can be input into the first language analysis model, and the script appeal words can be generated according to the output of the first language analysis model. A mapping relationship between the operation and maintenance prompt information and execution information and the script appeal words can also be constructed. The script appeal words can be generated according to the mapping relationship.
[0081] In one scheme of an embodiment of the present invention, script appeal words are generated according to operation and maintenance prompt information and execution information, including: determining at least one appeal word example according to the operation and maintenance prompt information and execution information; displaying an appeal word list including at least one appeal word example; receiving a first editing operation for a target example in the appeal word list; and generating a script appeal word according to the edited target example.
[0082] Construct a mapping relationship between operation and maintenance prompt information and execution information and appeal word examples in the system. According to the mapping relationship, determine at least one appeal word example. Appeal word examples can be set according to needs. For example, appeal word examples can be: generating a script of XX type with XX function for XX role, generating a script for optimizing XX resources of XX system, etc. The user selects a target example and edits the target example, and determines the edited target example as the script appeal word. By providing appeal word examples, the difficulty of users in constructing script appeal words can be reduced, and the generated script appeal words can be better parsed and understood by the script analysis model.
[0083] Step 103: Input the script demand words into the script analysis model, and obtain the initial operation and maintenance script according to the output result of the script analysis model.
[0084] The script analysis model is a large-scale neural network model with natural language understanding and generation capabilities. The script analysis model can understand the intention contained in the text input by the user, so as to generate text on demand. The script analysis model can be ChatGPT, Claude, etc. The script analysis model can realize the automatic generation of operation and maintenance scripts.
[0085] Step 104: Perform script testing on the initial operation and maintenance script to obtain test results, and determine an update strategy based on the test results.
[0086] The script appeal words may not enable the script analysis model to accurately understand the user's intention, so that the initial operation and maintenance script is not suitable. The script appeal words need to be updated to obtain updated appeal words. Compared with the script appeal words, the updated appeal words can enable the script analysis model to more accurately understand the user's intention, thereby generating a more suitable operation and maintenance script.
[0087] The update demand words can be directly input by the user. The user can also edit the script demand words and determine the edited script demand words as the update demand words. The initial operation and maintenance script can also be tested to obtain the test results; according to the test results, the script demand words are updated to obtain the update demand words.
[0088] Script testing of the initial operation and maintenance script may include: functional testing, scope testing, parameter boundary testing, etc. of the initial operation and maintenance script.
[0089] After obtaining the initial operation and maintenance script according to the output result of the script analysis model, the method further includes: receiving a third editing operation on the initial operation and maintenance script; and obtaining the edited operation and maintenance script according to the edited initial operation and maintenance script. Performing a script test on the initial operation and maintenance script to obtain the test result includes: performing a script test on the edited operation and maintenance script. The user can edit the initial operation and maintenance script. The method further includes performing script testing, determining an update strategy, and updating the appeal words based on the edited initial operation and maintenance script.
[0090] An update strategy can be determined based on the test results; based on the update strategy, the script appeal words are updated to obtain updated appeal words. The update strategy may include: keyword replacement, regeneration, manual editing, etc.
[0091] A mapping relationship between the test results and the update strategy is set in the system. The update strategy is determined based on the test results of the mapping relationship. For example, when the test results indicate that the keyword cannot be recognized, the update strategy is determined to be keyword replacement or manual editing. When the test results indicate that the keyword compilation error occurs, the update strategy is determined to be regeneration and manual editing.
[0092] If multiple candidate strategies are determined based on the test results, any strategy can be selected as the update strategy, or the update strategy can be manually specified from the multiple candidate strategies.
[0093] Step 105: According to the update strategy, the script appeal words are updated to obtain updated appeal words.
[0094] If the update strategy is: keyword replacement, the keywords in the script appeal words can be parsed and replaced to generate updated appeal words. If the update strategy is: regeneration, the test results and script appeal words can be input into the second language analysis model, and the updated appeal words can be generated according to the output of the second language analysis model.
[0095] In one embodiment of the present invention, the update strategy is manual editing. The test results and script appeal words can be displayed; a second editing operation of the user on the script appeal words is received; and the edited script appeal words are determined as updated appeal words. After obtaining the test results, the user may have new ideas for constructing appeal words. Therefore, the test results and script appeal words can also be displayed, and a second editing operation of the user on the script appeal words is received; and the edited script appeal words are determined as updated appeal words. Through manual editing, more accurate updated appeal words are constructed.
[0096] Step 106: Generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update request words.
[0097] The update request words can be input into the script analysis model; according to the output results of the script analysis model, an optimized operation and maintenance script is obtained.
[0098] It should be noted that step 104 and step 106 may be executed multiple times, that is, the appeal words may be changed multiple times until an operation and maintenance script that meets the user's needs or passes the script test is generated.
[0099] In the scheme of the embodiment of the present invention, an initial operation and maintenance script is obtained according to the script demand words. The update demand words corresponding to the initial operation and maintenance script are determined; and an optimized operation and maintenance script is generated according to the update demand words. The scheme of the embodiment of the present application can automatically generate an operation and maintenance script and optimize the operation and maintenance script. Compared with the method of manually writing an operation and maintenance script, it can reduce the workload and difficulty of operation and maintenance personnel, and improve the efficiency of writing operation and maintenance scripts.
[0100] In one scheme of an embodiment of the present invention, before obtaining the update request word according to the initial operation and maintenance script, it also includes: scanning the initial operation and maintenance script for high-risk commands; in response to the initial operation and maintenance script failing the high-risk command scan, adjusting the initial operation and maintenance script for high-risk commands.
[0101] A high-risk command library can be set up, and multiple high-risk commands can be placed in the high-risk command library. High-risk commands can be set according to needs. High-risk commands refer to instructions that may affect the normal operation of the system or service, or may cause special system files to be maliciously deleted or modified. If the initial operation and maintenance script includes high-risk commands in the high-risk command library, it is determined that the initial operation and maintenance script has not passed the high-risk command scan. Adjustment of high-risk commands in the initial operation and maintenance script may include: deleting high-risk commands in the initial operation and maintenance script, issuing prompt information for high-risk commands, etc.
[0102] In one scheme of an embodiment of the present invention, after generating an optimized operation and maintenance script corresponding to the initial operation and maintenance script based on the update request words, it also includes: determining the result data of the optimized operation and maintenance script in the production environment; combining the optimized operation and maintenance script and the result data corresponding to the optimized operation and maintenance script to generate an operation and maintenance sample corresponding to the optimized operation and maintenance script; and using the operation and maintenance sample corresponding to the optimized operation and maintenance script to train the script analysis model.
[0103] The result data may include: domain information, faulty applications, faulty modules, role information, system information before execution, system information after execution, resource change information, execution status change information, etc. The script analysis model is trained using the operation and maintenance samples corresponding to the optimized operation and maintenance scripts. The script analysis model can be further optimized to make the output results of the script analysis model more accurate.
[0104] Figure 2 is a flow chart of a script generation method provided by the second embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0105] Step 201: Obtain multiple stock scripts.
[0106] Stock scripts are existing operation and maintenance scripts. Stock scripts can be scripts manually written by operation and maintenance personnel, or operation and maintenance scripts that have been executed by the system.
[0107] Step 202: For each stock script: determine the result data corresponding to the stock script; combine the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script.
[0108] The result data may include: domain information, faulty application, faulty module, role information, system information before execution, system information after execution, resource change information, execution status change information, etc.
[0109] Step 203: Use the stock samples corresponding to each stock script to train the initial analysis model to obtain a script analysis model.
[0110] Step 204: Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information.
[0111] Step 205: Generate script appeal words according to the operation and maintenance prompt information and execution information.
[0112] Step 206: Input the script demand words into the script analysis model, and obtain the initial operation and maintenance script according to the output result of the script analysis model.
[0113] Step 207: Perform script testing on the initial operation and maintenance script to obtain test results, and determine an update strategy based on the test results.
[0114] Step 208: According to the update strategy, the script appeal words are updated to obtain updated appeal words.
[0115] Step 209: Generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update request words.
[0116] In the solution of the embodiment of the present invention, before the script appeal words are input into the script analysis model, the script analysis model is trained using operation and maintenance samples corresponding to multiple stock scripts. This can make the analysis effect of the trained script analysis model better, quickly and accurately determine the operation and maintenance script that meets the current application scenario, and improve the system operation and maintenance efficiency.
[0117] Figure 3 is a flow chart of a script generation method provided by the third embodiment of the present invention, such as Figure 3 As shown, the method includes:
[0118] Step 301: Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information.
[0119] Step 302: Generate script appeal words according to the operation and maintenance prompt information and execution information.
[0120] Step 303: Input the script demand words into the script analysis model, and obtain the initial operation and maintenance script according to the output result of the script analysis model.
[0121] Step 304: Perform script testing on the initial operation and maintenance script to obtain test results.
[0122] Step 305: In response to the test result indicating failure, an update strategy is determined according to the test result and the script appeal words.
[0123] If the test result does not pass, execute step 306 and step 307. If the test result passes, the initial operation and maintenance script can be used as the final operation and maintenance script, and steps based on the test results and script requirements can also be executed.
[0124] Step 306: According to the update strategy, the script appeal words are updated to obtain updated appeal words.
[0125] Step 307: Generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update request words.
[0126] In the solution of the embodiment of the present invention, if the test result characterization fails, an updated demand word is obtained based on the test result and the script demand word, and the operation and maintenance script is regenerated using the updated demand word. The updated demand word obtained based on the test result and the script demand word is more accurate and can better reflect the scenario characteristics of the current operation and maintenance scenario, thereby generating an optimized operation and maintenance script that meets the current operation and maintenance scenario.
[0127] To make the solution of the embodiment of the present invention easier to understand, a script generation method is provided below. The method uses ChatGpT as the script analysis model, and the script appeal words and update appeal words are equivalent to the prompt words in the script analysis model. The solution of the embodiment of the present invention includes two processes: a script analysis model construction process and a script recommendation generation process.
[0128] The steps of building a script analysis model process include the following:
[0129] Step S01: Build a personalized prompt according to the requirements and specifications for writing operation and maintenance scripts in different operation and maintenance fields. The prompt example is as follows: Generate a FullGC emergency response shell script for the application manager. The corresponding task is: Generate an application FullGC emergency response shell script. The prompt formula is: Generate a FullGC emergency response shell script for the application field.
[0130] The writing requirements and specifications for operation and maintenance scripts may include: script file naming, script function naming specifications, variable naming specifications, environment variables and constants, temporary file naming specifications, script comments and definition specifications, script input and output comment specifications, etc.
[0131] Step S02: Combine the existing scripts and the result data of the existing scripts into existing samples, train the ChatGPT model, and obtain a script analysis model.
[0132] Step S03: Execute the full-process loop feedback for the script analysis model. Combined with the daily recommended or generated operation and maintenance scripts, feedback accurately determines the personalized prompt words. Combined with the daily operation and maintenance execution situation, generate operation and maintenance samples, and use the operation and maintenance samples to train the script analysis model.
[0133] Figure 4 is a schematic diagram of a script generation process provided by the fourth embodiment of the present invention, such as Figure 4 The script generation process includes the following steps:
[0134] Step S11: The operation and maintenance personnel input the script demand words in text form according to the scene requirements such as the field.
[0135] Step S12: The script analysis model outputs the initial operation and maintenance script based on the teleprompter and natural language learning.
[0136] Step S13: The user or the system determines whether the script needs to be optimized based on the script content of the initial operation and maintenance script. If the script needs to be optimized, return to step S11 to re-determine and input the update demand words.
[0137] After determining that the script needs to be optimized, it can be further determined whether manual optimization is required. If manual optimization is required, a manual adjustment interface is provided, and the user optimizes the initial operation and maintenance script based on the manual adjustment interface.
[0138] If the script does not need to be optimized, step S14 is executed.
[0139] Steps S11 to S13 may be executed multiple times until the user or the system determines that the operation and maintenance script does not need to be optimized.
[0140] Step S14: According to the security management requirements, a high-risk command library is formed. The high-risk command library may include high-risk commands such as rm and drop. The operation and maintenance script generated in step S13 is scanned for high-risk commands, and the operation and maintenance script is optimized and adjusted according to the scanning results.
[0141] Step S15: Perform function tests, scope tests, parameter boundary tests, etc. on the operation and maintenance script, and automatically generate a test report. If the test result characterizes passing, execute step S16. If the test result characterizes failing, generate updated demand words based on the test results and script demand words, and feed them back to the script analysis model again to regenerate the operation and maintenance script, and complete the automatic optimization of the script.
[0142] Step S16: The operation and maintenance scripts that have passed the test are published to the production environment, and new script samples are generated based on the daily production usage and result data for the script analysis model to learn, so as to form a closed-loop management of the entire system life cycle.
[0143] In the solution of the embodiment of the present invention, based on the operation and maintenance of each field and the script specifications, the script appeal words are determined in a personalized manner. If the subsequent specifications and usage conditions change, the script appeal words are optimized accordingly. The existing scripts and the execution process and result data according to the various scenarios are sorted out as existing samples for the ChatGPT model to learn and generate a script analysis model.
[0144] In addition, based on the result data of the current implementation and operation and maintenance process, incremental samples are generated as training data for the script analysis model to optimize the training step analysis model. The operation and maintenance personnel enter the script demand words of the specified requirements, and the script analysis model can automatically recommend or generate scripts. The generated operation and maintenance scripts are manually checked and fine-tuned according to the requirements. The operation and maintenance scripts can also be tested, and the script demand words are optimized and updated according to the test results.
[0145] Figure 5 is a schematic diagram of the structure of a script generating device provided by an embodiment of the present invention, such as Figure 5 As shown, the device comprises:
[0146] The information determination module 501 is used to receive the operation and maintenance prompt information and determine the execution information corresponding to the operation and maintenance prompt information;
[0147] The appeal word generation module 502 is used to generate script appeal words according to the operation and maintenance prompt information and execution information;
[0148] The script generation module 503 is used to input the script demand words into the script analysis model, and obtain the initial operation and maintenance script according to the output result of the script analysis model;
[0149] The strategy determination module 504 is used to perform script testing on the initial operation and maintenance script, obtain test results, and determine an update strategy based on the test results;
[0150] The appeal word updating module 505 is used to update the script appeal words according to the update strategy to obtain updated appeal words;
[0151] The script optimization module 506 is used to generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words.
[0152] Optionally, it also includes:
[0153] Model training module, used to obtain multiple stock scripts;
[0154] For each stock script: determine the result data corresponding to the stock script; combine the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script;
[0155] The initial analysis model is trained using the stock samples corresponding to each stock script to obtain a script analysis model.
[0156] Optionally, the appeal word generation module 502 is specifically used for:
[0157] Determine at least one appeal word example based on the operation and maintenance prompt information and execution information;
[0158] displaying an appeal word list including at least one appeal word example;
[0159] receiving a first editing operation for a target example in the appeal word list;
[0160] Generate script appeal words based on the edited target example.
[0161] Optionally, the script optimization module 506 is further used to:
[0162] Scan the initial operation and maintenance script for high-risk commands;
[0163] In response to the initial operation and maintenance script failing the high-risk command scan, high-risk command adjustment processing is performed on the initial operation and maintenance script.
[0164] Optionally, the update strategy is manual editing;
[0165] The appeal word updating module 505 is specifically used for:
[0166] Display test results and script appeals;
[0167] Receiving a second editing operation of the user on the script appeal word;
[0168] The edited script appeal word is determined as the updated appeal word.
[0169] Optionally, the script optimization module 506 is specifically used for:
[0170] Input the update appeal words into the script analysis model;
[0171] According to the output results of the script analysis model, an optimized operation and maintenance script is obtained.
[0172] Optionally, it also includes:
[0173] Model training module, used to determine the result data of optimizing operation and maintenance scripts in the production environment;
[0174] Combine the optimized operation and maintenance script and the result data corresponding to the optimized operation and maintenance script to generate an operation and maintenance sample corresponding to the optimized operation and maintenance script;
[0175] The script analysis model is trained using the operation and maintenance samples corresponding to the optimized operation and maintenance scripts.
[0176] An embodiment of the present invention provides an electronic device, including:
[0177] one or more processors;
[0178] The storage device is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the method of any of the above embodiments.
[0179] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the script generation method in the embodiment of the present invention is implemented.
[0180] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0181] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0182] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0183] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0184] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0185] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0186] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor, for example, they may be described as: an information determination module, an appeal word generation module, a script generation module, a strategy determination module, an appeal word update module, and a script optimization module. Among them, the names of these modules do not constitute limitations on the modules themselves in certain circumstances. For example, the information determination module may also be described as a "module that receives operation and maintenance prompt information and determines the execution information corresponding to the operation and maintenance prompt information."
[0187] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0188] Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information;
[0189] Generate script appeal words according to the operation and maintenance prompt information and the execution information;
[0190] Inputting the script demand words into the script analysis model, and obtaining an initial operation and maintenance script according to the output result of the script analysis model;
[0191] Perform script tests on the initial operation and maintenance scripts, obtain test results, and determine the update strategy based on the test results;
[0192] According to the update strategy, the script demand words are updated to obtain updated demand words; and according to the updated demand words, an optimized operation and maintenance script corresponding to the initial operation and maintenance script is generated.
[0193] According to the technical solution of the embodiment of the present invention, an initial operation and maintenance script is obtained according to the script claim words. According to the initial operation and maintenance script, the update strategy and the update claim words corresponding to the initial operation and maintenance script are determined; according to the update claim words, an optimized operation and maintenance script is generated. The solution of the embodiment of the present application can automatically generate an operation and maintenance script and optimize the operation and maintenance script. Compared with the method of manually writing an operation and maintenance script, it can reduce the workload and difficulty of operation and maintenance personnel, and improve the efficiency of writing operation and maintenance scripts.
[0194] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A script generation method, characterized in that: include: Receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information; Generate script appeal words according to the operation and maintenance prompt information and the execution information; Inputting the script demand words into the script analysis model, and obtaining an initial operation and maintenance script according to the output result of the script analysis model; Performing script testing on the initial operation and maintenance script to obtain test results, and determining an update strategy based on the test results; According to the update strategy, the script appeal words are updated to obtain updated appeal words; According to the update request words, an optimized operation and maintenance script corresponding to the initial operation and maintenance script is generated.
2. The method according to claim 1, characterized in that Before inputting the script appeal words into the script analysis model, the method further includes: Get multiple stock scripts; For each of the stock scripts: determining result data corresponding to the stock script; combining the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script; The initial analysis model is trained using the stock samples corresponding to each of the stock scripts to obtain the script analysis model.
3. The method according to claim 1, characterized in that The step of generating a script appeal word according to the operation and maintenance prompt information and the execution information includes: Determining at least one appeal word example according to the operation and maintenance prompt information and the execution information; displaying an appeal word list including the at least one appeal word example; receiving a first editing operation for a target example in the appeal word list; The script appeal words are generated according to the edited target example.
4. The method according to claim 1, characterized in that: Before obtaining the update demand words according to the initial operation and maintenance script, the method further includes: Scanning the initial operation and maintenance script for high-risk commands; In response to the initial operation and maintenance script failing the high-risk command scan, high-risk command adjustment processing is performed on the initial operation and maintenance script.
5. The method according to claim 1, characterized in that The update strategy is manual editing; The updating process of the script appeal words according to the updating strategy to obtain updated appeal words includes: Displaying the test results and the script appeal words; Receiving a second editing operation of the user on the script appeal word; The edited script appeal word is determined as the update appeal word.
6. The method according to claim 1, characterized in that Generating an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words includes: Inputting the update appeal words into the script analysis model; The optimized operation and maintenance script is obtained according to the output result of the script analysis model.
7. The method according to claim 1, characterized in that After generating the optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words, the method further includes: Determine the result data of the optimized operation and maintenance script in the production environment; Combining the optimized operation and maintenance script and the result data corresponding to the optimized operation and maintenance script to generate an operation and maintenance sample corresponding to the optimized operation and maintenance script; The script analysis model is trained using the operation and maintenance samples corresponding to the optimized operation and maintenance script.
8. A script generation device, characterized in that: include: An information determination module, used to receive operation and maintenance prompt information, and determine execution information corresponding to the operation and maintenance prompt information; A demand word generation module, used to generate a script demand word according to the operation and maintenance prompt information and the execution information; A script generation module, used to input the script appeal words into a script analysis model, and obtain an initial operation and maintenance script according to the output result of the script analysis model; A strategy determination module is used to perform script testing on the initial operation and maintenance script, obtain test results, and determine an update strategy based on the test results; An appeal word updating module, used for updating the script appeal words according to the update strategy to obtain updated appeal words; The script optimization module is used to generate an optimized operation and maintenance script corresponding to the initial operation and maintenance script according to the update demand words.
9. The device according to claim 8, characterized in that Also includes: Model training module, used to obtain multiple stock scripts; For each of the stock scripts: determining result data corresponding to the stock script; Combining the stock script and the result data corresponding to the stock script to generate a stock sample corresponding to the stock script; The initial analysis model is trained using the stock samples corresponding to each of the stock scripts to obtain the script analysis model.
10. The device according to claim 8, characterized in that The appeal word generation module is specifically used for: Determining at least one appeal word example according to the operation and maintenance prompt information and the execution information; displaying an appeal word list including the at least one appeal word example; receiving a first editing operation for a target example in the appeal word list; The script appeal words are generated according to the edited target example.
11. The device according to claim 8, characterized in that The script optimization module is also used to: Scanning the initial operation and maintenance script for high-risk commands; In response to the initial operation and maintenance script failing the high-risk command scan, high-risk command adjustment processing is performed on the initial operation and maintenance script.
12. The device according to claim 8, characterized in that The update strategy is manual editing; The appeal word updating module is specifically used for: Displaying the test results and the script appeal words; Receiving a second editing operation of the user on the script appeal word; The edited script appeal word is determined as the update appeal word.
13. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
14. A computer readable medium having a computer program stored thereon, characterized in that When the program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Hybrid cloud resource operation and maintenance scheduling method and device based on large model, equipment and storage medium
CN120631593A
Emergency plan generation method and device based on automation technology, equipment and medium
CN122966346A
