Operation and maintenance script processing method and device, electronic equipment and storage medium

Through the rating agent Agent, the risk assessment of the operation and maintenance scripts was solved, and the risk problems in operation and maintenance script execution operations were realized, automated risk assessment and processing strategies were realized, and the security and efficiency of operation and maintenance work were improved.

CN119848875APending Publication Date: 2025-04-18WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510014939.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the field of operation and maintenance, there are risks in operation and maintenance script execution operations, and there is a lack of effective risk assessment solutions.

Method used

By obtaining the target information of the operation and maintenance script, using the rating agent Agent for analysis, obtaining the risk assessment level of the operation and maintenance script, and formulating processing strategies based on the level.

Benefits of technology

Automatic operation and maintenance script risk assessment is realized, reducing the risk of manual evaluation and improving the safety and efficiency of operation and maintenance work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848875A_ABST
    Figure CN119848875A_ABST
Patent Text Reader

Abstract

The invention discloses an operation and maintenance script processing method and device, electronic equipment and a storage medium, and belongs to the technical field of operation and maintaining.The method comprises the steps that target information needed for risk assessment of an operation and maintenance script is obtained, a rating Agent is used for analyzing the target information, and the risk assessment level of the operation and maintenance script is obtained; and then the operation and maintenance script is processed according to a processing strategy corresponding to the risk assessment level, and a scheme for automatically performing risk assessment on the operation and maintenance script by means of the rating Agent is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of operation and maintenance technology, and in particular to a method, device, electronic device and storage medium for processing an operation and maintenance script. Background Art

[0002] In the field of operation and maintenance, operation and maintenance personnel need to write a large number of operation and maintenance scripts to support daily operation and maintenance work. Operation and maintenance scripts have execution risks. Therefore, it is necessary to conduct risk assessment on operation and maintenance scripts, but there is a lack of effective risk assessment solutions in related technologies. Summary of the invention

[0003] The embodiments of the present application provide a method, device, electronic device and storage medium for processing an operation and maintenance script, so as to provide a solution for risk assessment of the operation and maintenance script.

[0004] In a first aspect, an embodiment of the present application provides a method for processing an operation and maintenance script, including:

[0005] Acquire target information required for risk assessment of operation and maintenance scripts, wherein the target information includes the operation and maintenance scripts;

[0006] Analyze the target information using a rating agent to obtain a risk assessment level of the operation and maintenance script;

[0007] The operation and maintenance script is processed according to a processing strategy corresponding to the risk assessment level.

[0008] In a second aspect, an embodiment of the present application provides a device for processing an operation and maintenance script, including:

[0009] An acquisition module is used to obtain target information required for risk assessment of operation and maintenance scripts;

[0010] An analysis module, used to analyze the target information using a rating agent to obtain a risk assessment level of the operation and maintenance script;

[0011] A processing module is used to process the operation and maintenance script according to a processing strategy corresponding to the risk assessment level.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein:

[0013] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned operation and maintenance script processing method.

[0014] In a fourth aspect, an embodiment of the present application provides a storage medium. When a computer program in the storage medium is executed by a processor of an electronic device, the electronic device can execute the above-mentioned operation and maintenance script processing method.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned operation and maintenance script processing method when executed by a processor.

[0016] In an embodiment of the present application, target information required for risk assessment of operation and maintenance scripts is obtained, and the target information is analyzed using a rating agent to obtain a risk assessment level of the operation and maintenance scripts. Then, the operation and maintenance scripts are processed according to a processing strategy corresponding to the risk assessment level, thereby providing a solution for automatically performing risk assessment on operation and maintenance scripts with the help of a rating agent. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 A flowchart of a method for processing an operation and maintenance script provided in an embodiment of the present application;

[0019] Figure 2 A flow chart for determining a risk assessment level of an operation and maintenance script provided in an embodiment of the present application;

[0020] Figure 3 A schematic diagram of a process for processing an operation and maintenance script provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of a decision tree provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of a processing device for operation and maintenance scripts provided in an embodiment of the present application;

[0023] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing a method for processing operation and maintenance scripts provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to provide a solution for risk assessment of operation and maintenance scripts, embodiments of the present application provide a method, device, electronic device, and storage medium for processing operation and maintenance scripts.

[0025] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0026] In order to facilitate the understanding of this application, the technical terms involved in this application are:

[0027] Operation and maintenance scripts are scripts written to monitor whether the software is running normally. They can be divided into many types according to the usage scenarios, such as log analysis, monitoring alarm, database operation, etc.

[0028] Agent, an intelligent agent built on a large language model (LLM), has the ability to perceive the environment, autonomously understand, make decisions and execute actions.

[0029] Graceful offline refers to taking a series of measures to minimize the impact of service cessation on existing users and systems before stopping the service in the service update, migration or fault handling of distributed systems. Its purpose is to ensure a smooth transition of services and avoid sudden service interruption or data loss for users.

[0030] See also Figure 1 , Figure 1 A flowchart of a method for processing an operation and maintenance script provided in an embodiment of the present application includes the following steps.

[0031] In step 101, target information required for risk assessment of operation and maintenance scripts is obtained, and the target information includes the operation and maintenance scripts.

[0032] In step 102, the target information is analyzed using a rating agent to obtain a risk assessment level of the operation and maintenance script.

[0033] In some embodiments, the target information also includes evaluation prompts corresponding to each node in the decision tree of the operation and maintenance script, and the rating agent can Figure 2 The steps shown determine the risk assessment level of the operation and maintenance script, including the following steps:

[0034] In step 1021, the operation and maintenance script and the evaluation prompt words corresponding to the target node of the operation and maintenance script in the decision tree are input into the corresponding large model to obtain an output result, which includes the scores of the operation and maintenance script at multiple risk levels. Initially, the target node is the root node of the decision tree.

[0035] In step 1022, according to the output result, a leaf node is searched in the decision tree.

[0036] For example, if the output result is the preset output result corresponding to the target node, the node on the right fork of the target node in the decision tree can be determined as a leaf node; if the output result is not the preset output result corresponding to the target node, the node on the left fork of the target node in the decision tree can be determined as a leaf node.

[0037] In step 1023, determine whether a leaf node is found, if so, go to step 1024, if not, go to step 1025.

[0038] Among them, when the target node is already a leaf node at the bottom of the decision tree, no leaf node can be found.

[0039] In step 1024, the leaf node is used as the target node and the process returns to step 1021.

[0040] In step 1025, the risk assessment level is determined based on the scores of the operation and maintenance scripts in each output result at multiple risk levels.

[0041] For example, the probability scores of each output operation and maintenance script at the same risk level can be summed to obtain the total score of the operation and maintenance script at this risk level. Then, the total scores of the operation and maintenance script at various risk levels can be weighted and summed to obtain a first score. Then, the risk assessment level can be determined based on the first score.

[0042] In some embodiments, the level corresponding to the interval into which the first score falls can be directly determined as the final risk assessment level.

[0043] In some embodiments, a weighted sum of the first score and the target score may be performed to obtain a final score, and the level corresponding to the interval into which the final score falls may be determined as the final risk assessment level.

[0044] Among them, the target score may include at least one of the second score, the third score and the fourth score, the second score is obtained by analyzing the operation and maintenance script through the scenario agent, the scenario agent is determined by classifying the usage scenarios of the operation and maintenance script through the classification agent, the third score is obtained by analyzing the operation and maintenance script through the general process agent, and the fourth score is obtained by analyzing the operation and maintenance script through the supplementary process agent.

[0045] In this way, the output results of multiple agents are combined to determine the final risk assessment level of the operation and maintenance script, thereby improving the accuracy of the risk assessment level.

[0046] Furthermore, when the target score includes the second score, the target information may also include the first risk assessment data output by the scenario Agent, and the first risk assessment data includes the second score; when the target score includes the third score, the target information may also include the second risk assessment data output by the general process Agent, and the second risk assessment data includes the third score; when the target score includes the fourth score, the target information may also include the third risk assessment data output by the supplementary process Agent, and the third risk assessment data includes the fourth score.

