Script security auditing and task scheduling execution method based on intelligent codes
By employing an intelligent code script review method, combined with a rule engine and AI model, the inefficiency and security risks of code script review and execution have been resolved. This has enabled automated deployment and fully traceable database management, thereby improving operational efficiency and security.
Patent Information
- Application Number
- CN202510952323.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-11-11
AI Technical Summary
In existing technologies, the review and execution of code scripts rely on manual operation, which leads to low efficiency, high error rate, difficulty in traceability, and problems such as database security risks and non-standard operation and maintenance.
An intelligent code script security audit method is adopted, which combines a rule engine and an AI model to detect script compliance, introduces an approval process and access control, realizes automated deployment and execution, and generates execution logs and audit reports.
It improves the efficiency and security of script review, supports multi-environment deployment, ensures traceability of the execution process, and enhances the standardization and controllability of operation and maintenance.
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer security and automated operation and maintenance technology, specifically to a method for intelligent code script security auditing and task scheduling execution. Background Technology
[0002] Currently, in database maintenance and management, the review and execution of code scripts largely rely on manual operation. With the expansion of system scale and the increase in business complexity, the number of scripts is growing, significantly increasing the workload for review and execution. Traditional manual review methods are not only inefficient but also prone to omissions or misjudgments due to human error, potentially leading to data corruption during script execution. In severe cases, this could result in data loss or system failure, posing significant security risks.
[0003] Furthermore, script execution often involves multiple runtime environments, and the configuration differences between these environments increase the difficulty of execution. The lack of standardized processes and automated tools during manual execution leads to long execution cycles and high error rates. Simultaneously, existing manual methods struggle to comprehensively record and log the execution process, hindering subsequent troubleshooting and accountability, and severely impacting system maintainability and operational efficiency. Summary of the Invention
[0004] This invention discloses an intelligent code script security audit and task scheduling execution method, which aims to solve the problems of low script audit efficiency, high error rate and difficulty in tracing the execution process in the prior art.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A method for intelligent code script security auditing and task scheduling and execution includes the following steps: (1) Receive the database operation script uploaded by the user, parse the script file, identify the SQL statement type contained therein, and extract all the SQL statements; (2) The extracted SQL statements are sent to the intelligent compliance review module. The script content is compared and analyzed line by line based on the preset rule engine and AI model to determine whether it complies with the script writing specifications and database security standards. (3) For scripts that pass the compliance review in step (2), the approval process is automatically triggered, and the compliant scripts are submitted to the designated approver for manual review and confirmation. (4) For approved scripts, deploy the scripts to one or more target environments according to the target environment information configured by the user; (5) Automated execution of deployed scripts according to the set task execution strategy; real-time monitoring of execution status during execution, and provision of interruption and rollback functions; (6) After the script is executed, an execution log and a structured audit report are automatically generated.
[0006] Furthermore, the SQL statement types include SELECT, INSERT, UPDATE, DELETE, and DROP.
[0007] Furthermore, in step (2), if a non-compliance item is detected, specific error information and modification suggestions are returned to prompt the user to make adjustments; the non-compliance items include full table deletion and updates without WHERE conditions.
[0008] Furthermore, the rule engine is used to identify high-risk SQL operations based on preset rules, and the AI model is used to perform deep detection of script compliance.
[0009] Furthermore, the target environment includes a development environment, a testing environment, a pre-release environment, and a production environment.
[0010] Furthermore, the task execution strategy includes serial / parallel execution, failure retry mechanism, execution order control, and execution time.
[0011] Furthermore, the execution log records the execution time, the executor, the executed statement, the amount of data affected, the execution result, and error information.
[0012] Furthermore, all steps of the method of the present invention are executed under a role-based access control mechanism; the role-based access control mechanism is used to grant different operation permissions to different users, and strictly restrict users' viewing, editing, reviewing and executing operations of scripts.
[0013] The present invention, by adopting the above technical solution, has the following beneficial effects: 1. High-risk SQL operations in scripts are identified through automated means, and AI intelligent models are introduced to achieve in-depth detection of script compliance, effectively preventing potential database security risks; 2. Supports one-click deployment and execution of scripts in multiple environments; 3. The execution process automatically records logs and generates audit reports; 4. Introduce approval processes and access control mechanisms to ensure security; 5. Provides an integrated management platform covering the entire process from script uploading, parsing, review, approval, execution to auditing, solving problems such as scattered script management, chaotic versions, and uncontrollable status in traditional script management, and improving the overall operation and maintenance standardization and maintainability. Detailed Implementation
[0014] This invention discloses a method for intelligent code script security auditing and task scheduling execution, comprising the following steps: (1) Receive the database operation script uploaded by the user, parse the script file, identify the SQL statement types contained therein, and extract all the SQL statements; the SQL statement types include SELECT, INSERT, UPDATE, DELETE, DROP, etc.
[0015] (2) The extracted SQL statements are sent to the intelligent compliance review module. Based on the preset rule engine and AI model, the script content is compared and analyzed line by line to determine whether it complies with script writing specifications and database security standards. The rule engine is used to identify high-risk SQL operations according to preset rules, and the AI model is used to perform in-depth detection of script compliance. If non-compliance is detected, specific error information and modification suggestions are returned to prompt the user to make adjustments. Non-compliance includes full table deletion and updates without WHERE conditions.
[0016] (3) For scripts that pass the compliance review in step (2), the approval process is automatically triggered, and the compliant scripts are submitted to the designated approver for manual review and confirmation; the execution stage can only be entered after the approval is passed, ensuring that key operations are double-verified.
[0017] (4) For approved scripts, deploy the scripts to one or more target environments according to the target environment information configured by the user; the target environments include development environment, testing environment, pre-release environment and production environment.
[0018] (5) Automatically execute the deployed scripts according to the set task execution strategy (including serial / parallel execution, failure retry mechanism, execution order control, and execution time); monitor the execution status in real time during execution and provide emergency handling functions such as interruption and rollback; (6) After the script is executed, an execution log and a structured audit report are automatically generated to facilitate subsequent tracing, auditing and accountability. The execution log records the execution time, executor, executed statements, amount of data affected, execution result and error information.
[0019] All steps of the method of the present invention are executed under a role-based access control mechanism; the role-based access control mechanism is used to assign different operation permissions to different users, strictly restrict users' viewing, editing, reviewing and execution of scripts, prevent unauthorized operation behavior, and ensure the security and data integrity of the system.
[0020] This invention introduces an intelligent auditing mechanism that combines a rule engine with an AI model to automatically detect high-risk SQL operations and provide modification suggestions. The system employs a dual security control process of "institutional preliminary review + manual approval" to ensure the safe execution of high-risk operations. Supports one-click deployment and strategic execution across multiple environments, improving operational efficiency and task controllability; Enables full-process log recording and structured audit report generation, ensuring traceability of operations and delineation of responsibilities; Build a script lifecycle management platform to unify the management of script upload, review, execution and audit processes, and improve the overall standardization of operation and maintenance.
[0021] The specific embodiments of the present invention have been described above. However, those skilled in the art should understand that this is merely an example. Those skilled in the art can make various changes or modifications to this embodiment without departing from the principles and essence of the present invention, but all such changes and modifications fall within the protection scope of the present invention.
Claims
1. A method for intelligent code script security auditing and task scheduling execution, characterized in that: Includes the following steps: (1) Receive the database operation script uploaded by the user, parse the script file, identify the SQL statement type contained therein, and extract all the SQL statements; (2) The extracted SQL statements are sent to the intelligent compliance review module. The script content is compared and analyzed line by line based on the preset rule engine and AI model to determine whether it complies with the script writing specifications and database security standards. (3) For scripts that pass the compliance review in step (2), the approval process is automatically triggered, and the compliant scripts are submitted to the designated approver for manual review and confirmation. (4) For approved scripts, deploy the scripts to one or more target environments according to the target environment information configured by the user; (5) Automated execution of deployed scripts according to the set task execution strategy; real-time monitoring of execution status during execution, and provision of interruption and rollback functions; (6) After the script is executed, an execution log and a structured audit report are automatically generated.
2. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: The SQL statement types include SELECT, INSERT, UPDATE, DELETE, and DROP.
3. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: In step (2), if a non-compliance item is detected, the specific error message and modification suggestions are returned to prompt the user to make adjustments; the non-compliance items include full table deletion and updates without WHERE conditions.
4. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: The rule engine is used to identify high-risk SQL operations based on preset rules, and the AI model is used to perform in-depth detection of script compliance.
5. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: The target environment includes development environment, testing environment, pre-release environment, and production environment.
6. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: The task execution strategy includes serial / parallel execution, failure retry mechanism, execution order control, and execution time.
7. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: The execution log records the execution time, the executor, the executed statement, the amount of data affected, the execution result, and error information.
8. The method for intelligent code script security auditing and task scheduling execution according to claim 1, characterized in that: All steps are executed under a role-based access control mechanism; the role-based access control mechanism is used to grant different operation permissions to different users, strictly limiting users' viewing, editing, reviewing, and execution of scripts.