[0047] That is, the rating agent can determine the risk assessment level of the operation and maintenance script in combination with the output result of at least one other agent, so that more information can be considered to facilitate the rating agent to make a more accurate risk assessment.

[0048] In step 103, the operation and maintenance script is processed according to the processing strategy corresponding to the risk assessment level.

[0049] That is, different script management measures are implemented for operation and maintenance scripts of different risk levels. For example, if it is a low-risk script, it can be executed directly; if it is a medium-risk script, it needs to be double-checked before it can be executed; if it is a high-risk script, it needs to be approved before it can be executed.

[0050] In addition, the operation and maintenance script can be simulated and tested by the simulation test agent to obtain the simulation test results of the operation and maintenance script.

[0051] See also Figure 3 , Figure 3 A schematic diagram of a process for processing an operation and maintenance script provided in an embodiment of the present application, wherein a classification processing agent analyzes the usage scenario of the operation and maintenance script, obtains the scenario agent to which the operation and maintenance script belongs, such as a log analysis agent, a monitoring alarm agent, a database operation agent, other automation agents, etc., and the corresponding scenario agent analyzes the risk of the operation and maintenance script in the corresponding usage scenario to obtain the first risk assessment data, and the general process agent analyzes whether there are some general risks in the operation and maintenance script to obtain the second risk assessment data; the supplementary process agent analyzes whether there are some supplementary risks in the operation and maintenance script to obtain the third risk assessment data. Finally, according to the operation and maintenance script, the evaluation prompt words corresponding to each node in the pre-constructed decision tree of the operation and maintenance script, the first risk assessment data, the second risk assessment data, and the third risk assessment data, the risk assessment level of the operation and maintenance script is determined by the scoring and rating agent (i.e., the rating agent), and then the operation and maintenance script can be processed according to the processing strategy corresponding to the risk assessment level. In addition, the operation and maintenance script can also be input into the simulation test agent to obtain the simulation test result of the operation and maintenance script.

[0052] In specific implementation, each Agent runs based on a dedicated big model. The big model works under prompts. Prompts are used to instruct how the big model works. Generally, prompts include general prompts such as goals, steps, return results, restriction requirements, etc., as well as some personalized prompts.

[0053] The following is an introduction to the operation process of each Agent.

[0054] 1. Classification and processing Agent: It is used to read the code of the operation and maintenance script, determine the usage scenario of the operation and maintenance script according to the code, and divide the operation and maintenance script into the following four usage scenarios: log analysis scenario, monitoring and alarm scenario, database operation scenario and other automation scenarios. Then, the corresponding scenario Agent is called according to the divided scenario, and the flow is transferred to the scenario Agent for processing.

[0055] The following shows the prompt for the classification processing agent:

[0056] **Target**

[0057] You are a senior operation and maintenance engineer who can clearly judge the role and usage scenarios of operation and maintenance scripts.

[0058] I will give you an operation and maintenance script. You need to determine the usage scenarios involved in this operation and maintenance script. Select one of the following four scenarios: <log analysis>, <monitoring alarm>, <database operation>, and <other automation>.

[0059] **Scenario definition**

[0060] Log analysis: The operation and maintenance script involves operations such as log analysis and log processing, which are defined as log analysis scenarios;

[0061] Monitoring and alarm: Operation and maintenance scripts involve monitoring processing, monitoring indicator collection and processing, alarm optimization and processing, etc., which are defined as monitoring and alarm scenarios;

[0062] Database operation: Operation and maintenance scripts involving data operations and database processing are defined as database operation scenarios;

[0063] Other automation: If the operation and maintenance script does not involve the above scenarios such as <log analysis>, <monitoring alarm>, and <database operation>, the operation and maintenance script is classified as <other automation> scenario.

[0064] **step**

[0065] Step 1. Determine whether the operation and maintenance script belongs to the <Log Analysis> scenario;

[0066] Step 2. If the operation and maintenance script does not belong to the <log analysis> scenario, determine whether the operation and maintenance script belongs to the <monitoring alarm> scenario;

[0067] Step 3. If the operation and maintenance script does not belong to the <monitoring alarm> scenario, determine whether the operation and maintenance script belongs to the <database operation> scenario;

[0068] Step 4. If the operation and maintenance script does not belong to the <Database Operation> scenario, the operation and maintenance script is classified as the <Other Automation> scenario.

[0069] **Return results**

[0070] Returns the specific usage scenario of the operation and maintenance script in the form of markdown. The returned format requirements are as follows:

[0071] Classification results:

[0072] `Operation and maintenance script usage scenario`: "<determined specific scenario>".

[0073] **RESTRICTIONS**

[0074] 1. Output the results strictly in the required format;

[0075] 2. The output language is Chinese;

[0076] 3. No additional information is required, including a closing statement.

[0077] The following is the operation and maintenance script I provided:

[0078] {Operation and maintenance script code}.

[0079] 2. Log Analysis Agent: used to determine the risk items involved in log analysis, such as whether sensitive files are involved, whether sensitive operations are involved, and whether there are risky operations or instructions.

[0080] The following shows the prompt of the log analysis agent:

[0081] **Target**

[0082] You are a senior operation and maintenance engineer who can accurately judge the risks and hidden dangers of operation and maintenance scripts.

[0083] I will give you an operation and maintenance script related to log analysis. You need to evaluate whether there are risks in the log analysis and processing of this operation and maintenance script, and finally evaluate a security risk level and security risk score for the operation and maintenance script.

[0084] **Definition of Risk Levels and Security Risk Scores**

[0085] Low risk: issues that lead to system performance degradation, improper log management, or inefficient analysis, affecting operation and maintenance efficiency but not directly threatening system security;

[0086] Medium risk: security issues that may lead to unauthorized data access, log forgery, or false security alerts, indirectly affecting system security and data integrity;

[0087] High risk: security issues that may lead to sensitive data leakage, arbitrary code execution, or complete loss of system control;

[0088] Safety risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk. The score of high risk level cannot exceed 60 points, and the score of medium risk level cannot exceed 80 points.

[0089] **step**

[0090] Step 1. Determine whether the operation and maintenance script involves operations that access sensitive files or sensitive information;

[0091] Step 2: Determine whether there is information leakage in the operation and maintenance script or obvious processing logic defects in the code analysis;

[0092] Step 3. Evaluate whether the operation and maintenance script contains high-risk instructions or risky operations;

[0093] Step 4. Summarize the assessment results and give the security risk assessment level and security risk score.

[0094] **Return results**

[0095] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0096] Log analysis and evaluation results:

[0097] `Log analysis risk assessment result`: "<assessment result>";

[0098] `Risk Assessment Level`: "<risk level>";

[0099] `risk score`: "<score from 0 to 100>".

[0100] **RESTRICTIONS**

[0101] 1. Output the results strictly in the required format;

[0102] 2. The output language is Chinese;

[0103] 3. No additional information is required, including a closing statement.

[0104] The following is the operation and maintenance script I provided:

[0105] {Operation and maintenance script code}.

[0106] 3. Monitoring and alarm agent, used to determine the risk items involved in monitoring and alarm, such as whether the monitoring dimensions are complete, and whether the monitoring indicators and alarm thresholds are reasonable.

[0107] The following shows the prompt of the monitoring alarm agent:

[0108] **Target**

[0109] You are a senior operation and maintenance engineer who can accurately judge the risks and hidden dangers of operation and maintenance monitoring scripts.

[0110] I will give you an operation and maintenance script related to monitoring and alarm. You need to evaluate whether there are risk items in the monitoring and alarm processing of this operation and maintenance script, and evaluate a security risk level and security risk score for this operation and maintenance script.

[0111] **Definition of Risk Levels and Security Risk Scores**

[0112] Low risk: This problem causes too frequent or insufficient alarm information, inaccurate monitoring data analysis, and affects the efficiency of operation and maintenance decision-making, but does not directly threaten system stability and security.

[0113] Medium risk: problems that may cause alarm delays, erroneous alarm triggering, or partial monitoring data loss, indirectly affecting system stability and security;

[0114] High risk: issues that may lead to monitoring failure, crash of key system components, or security vulnerabilities not being discovered in a timely manner;

[0115] Safety risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk. The score of high risk level cannot exceed 60 points, and the score of medium risk level cannot exceed 80 points.

[0116] **step**

[0117] Step 1. Determine whether the monitoring dimension indicators of the operation and maintenance script are complete (if any);

[0118] Step 2. Determine whether the monitoring threshold configuration of the operation and maintenance script is reasonable (if any);

[0119] Step 3. Evaluate whether the operation and maintenance script contains high-risk instructions or risky operations;

[0120] Step 4. Evaluate whether the operation and maintenance script involves other risk issues;

[0121] Step 5. Summarize the assessment results and give the security risk assessment level and security risk score.

[0122] **Return results**

[0123] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0124] Monitoring alarm evaluation results:

[0125] `Monitoring alarm risk assessment result`: "<assessment result>";

[0126] `Risk Assessment Level`: "<risk level>";

[0127] `risk score`: "<score from 0 to 100>".

[0128] **RESTRICTIONS**

[0129] 1. Output the results strictly in the required format;

[0130] 2. The output language is Chinese;

[0131] 3. No additional information is required, including a closing statement.

[0132] The following is the operation and maintenance script I provided:

[0133] {Operation and maintenance script code}.

[0134] 4. Database operation Agent is used to determine the risk items related to database operations. First, it determines the type of database operation, and then determines whether there is a data operation risk in the modification amount or query range involved in this database operation.

[0135] The following shows the prompt of the database operation agent:

[0136] **Target**

[0137] You are a senior operation and maintenance engineer who can accurately judge the risks and hidden dangers of operation and maintenance database operation scripts.

[0138] I will give you an operation and maintenance script related to database operations. You need to evaluate whether there are risks in the database operation processing of this operation and maintenance script, and finally evaluate a security risk level and security risk score for this operation and maintenance script.

[0139] **Definition of Risk Levels and Security Risk Scores**

[0140] Low risk: issues that lead to inefficient query, improper logging, or slight increase in resource usage, affecting database operation efficiency but not directly threatening data security and service availability;

[0141] Medium risk: issues that may cause data inconsistency, performance degradation, or temporary unavailability of some services;

[0142] High risk: issues that may result in data loss, data leakage, or database service unavailability;

[0143] Safety risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk. The score for high-risk level cannot exceed 60 points, and the score for medium-risk level cannot exceed 80 points.

[0144] **step**

[0145] Step 1. Determine the operation type of this database operation and maintenance script. If it is a non-query data operation, set the risk level to medium or high risk;

[0146] Step 2. Determine the data modification amount or query range of this database operation and maintenance script. If the data modification amount exceeds 500 or the query amount exceeds 5,000, the risk level is set to medium or high risk.

[0147] Step 3. Evaluate whether the database operation script contains other high-risk instructions or risky operations;

[0148] Step 4. Summarize the assessment results and give the security risk assessment level and security risk score.

[0149] **Return results**

[0150] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0151] Database operation evaluation results:

[0152] `Database operation risk assessment result`: "<assessment result>";

[0153] `Risk Assessment Level`: "<risk level>";

[0154] `risk score`: "<score from 0 to 100>".

[0155] **RESTRICTIONS**

[0156] 1. Output the results strictly in the required format;

[0157] 2. The output language is Chinese;

[0158] 3. No additional information is required, including a closing statement.

[0159] The following is the operation and maintenance script I provided:

[0160] {Operation and maintenance script code}.

[0161] 5. Other automated agents are used to process operation and maintenance scripts that do not belong to the above scenario agents, mainly including reliability analysis and risk operation instruction analysis.

[0162] The following shows prompts for other automated agents:

[0163] **Target**

[0164] You are a senior operation and maintenance engineer who can accurately identify the risks and hidden dangers of operation and maintenance scripts.

[0165] I will give you an automated operation and maintenance script. You need to evaluate whether there are any risk items in this operation and maintenance script, and give the operation and maintenance script a security risk level and security risk score.

[0166] **Definition of Risk Levels and Security Risk Scores**

[0167] Low risk: issues that lead to low efficiency in automated task execution, slight waste of resources, or increased management complexity, affecting the efficiency of O&M automation but not directly threatening system security and stability;

[0168] Medium risk: issues that may cause automation process interruption, incorrect operation execution, or resource abuse, indirectly affecting system performance and stability;

[0169] High risk: issues that could damage critical system components, compromise data integrity, or paralyze the entire system;

[0170] Safety risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk. The score of high risk level cannot exceed 60 points, and the score of medium risk level cannot exceed 80 points.

[0171] **step**

[0172] Step 1. Determine whether the automation script has obvious logical flaws and reliability risks;

[0173] Step 2: Determine whether the operation and maintenance script contains high-risk instructions or risky operations;

[0174] Step 3. Evaluate whether the operation and maintenance scripts handle other risk operations;

[0175] Step 4. Summarize the assessment results and give the security risk assessment level and security risk score.

[0176] **Return results**

[0177] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0178] Other automated script evaluation results:

[0179] `Other automated risk assessment results`: "<assessment result>";

[0180] `Risk Assessment Level`: "<risk level>";

[0181] `risk score`: "<score from 0 to 100>".

[0182] **RESTRICTIONS**

[0183] 1. Output the results strictly in the required format;

[0184] 2. The output language is Chinese;

[0185] 3. No additional information is required, including a closing statement.

[0186] The following is the operation and maintenance script I provided:

[0187] {Operation and maintenance script code}.

[0188] 6. General process Agent is used to judge the dimensional indicators related to the security risks of operation and maintenance scripts, such as whether they contain sensitive information, whether there are security risks such as plain text passwords and certificate leakage; judge the risk indicators related to stability, such as whether there are logical defects, code defects, syntax errors and hard coding; judge the risk items related to the operability of operation and maintenance scripts, such as whether there are risks related to lack of comments and code readability; judge whether there are dependency risks, such as dependencies on third-party libraries and external services.

[0189] The following shows the prompt of the general process agent:

[0190] **Target**

[0191] You are a senior operation and maintenance engineer who can clearly identify the risks and hidden dangers in operation and maintenance scripts.

[0192] I will give you an operation and maintenance script. You need to evaluate whether this operation and maintenance script involves risk items from specified dimensions, and finally give the operation and maintenance script a security risk level and security risk score.

[0193] **Definition of Risk Levels and Security Risk Scores**

[0194] Low risk: security issues that have only a slight or indirect impact on system security, data integrity or availability and will not directly lead to serious security consequences;

[0195] Medium risk: security issues that may have a moderate impact on data integrity or system performance, but are unlikely to lead to complete loss of system control or large-scale data leakage;

[0196] High risk: security issues that may lead to serious data leakage, complete control of the system, or long-term service interruption;

[0197] Safety risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk. The score for high-risk level cannot exceed 60 points, and the score for medium-risk level cannot exceed 80 points.

[0198] **step**

[0199] Step 1. Determine whether the operation and maintenance script has security risks, such as whether it contains sensitive information, whether there are plain text passwords, and risks of certificate leakage;

[0200] Step 2: Determine whether the operation and maintenance script has stability risks, such as whether there are logic or code defects, syntax errors, or hard-coded codes;

[0201] Step 3. Evaluate the maintainability risk of the operation and maintenance script, such as whether the code comments are complete and whether the code readability is clear;

[0202] Step 4. Determine the dependency risk of the operation and maintenance script and whether there is any dependency on third-party libraries or external services;

[0203] Step 5. Summarize the assessment results and give the security risk assessment level and security risk score.

[0204] **Return results**

[0205] The evaluation indicators of the four specific dimensions, risk level evaluation and scores are returned in the form of markdown. The returned format requirements are as follows:

[0206] Generic Process Assessment Results:

[0207] `Security risk`: "<security risk assessment result>";

[0208] `stability risk`: "<assessment result of stability risk>";

[0209] `Maintainability risk`: "<Maintainability risk assessment result>";

[0210] `Dependency risk`: "<Dependency risk assessment result>";

[0211] `Security risk assessment level`: "<risk level>";

[0212] `Security Risk Score`: "<score from 0 to 100>".

[0213] **RESTRICTIONS**

[0214] 1. Output the results strictly in the required format;

[0215] 2. The output language is Chinese;

[0216] 3. No additional information is required, including a closing statement.

[0217] The following is the operation and maintenance script I provided:

[0218] {Operation and maintenance script code}.

[0219] 7. Supplementary process agent is used to make a supplementary judgment to determine whether the operation and maintenance script meets the requirements related to compliance audit and whether the execution of the operation and maintenance script meets the performance requirements.

[0220] The following shows the prompt of the supplementary process Agent:

[0221] **Target**

[0222] You are an experienced operation and maintenance script reviewer who can accurately determine the risks and hidden dangers of operation and maintenance scripts.

[0223] I will give you an operation and maintenance script and a compliance audit document. You need to review whether the operation and maintenance script meets the requirements of the compliance audit and finally assess a risk score for the operation and maintenance script.

[0224] **Risk score definition**

[0225] Security risk score: The score ranges from 0 to 100. The higher the score, the safer and the lower the risk.

[0226] **step**

[0227] Step 1. Determine whether the operation and maintenance script meets the performance requirements;

[0228] Step 2: Determine whether the operation and maintenance script meets the requirements of the compliance audit, and evaluate the content that does not meet the requirements or the code that may violate the compliance audit;

[0229] Step 3. Summarize the assessment results and give a risk score.

[0230] **Return results**

[0231] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0232] Supplementary process assessment results:

[0233] `Supplementary process risk assessment results`: "<assessment results>";

[0234] `risk score`: "<score from 0 to 100>".

[0235] **RESTRICTIONS**

[0236] 1. Output the results strictly in the required format;

[0237] 2. The output language is Chinese;

[0238] 3. No additional information is required, including a closing statement.

[0239] The following is the operation and maintenance script I provided:

[0240] {Operation and maintenance script code}.

[0241] 8. Simulation test agent is used to call the code execution tool to simulate the execution of operation and maintenance scripts, and automatically generate multiple test cases to test the operation and maintenance scripts. According to the execution results, it judges the possible risks involved.

[0242] The following shows the prompt of the simulated test agent:

[0243] **Target**

[0244] You are an experienced operation and maintenance script interpreter who can correctly simulate the execution results of operation and maintenance scripts.

[0245] I will give you an operation and maintenance script. You need to generate test cases for the operation and maintenance script and simulate the execution results. Finally, you need to evaluate the possible risks in the execution of the operation and maintenance script.

[0246] **step**

[0247] Step 1. Generate test cases for this operation and maintenance script;

[0248] Step 2. Simulate and execute the operation and maintenance script based on the test case;

[0249] Step 3. Based on the simulation results, evaluate possible risks.

[0250] **Return results**

[0251] Returns the specific evaluation results in markdown format. The returned format requirements are as follows:

[0252] Mock test evaluation results:

[0253] `Mock test evaluation result`: "<evaluation result>".

[0254] **RESTRICTIONS**

[0255] 1. Output the results strictly in the required format;

[0256] 2. The output language is Chinese;

[0257] 3. No additional information is required, including a closing statement.

[0258] The following is the operation and maintenance script I provided:

[0259] {Operation and maintenance script code}.

[0260] 9. Scoring and rating Agent is used to comprehensively consider the processing results of the previous related agents, score the operation and maintenance script, and determine the final risk level of the operation and maintenance script based on the scoring results.

[0261] The following is a detailed introduction to the internal processing of the scoring and rating agent.

[0262] In the scoring and rating agent, the risks of operation and maintenance scripts are divided into 12 dimensions:

[0263] 1. Security risks;

[0264] 2. Risk of logical defects;

[0265] 3. High-risk instruction risks;

[0266] 4. Data operation risks;

[0267] 5. Reliability risk;

[0268] 6. Monitor and warn risks;

[0269] 7. Sensitive information risks;

[0270] 8. External dependence risk;

[0271] 9. Maintenance risks;

[0272] 10. Performance risks;

[0273] 11. Compatibility risks;

[0274] 12. Configuration management risks;

[0275] Among them, each risk dimension has specific risk details, which are used to analyze the correlation between the current operation and maintenance script and this risk dimension.

[0276] Then, the decision tree is introduced for risk assessment, see Figure 4 , Figure 4 A schematic diagram of a decision tree provided in an embodiment of the present application, wherein the decision tree is a four-layer binary tree, and each node in the decision tree corresponds to at least one dimension among 12 dimensions. Figure 4 The number in the middle node indicates the number of the dimension corresponding to the node. In addition, the node will also correspond to multiple risk level scores. When it is determined that the operation and maintenance script has risks in the corresponding dimensions, the operation and maintenance script obtains the scores of these multiple risk levels and moves to the leaf node on the right branch of this node. Otherwise, the operation and maintenance script does not obtain the scores of these multiple risk levels and moves to the leaf node on the left branch. Taking the root node as an example, it represents the inspection of security risks, and the medium risk score is 0.3 and the high risk score is 0.7. If the operation and maintenance script has security risks, it will obtain a medium risk score of 0.3 and a high risk score of 0.7, and move to the leaf on the right branch to continue the inspection; if it does not meet the requirements, it will not obtain the corresponding score and move to the leaf on the left branch to continue the inspection.

[0277] The following is an introduction to the operation process of the decision tree.

[0278] Suppose that three risk levels, high, medium and low, are defined as score records S = {x, y, z}, where x represents the score for low risk, y represents the score for medium risk, and z represents the score for high risk.

[0279] In specific implementation, starting from the root node of the decision tree, determine whether the operation and maintenance script has the risk of the risk dimension corresponding to the root node. If so (the assessed risk probability is greater than the set threshold such as 0.65), then record S plus the corresponding risk level score. For example, for the root node, the high risk score is 0.7 and the medium risk score is 0.3. If the operation and maintenance script has the risk of the risk dimension corresponding to the root node, then y=y+0.3, z=z+0.7, and transfer to the leaf node of the right branch, otherwise, record S remains unchanged and transfers to the leaf node of the left branch. After reaching the next node, the same logic is followed and transferred to the next node until the bottom leaf node is processed. Then, x, y, and z in record S are weighted to obtain the risk assessment score S0 (i.e., the first score) of the decision tree:

[0280]

[0281] Among them, w1, w2, w3 represent the weights of x, y, z respectively, which can be predetermined, for example, w1, w2, w3 are 0.6, 0.8, 1.4 respectively, and r is also a predetermined factor such as 3.49.

[0282] In practical applications, the scoring and rating agent can be processed according to the following steps:

[0283] 1. Based on the contents of C1 to C3, summarize the risk item C5 and evaluate a risk score S0 according to the above decision tree process;

[0284] 2. Take the weighted average of S1, S2, S3 and S0 to calculate the final risk score S (i.e., the final score), where the parameters of the weighted average are as follows:

[0285] S=0.4S0+0.2S1+0.3S2+0.1S3;

[0286] Among them, S1 is the second score, included in C2, S2 is the third score, included in C1, and S3 is the fourth score, included in C3.

[0287] 3. Divide the S score into risk levels P according to 0-60 high risk, 60-80 medium risk, and 80-100 low risk.

[0288] The following uses a specific operation and maintenance script as an example to introduce the solution of the embodiment of the present application.

[0289] Assume that the main function of the operation and maintenance script is to handle and isolate abnormal message queue (MQ) brokers (a node in the Kafka cluster that is responsible for processing client requests and also for storing and replicating data sent by clients). Specifically, the operation and maintenance script uses a series of commands and logic to check, collect information, gracefully shut down, or directly isolate brokers to ensure the stability and availability of the message queue system.

[0290] The following is a brief overview of the operation and maintenance script:

[0291] 1. Initialization and logging of environment and variables;

[0292] 2. Define functions: define offline broker offline functions and information collection functions;

[0293] 3. Get input parameters: Get the Broker's Internet Protocol Address (IP), group name, and a flag to determine whether to collect information;

[0294] 4. Get the configuration information of Broker;

[0295] 5. Check if Broker exists;

[0296] 6. Check the Broker status;

[0297] 7. Perform different operations according to the Broker type:

[0298] a) Log Broker: collect information first, then try to gracefully shut down the Broker. If the shutdown fails, it will be shut down directly;

[0299] b) Asynchronous Broker and designated Broker: collect information first, then stop the Broker process directly. Do not go offline directly.

[0300] c) Specify Master and Slave:

[0301] -When the Master is abnormal, collect information first, and then try to gracefully shut down the Master;

[0302] -When a Slave is abnormal, collect information first, and then try to gracefully log off the Master. Do not log off directly.

[0303] 8. Record the operation results;

[0304] 9. Send notification.

[0305] During specific implementation, the operation and maintenance script is processed by the general process Agent. Specifically, the content of the operation and maintenance script and the prompt of the general process are input into the large model corresponding to the process Agent, wherein the prompt of the general process has been given before. The following is the result returned by the large model (i.e., the second risk assessment data), denoted as C1.

[0306] C1:

[0307] `Security risks`: "The operation and maintenance script has certain security risks. The operation and maintenance script uses the Secure Shell Protocol (SSH) connection, but the SSH key is not managed, which poses a risk of plain text password transmission. In addition, the operation and maintenance script calls multiple external commands. If these commands are tampered with, it may cause security issues."

[0308] `Stability risk`: "The operation and maintenance script has some logical and code defects. For example, the judgment condition of the `gatherFlag` variable is not rigorous, which may lead to unexpected execution paths. In addition, the command execution results in the `offlineBroker` function do not have sufficient error handling, which may cause the operation and maintenance script to fail and cannot continue to execute."

[0309] `Maintainability risk`: "The maintainability of the operation and maintenance script is poor. There are few code comments, the naming of some variables and functions is not clear, and the code structure is relatively complex, which increases the difficulty of maintenance."

[0310] `Dependency risk`: "The operation and maintenance script depends on multiple external services and third-party libraries, such as SSH, Python scripts, `runadmin.sh`, etc. If there are problems with these dependent services or libraries, the operation and maintenance script may not run properly."

[0311] `Security risk assessment level`: "Medium risk"

[0312] `Security Risk Score`: "75".

[0313] At this time, the value of S1 is 75.

[0314] Then, the content of the operation and maintenance script and the prompt of the classification processing agent are provided to the big model of the classification processing agent. The prompt of the classification processing agent has been given before. It is assumed that the result returned by the big model is: `Operation and maintenance script usage scenario`: "other automation".

[0315] It can be seen that the classification processing agent classifies the operation and maintenance script into other automation categories, so the process flows to other automation agents, and the prompt of other automation agents and the code of the operation and maintenance script are provided as input to the big model of other automation agents. The following is the return result of the big model, recorded as C2 (i.e., the first risk assessment data):

[0316] C2:

[0317] `Other automated risk assessment results`: "There are some potential risks in the operation and maintenance script. For example, `set-ex` is used in the operation and maintenance script, which may cause the operation and maintenance script to exit immediately when an error occurs during execution, affecting the execution of subsequent operations. In addition, there are multiple SSH commands in the operation and maintenance script. If the target host is unreachable or authentication fails, the operation and maintenance script execution may fail. In addition, commands such as `grep` and `awk` are used in the operation and maintenance script to parse configuration files and logs. If the file format changes, parsing errors may occur. Finally, there are multiple `echo` commands in the operation and maintenance script to write logs to files. If there is a problem with the file system, logging may fail."

[0318] `Risk Assessment Level`: "Medium Risk"

[0319] `risk_score`: "75" .

[0320] At this time, the value of S2 is 75.

[0321] Following the same processing flow, the Prompt and script content of the supplementary process agent are provided to the large model of the supplementary process agent. The following is the result returned by the large model (i.e., the third risk assessment data), recorded as C3:

[0322] C3:

[0323] `Supplementary process assessment results`: "The operation and maintenance scripts generally meet the performance requirements, but there are some potential compliance audit risks. The specific issues are as follows:

[0324] 1. **Hard-coded IP addresses**: Hard-coded IP addresses in operation and maintenance scripts do not conform to best practices. It is recommended to use configuration files or environment variables to manage these values.

[0325] 2. **Log file path**: The log file path should ensure transparency to all relevant parties, and the path should comply with the company's log management specifications.

[0326] 3. **Command execution**: Commands executed in operation and maintenance scripts should ensure proper permission management and audit logging to prevent unauthorized access and operations.

[0327] 4. **Sensitive information protection**: Sensitive information involved in the operation and maintenance scripts should be encrypted during transmission and storage to prevent leakage.

[0328] 5. **Exception handling**: The exception handling part in the operation and maintenance script is relatively simple. It is recommended to add more error handling and retry mechanisms to improve the robustness and reliability of the operation and maintenance script.

[0329] 6. **Log record format**: The format of log records should be unified and detailed to facilitate subsequent auditing and troubleshooting.

[0330] 7. **External calls**: When external tools are called in the operation and maintenance script, the security and reliability of these tools should be ensured, and version management should be performed.

[0331] 8. **Network request**: Network requests are used in the operation and maintenance scripts. The security of network requests should be ensured to avoid security issues such as man-in-the-middle attacks.

[0332] In summary, the operation and maintenance scripts performed well in terms of performance, but there are some areas that need improvement in terms of compliance auditing.

[0333] `risk_score`: "70" .

[0334] At this time, the value of S3 can be obtained as 70.

[0335] After the supplementary process is completed, enter the simulation test agent, which will let the big model generate test cases and simulate the execution of test code. The following is the result returned by the big model, recorded as C4:

[0336] C4:

[0337] `Simulation test evaluation results`: "Risk assessment"

[0338] 1. **Network Issue**

[0339] -If the network is unstable or interrupted, the `ssh` command execution may fail, thus affecting the execution results of the operation and maintenance script.

[0340] 2. **Configuration file problem**

[0341] - If the configuration in the `broker.properties` file is incorrect or missing, it may cause the `ccIpPort` to fail to obtain, affecting subsequent operations.

[0342] 3. **Operation and maintenance script logic problem**

[0343] -There are many conditional judgments in the operation and maintenance script. If the conditional judgment logic is wrong, it may lead to unnecessary operations or omission of key steps.

[0344] 4. **Permission Issue**

[0345] - If the user who executes the operation and maintenance script has insufficient permissions, the execution of the `ssh` command or `sh` command may fail.

[0346] 5. **Logging issues**

[0347] - If the log file path or file name is generated incorrectly, incomplete or lost log records may result.

[0348] 6. **Exception handling**

[0349] - There are some exception handling logics in the operation and maintenance scripts, but in some cases (such as network interruption, insufficient permissions, etc.), it may not cover all abnormal situations, resulting in the failure of the operation and maintenance script execution.

[0350] 7. **Dependency tool issues**

[0351] -The operation and maintenance scripts rely on some tools. If these tools do not exist or their versions are incompatible, the execution of the operation and maintenance scripts may be affected.

[0352] Finally, you can enter the scoring and rating Agent, where the previous output content C1-C3 and the script content will be processed as input. The processing flow is as follows:

[0353] Step 1: Summarize risk item C5 based on the contents of C1 to C3. The following prompts are used to summarize risk items:

[0354] **Target**

[0355] I have an operation and maintenance script, and have conducted risk assessments on multiple aspects of the operation and maintenance script. I need you to summarize the contents of these risk assessments and form a complete risk summary.

[0356] **Return results**

[0357] The specific assessment results, risk level assessment and score are returned in markdown format. The returned format requirements are as follows:

[0358] Risk summary results:

[0359] `Risk Summary Result`: "<Summary Result>".

[0360] **RESTRICTIONS**

[0361] 1. Output the results strictly in the required format;

[0362] 2. The output language is Chinese;

[0363] 3. No additional information is required, including a closing statement.

[0364] Here is my general risk assessment process:

[0365] {C1};

[0366] Here is what I would like to share about risk assessment in a specific classification scenario process:

[0367] {C2};

[0368] Here is what I would like to provide regarding risk assessment in the supplementary process:

[0369] {C3}.

[0370] The following are the risks summarized based on C1-C3:

[0371] C5:

[0372] `Risk Summary Result`: "The operation and maintenance script has medium risks in multiple aspects, as follows:

[0373] 1. **Security risks**:

[0374] -`ssh` is used in the operation and maintenance script for remote command execution, but the key is not managed, which poses a risk of plain text password leakage.

[0375] -Notifications are sent using the `http` protocol, which may result in a risk of leakage during data transmission.

[0376] -Sensitive information is not encrypted during transmission and storage, posing a risk of leakage.

[0377] -External tools are called in the operation and maintenance scripts. The security and reliability of these tools should be ensured, and version management should be performed.

[0378] -The security of network requests needs to be strengthened to avoid security issues such as man-in-the-middle attacks.

[0379] 2. **Stability Risk**:

[0380] -There are many hard codes in the operation and maintenance scripts, which may cause the operation and maintenance scripts to fail to run normally when the environment changes.

[0381] -The error handling in the operation and maintenance script is not comprehensive enough, such as network request failure, insufficient permissions, etc.

[0382] - There are multiple SSH commands in the operation and maintenance script. If the target host is unreachable or authentication fails, the script execution may fail.

[0383] -Operation and maintenance scripts rely on multiple external tools and third-party libraries. The availability and versions of these dependencies may vary in different environments, which may affect the execution of operation and maintenance scripts.

[0384] 3. **Maintainability Risk**:

[0385] -The variable naming in the operation and maintenance script is not intuitive enough, some of the logic is relatively complex, and there is a lack of detailed comments, resulting in poor code readability.

[0386] -The format of logging should be unified and detailed to facilitate subsequent auditing and troubleshooting.

[0387] 4. **Dependence Risk**:

[0388] -Operation and maintenance scripts rely on multiple external tools and third-party libraries. The availability and versions of these dependencies may vary in different environments, which may affect the execution of operation and maintenance scripts.

[0389] -External tools are called in the operation and maintenance script. If these tools do not exist or the versions are incompatible, the execution of the operation and maintenance script may be affected.

[0390] 5. **Other Automation Risks**:

[0391] - `set-ex` is used in the operation and maintenance script, which may cause the script to exit immediately when an error occurs during execution, affecting the execution of subsequent operations.

[0392] -Commands such as `grep` and `awk` are used in the script to parse configuration files and logs. If the file format changes, parsing errors may occur.

[0393] - There are multiple `echo` commands in the operation and maintenance script to write logs to files. If there is a problem with the file system, logging may fail.

[0394] 6.**Supplementary process evaluation results**:

[0395] - Hardcoding IP addresses is not in line with best practices, it is recommended to use configuration files or environment variables to manage these values.

[0396] -The log file path should ensure transparency to all relevant parties and the path should comply with the company's log management specifications.

[0397] - Commands executed in scripts should ensure proper permission management and audit logging to prevent unauthorized access and operations.

[0398] -The exception handling part of the script is relatively simple. It is recommended to add more error handling and retry mechanisms to improve the robustness and reliability of the operation and maintenance script.

[0399] In summary, the operation and maintenance scripts performed well in terms of performance, but there are some areas that need improvement in terms of security, stability, maintainability, and compliance auditing.

[0400] The second step is to evaluate a risk score S0 according to the above decision tree algorithm process. The specific process is as follows.

[0401] According to the risk dimension of the current node, the large model in the scoring and rating agent only evaluates the risk of the operation and maintenance script in the corresponding dimension, without considering other dimensions. Taking the root node as an example, only security risk and logic defect risk are considered on the root node. When processing this node, the constraints will only consider security risk and logic defect risk.

[0402] The decision tree starts:

[0403] Initialize the weight records S of the three risk levels: high, medium and low

[0404] S = {0,0,0};

[0405] Start processing from the root node. The root node only needs to consider the security risk of the operation and maintenance script, without considering other risks. Therefore, the prompt word Prompt can be used to make constraints and restrictions. The following are the prompt words for the root node:

[0406] **Target**

[0407] Determine whether an operation and maintenance script poses a significant security risk.

[0408] I will give you an operation and maintenance script and its risk assessment content. You need to judge whether the operation and maintenance script has a major security risk based on the operation and maintenance script and the assessment content, and return a probability involving security risks. The probability ranges from 0 to 1. The smaller the value, the lower the risk probability.

[0409] **step**

[0410] 1. Extract the content related to security risks in the risk assessment as an auxiliary reference;

[0411] 2. Evaluate the content of the operation and maintenance script to determine whether the operation and maintenance script contains security risks;

[0412] 3. Based on the assessed security risk, a probability value of 0 to 1 is given to quantify the probability of this security risk. The smaller the value, the lower the risk probability.

[0413] CONSTRAINTS

[0414] 1. Only the security risk dimension needs to be considered, and risks in other dimensions are not considered at all;

[0415] 2. Output the results strictly in the required format;

[0416] 3. The output language is Chinese;

[0417] 4. No additional information is required, including a closing statement.

[0418] **Return results**

[0419] Returns the specific value in markdown format. The returned format requirements are as follows:

[0420] `Security risk probability`: "<probability value>"

[0421] Here is the risk assessment I provided:

[0422] {C1},

[0423] {C2},

[0424] {C3},

[0425] The following is the operation and maintenance script I provided:

[0426] {Operation and maintenance script code}

[0427] The following is the result of processing C1-C3 and the operation and maintenance script as input at the root node:

[0428] `Security risk probability`: "0.7".

[0429] Each node only evaluates a specific risk dimension, and finally evaluates a probability of involving the risk dimension. The probability ranges from 0 to 1. The larger the value, the closer the relationship with the risk dimension and the more it involves the corresponding risk dimension. If the probability is equal to or greater than 0.65, it means that the operation and maintenance script has the risk corresponding to this node, and the processing flow is transferred to the right node; if the evaluated probability value is less than 0.65, it is transferred to the left node.

[0430] The root node finally evaluates the probability of security risk to be 0.7, which is greater than 0.65, so it can be determined that the operation and maintenance script has security risks. Therefore, the risk level weight of the node {high risk: 0.7, medium risk 0.3} is added to the weight record S = {0, 0.3, 0.7} and flows to the right node.

[0431] The judgment process flows to the right node, where only the risk of logic defects and data operation risks need to be considered. Similarly, Prompt is used at this node to make the large model only consider the dimensions of the operation and maintenance script in terms of logic defect risk and data operation risk. The following is the prompt of this node:

[0432] **Target**

[0433] Determine whether an operation and maintenance script has a high risk of logical defects and data manipulation.

[0434] I will give you an operation and maintenance script and the risk assessment content of this script. You need to judge whether the operation and maintenance script has a large risk of logical defects and data operation risks based on this operation and maintenance script and the assessment content, and return a probability involving logical defect risks and data operation risks. The probability ranges from 0 to 1. The smaller the value, the lower the risk probability.

[0435] **step**

[0436] 1. Extract the content related to logical defect risks and data operation risks in the risk assessment as auxiliary reference;

[0437] 2. Evaluate the content of the operation and maintenance script to determine whether the script has logical defect risks and data operation risks;

[0438] 3. Based on the assessed logic defect risk and data operation risk, a probability value of 0 to 1 is given to quantify the probability of the logic defect risk and data operation risk. The smaller the value, the lower the risk probability.

[0439] CONSTRAINTS

[0440] 1. Only the logical defect risk and data operation risk dimensions need to be considered, and risks in other dimensions are not considered at all;

[0441] 2. Output the results strictly in the required format;

[0442] 3. The output language is Chinese;

[0443] 4. No additional information is required, including a closing statement.

[0444] **Return results**

[0445] Returns the specific value in markdown format. The returned format requirements are as follows:

[0446] `Logic defect risk and data operation risk probability`: "<probability value>".

[0447] Here is the risk assessment I provided:

[0448] {C1},

[0449] {C2},

[0450] {C3}.

[0451] The following is the operation and maintenance script I provided:

[0452] {Operation and maintenance script code}.

[0453] The following is the result of processing C1-C3 and the operation and maintenance script as input at this node:

[0454] `Logic defect risk and data manipulation risk probability`: "0.6".

[0455] At this node, it is determined that there is a risk of logic defects and a probability of data operation risk of 0.6, which is less than 0.65. Therefore, the weight record S does not need to be processed, S = {0, 0.3, 0.7}, and flows to the next left node.

[0456] The next left node conducts risk assessment for high-risk instruction risk, sensitive information risk, and external dependency risk. Similarly, the risks in these three dimensions can be assessed based on specific prompts. The following are the corresponding prompts.

[0457] **Target**

[0458] Determine whether an operation and maintenance script has a high risk of high-risk instructions, sensitive information risks, and external dependency risks.

[0459] I will give you an operation and maintenance script and its risk assessment content. You need to judge whether the operation and maintenance script has a large high-risk instruction risk, sensitive information risk and external dependency risk based on the operation and maintenance script and the assessment content, and return a probability involving high-risk instruction risk, sensitive information risk and external dependency risk. The probability ranges from 0 to 1. The smaller the value, the lower the risk probability.

[0460] **step**

[0461] 1. Extract the risk assessment contents involving high-risk instruction risks, sensitive information risks and external dependency risks as auxiliary references;

[0462] 2. Evaluate the content of the operation and maintenance scripts to determine whether the operation and maintenance scripts contain high-risk instruction risks, sensitive information risks, and external dependency risks;

[0463] 3. Based on the assessed high-risk instruction risks, sensitive information risks and external dependency risks, a probability value of 0 to 1 is given to quantify the probability of high-risk instruction risks, sensitive information risks and external dependency risks. The smaller the value, the lower the risk probability.

[0464] CONSTRAINTS

[0465] 1. Only high-risk instruction risk, sensitive information risk and external dependency risk dimensions need to be considered, and risks in other dimensions are not considered at all;

[0466] 2. Output the results strictly in the required format;

[0467] 3. The output language is Chinese;

[0468] 4. No additional information is required, including a closing statement.

[0469] **Return results**

[0470] Returns the specific value in markdown format. The returned format requirements are as follows:

[0471] `Probability of high-risk instruction risk, sensitive information risk, and external dependency risk`: "<Probability value>"

[0472] Here is the risk assessment I provided:

[0473] {C1},

[0474] {C2},

[0475] {C3},

[0476] The following is the operation and maintenance script I provided:

[0477] {Operation and maintenance script code}

[0478] The following is the result of processing C1-C3 and the operation and maintenance script itself as input at this node:

[0479] `Probability of high-risk instruction risk, sensitive information risk, and external dependency risk`: "0.75".

[0480] The final risk probability of the node is 0.75, which is greater than 0.65, so the risk level score of the node {low risk: 0.45, medium risk: 0.35, high risk: 0.2} is added to S = {0.45, 0.65, 0.9}, and the process flows to the next right node.

[0481] The risk dimensions corresponding to the next right node are performance risk and compatibility risk. The processing logic is similar to the previous one. The prompt of this node is as follows.

[0482] **Target**

[0483] Determine whether an operation and maintenance script has significant performance and compatibility risks.

[0484] I will give you an operation and maintenance script and its risk assessment content. You need to judge whether the operation and maintenance script has greater performance risks and compatibility risks based on the operation and maintenance script and the assessment content, and return a probability involving performance risks and compatibility risks. The probability ranges from 0 to 1. The smaller the value, the lower the risk probability.

[0485] **step**

[0486] 1. Extract the content related to performance risk and compatibility risk in the risk assessment as an auxiliary reference;

[0487] 2. Evaluate the content of the operation and maintenance script to determine whether the script poses performance and compatibility risks;

[0488] 3. Based on the assessed performance risk and compatibility risk, a probability value of 0 to 1 is given to quantify the probability of performance risk and compatibility risk. The smaller the value, the lower the risk probability.

[0489] CONSTRAINTS

[0490] 1. Only performance risk and compatibility risk dimensions need to be considered, and risks in other dimensions are not considered at all;

[0491] 2. Output the results strictly in the required format;

[0492] 3. The output language is Chinese;

[0493] 4. No additional information is required, including a closing statement.

[0494] **Return results**

[0495] Returns the specific value in markdown format. The returned format requirements are as follows:

[0496] `Performance risk and compatibility risk`: "<probability value>".

[0497] Here is the risk assessment I provided:

[0498] {C1},

[0499] {C2},

[0500] {C3},

[0501] The following is the operation and maintenance script I provided:

[0502] {Operation and maintenance script code}.

[0503] The following is the result of processing C1-C3 and the operation and maintenance script itself as input at this node:

[0504] `Performance Risk and Compatibility Probability`: "0.7".

[0505] Since the probability of the risk assessed for the node is 0.7, which is greater than 0.65, the risk level score of the node {low risk: 0.5, medium risk: 0.5} is added to the weight record SS={0.95, 1.15, 0.9}.

[0506] Then, apply the formula for weighted processing:

[0507]

[0508] Calculate S0≈0.78×100=78.

[0509] The final risk score S is calculated by taking a weighted average of S1, S2, S3 and S0, where the parameters of the weighted average are as follows:

[0510] S=0.4S0+0.2S1+0.3S2+0.1S3;

[0511] Calculate S = 0.4*78 + 0.2*75 + 0.3*75 + 0.1*70 = 75.7.

[0512] The score of S is divided into risk levels P according to 0-60 high risk, 60-80 medium risk, and 80-100 low risk. Since the score of S is 75.7, the operation and maintenance script level is medium risk.

[0513] Finally, different strategies and script management measures are implemented for operation and maintenance scripts of different risk levels. If it is a low-risk script, it can be executed directly; if it is a medium-risk script, it needs to be double-checked before it can be executed; if it is a high-risk script, it needs to be approved before it can be executed.

[0514] In the embodiment of the present application, an engineering multi-agent operation and maintenance script risk level assessment model is constructed in combination with the capabilities of a large model, and a classification assessment is performed in combination with specific scenarios. The corresponding operation and management specifications are applied to the risk assessment results to pay attention to and review them. Exposure of risks in a timely manner before code execution greatly reduces the risk hazards caused by code execution and greatly facilitates daily operation and maintenance work.

[0515] Based on the same technical concept, an embodiment of the present application also provides a processing device for an operation and maintenance script. The principle of solving the problem by the processing device for the operation and maintenance script is similar to the processing method for the above-mentioned operation and maintenance script. Therefore, the implementation of the processing device for the operation and maintenance script can refer to the implementation of the processing method for the operation and maintenance script, and the repeated parts will not be repeated.

[0516] Figure 5 A schematic diagram of the structure of a processing device for an operation and maintenance script provided in an embodiment of the present application includes:

[0517] The acquisition module 501 is used to acquire target information required for risk assessment of the operation and maintenance script;

[0518] An analysis module 502 is used to analyze the target information using a rating agent to obtain a risk assessment level of the operation and maintenance script;

[0519] The processing module 503 is used to process the operation and maintenance script according to the processing strategy corresponding to the risk assessment level.

[0520] In some embodiments, the target information also includes evaluation prompt words corresponding to each node of the operation and maintenance script in the decision tree. The analysis module 502 is specifically used to control the rating agent to determine the risk assessment level of the operation and maintenance script according to the following steps:

[0521] Input the operation and maintenance script and the evaluation prompt word corresponding to the target node of the operation and maintenance script in the decision tree into the corresponding large model to obtain an output result, wherein the output result includes the score of the operation and maintenance script at multiple risk levels, and initially the target node is the root node of the decision tree;

[0522] According to the output result, searching for a leaf node in the decision tree;

[0523] Taking the leaf node as the target node, the step of inputting the operation and maintenance script and the evaluation prompt word corresponding to the target node of the operation and maintenance script in the decision tree into the large model is executed to obtain the output result, until no leaf node can be found in the decision tree, and then determining the risk assessment level according to the score of the operation and maintenance script at multiple risk levels in each output result.

[0524] In some embodiments, the analysis module 502 is specifically configured to:

[0525] If the output result is a preset output result corresponding to the target node, the node on the right fork of the target node in the decision tree is determined as the leaf node;

[0526] If the output result is not a preset output result corresponding to the target node, the node on the left fork of the target node in the decision tree is determined as the leaf node.

[0527] In some embodiments, the analysis module 502 is specifically configured to:

[0528] Sum the probability scores of the operation and maintenance scripts outputted each time at the same risk level to obtain a total score of the operation and maintenance script at the risk level;

[0529] Performing a weighted summation on the total scores of the operation and maintenance script at various risk levels to obtain a first score;

[0530] The risk assessment level is determined according to the first score.

[0531] In some embodiments, the analysis module 502 is specifically configured to:

[0532] A final score is obtained by weighted summing the first score and the target score, wherein the target score includes at least one of a second score, a third score, and a fourth score, wherein the second score is obtained by analyzing the operation and maintenance script by a scenario agent, the scenario agent is determined by classifying the use scenario of the operation and maintenance script by a classification agent, the third score is obtained by analyzing the operation and maintenance script by a general process agent, and the fourth score is obtained by analyzing the operation and maintenance script by a supplementary process agent;

[0533] The level corresponding to the interval into which the final score falls is determined as the risk assessment level.

[0534] In some embodiments, when the target score includes the second score, the target information further includes first risk assessment data output by the scenario Agent, and the first risk assessment data includes the second score;

[0535] When the target score includes the third score, the target information further includes second risk assessment data output by the general process Agent, and the second risk assessment data includes the third score;

[0536] When the target score includes the fourth score, the target information further includes third risk assessment data output by the supplementary process Agent, and the third risk assessment data includes the fourth score.

[0537] In some embodiments, a simulation test module 504 is further included for:

[0538] The operation and maintenance script is simulated tested by the simulation test Agent to obtain the simulation test result of the operation and maintenance script.

[0539] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, the functional modules in the embodiments of the present application may be integrated in a processor, or may exist physically separately, or two or more modules may be integrated in one module. The coupling between the modules may be achieved through some interfaces, which are usually electrical communication interfaces, but it is not excluded that they may be mechanical interfaces or other forms of interfaces. Therefore, the modules described as separate components may or may not be physically separated, and may be located in one place or distributed to different locations of the same or different devices. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0540] After introducing the operation and maintenance script processing method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0541] Refer to the following Figure 6 The electronic device 130 implemented according to this embodiment of the present application is described. Figure 6 The electronic device 130 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0542] like Figure 6 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).

[0543] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0544] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .

[0545] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0546] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0547] In an exemplary embodiment, a storage medium is also provided, and when the computer program in the storage medium is executed by the processor of the electronic device, the electronic device can execute the above-mentioned operation and maintenance script processing method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0548] In an exemplary embodiment, the electronic device of the present application may include at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor may execute the steps of the processing method of any operation and maintenance script provided in the embodiments of the present application.

[0549] In an exemplary embodiment, a computer program product is also provided. When the computer program product is executed by an electronic device, the electronic device can implement any exemplary method provided in the present application.

[0550] Furthermore, the computer program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The 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 (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0551] The program product for processing operation and maintenance scripts in the embodiments of the present application may adopt a CD-ROM and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0552] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0553] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0554] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network such as a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0555] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0556] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0557] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0558] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0559] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0560] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0561] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0562] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application also includes these modifications and variations.

Claims

1. A method for processing an operation and maintenance script, characterized in that: include: Acquire target information required for risk assessment of operation and maintenance scripts, wherein the target information includes the operation and maintenance scripts; Analyze the target information using a rating agent to obtain a risk assessment level of the operation and maintenance script; The operation and maintenance script is processed according to a processing strategy corresponding to the risk assessment level.

2. The method according to claim 1, characterized in that The target information also includes the evaluation prompt words corresponding to each node of the operation and maintenance script in the decision tree. The rating agent determines the risk assessment level of the operation and maintenance script according to the following steps: Input the operation and maintenance script and the evaluation prompt word corresponding to the target node of the operation and maintenance script in the decision tree into the corresponding large model to obtain an output result, wherein the output result includes the score of the operation and maintenance script at multiple risk levels, and initially the target node is the root node of the decision tree; According to the output result, searching for a leaf node in the decision tree; Taking the leaf node as the target node, the step of inputting the operation and maintenance script and the evaluation prompt word corresponding to the target node of the operation and maintenance script in the decision tree into the large model is executed to obtain the output result, until no leaf node can be found in the decision tree, and then determining the risk assessment level according to the score of the operation and maintenance script at multiple risk levels in each output result.

3. The method according to claim 2, characterized in that The decision tree is a binary tree, and searching for a leaf node in the decision tree according to the output result includes: If the output result is a preset output result corresponding to the target node, the node on the right fork of the target node in the decision tree is determined as the leaf node; If the output result is not the preset output result corresponding to the target node, the node on the left fork of the target node in the decision tree is determined as the leaf node.

4. The method according to claim 2, characterized in that The risk assessment level is determined based on the scores of the operation and maintenance scripts in each output result at multiple risk levels, including: Sum the probability scores of the operation and maintenance scripts outputted each time at the same risk level to obtain a total score of the operation and maintenance script at the risk level; Performing a weighted summation on the total scores of the operation and maintenance script at various risk levels to obtain a first score; The risk assessment level is determined according to the first score.

5. The method according to claim 4, characterized in that Determining the risk assessment level according to the first score includes: A final score is obtained by weighted summing the first score and the target score, wherein the target score includes at least one of a second score, a third score, and a fourth score, wherein the second score is obtained by analyzing the operation and maintenance script by a scenario agent, the scenario agent is determined by classifying the use scenario of the operation and maintenance script by a classification agent, the third score is obtained by analyzing the operation and maintenance script by a general process agent, and the fourth score is obtained by analyzing the operation and maintenance script by a supplementary process agent; The level corresponding to the interval into which the final score falls is determined as the risk assessment level.

6. The method according to claim 5, characterized in that When the target score includes the second score, the target information further includes first risk assessment data output by the scenario Agent, and the first risk assessment data includes the second score; When the target score includes the third score, the target information further includes second risk assessment data output by the general process Agent, and the second risk assessment data includes the third score; When the target score includes the fourth score, the target information further includes third risk assessment data output by the supplementary process Agent, and the third risk assessment data includes the fourth score.

7. The method according to any one of claims 1 to 6, characterized in that: Also includes: The operation and maintenance script is simulated tested by the simulation test Agent to obtain the simulation test result of the operation and maintenance script.

8. A device for processing operation and maintenance scripts, characterized in that: include: An acquisition module is used to obtain target information required for risk assessment of operation and maintenance scripts; An analysis module, used to analyze the target information using a rating agent to obtain a risk assessment level of the operation and maintenance script; A processing module is used to process the operation and maintenance script according to a processing strategy corresponding to the risk assessment level.

9. An electronic device, characterized in that: include: at least one processor, and a memory communicatively connected to the at least one processor, wherein: The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: When the computer program in the storage medium is executed by a processor of an electronic device, the electronic device can execute the method as claimed in any one of claims 1 to 7.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when executed by a processor.