Search

CN-121524094-B - Dynamic detection method based on script engine technology

CN121524094BCN 121524094 BCN121524094 BCN 121524094BCN-121524094-B

Abstract

The invention belongs to the technical field of computer detection, and particularly relates to a dynamic detection method based on a script engine technology, wherein service request parameters, basic service data and detection item configuration data are acquired, a dynamic detection framework is constructed, a detection script grammar rule, an execution sequence specification and a dependency association mechanism are defined, meanwhile, a detection logic script associated with a target service detection item is dynamically loaded according to the service request parameters and the detection execution context data, the detection logic is analyzed and executed by the script engine, the execution sequence of the detection items is determined according to a topological ordering and priority scheduling algorithm, the detection logic is asynchronously executed by a thread pool, the execution result and diagnosis information of each detection item are output in real time, a preset quick repair entry is provided for an abnormal detection item, a repair operation is responded, the repair effect is verified, an evaluation report is generated according to the detection and repair feedback data, and the detection script and the configuration information are updated. Therefore, the problems of poor suitability, low execution efficiency and the like in the prior art are solved.

Inventors

  • KONG WEI
  • TANG XIANYONG

Assignees

  • 中博信息技术研究院有限公司

Dates

Publication Date
20260512
Application Date
20260116

Claims (7)

  1. 1. A dynamic detection method based on script engine technology is characterized by comprising the following steps: Acquiring service request parameters, basic service data and detection item configuration data; Based on the basic service data and the detection item configuration data, a dynamic detection framework driven by a script engine is constructed, a detection script grammar rule, an execution sequence specification and a dependency association mechanism are defined, meanwhile, a detection logic script associated with a target service detection item is dynamically loaded according to the service request parameters and detection execution context data, detection logic is analyzed and executed through the script engine, and a topology ordering and priority scheduling algorithm is carried out according to the topology ordering formula: ; Wherein, the J is a traversal variable of sum operation, n is the total number of the detection items; To represent the slave test item To the point of Is a directed edge of (2); To represent the slave test item To the point of Is a directed edge of (2); The detected item node is deleted; Is that The method comprises the steps of (1) determining the execution sequence of detection items, wherein IsValidTopo is the validity mark of topological sorting, 1 represents the legal topological sorting and 0 represents the illegal sorting, wherein the execution sequence of the detection items is determined by analyzing and executing detection logic through a script engine according to topological sorting and priority scheduling algorithm, and the method comprises the steps of constructing a dependency relation analyzer and a scheduler, analyzing the detection item dependency statement in a detection logic script based on the dependency relation analyzer to generate a directed acyclic graph of the detection items, carrying out topological sorting on the directed acyclic graph through the scheduler, and determining an execution sequence queue by combining priority weights defined in detection item configuration data; Providing a preset quick repair entry for the abnormal detection item according to the execution result and the diagnosis information of each detection item, wherein the preset quick repair entry for the abnormal detection item according to the execution result and the diagnosis information of each detection item comprises the steps of constructing an abnormal matcher and a repair action mapping table, matching the execution result and the diagnosis information of the detection item with a predefined abnormal mode based on the abnormal matcher to obtain a matching result, acquiring and presenting a corresponding quick repair operation entry according to the repair action mapping table based on the matching result, responding to repair operation and verifying repair effect, generating an evaluation report according to detection and repair feedback data, and updating detection scripts and configuration information.
  2. 2. The method for dynamically detecting a target service detection item according to claim 1, wherein dynamically loading a detection logic script associated with the target service detection item according to the service request parameter and detection execution context data comprises: Constructing a detection script warehouse and a dynamic loading manager; Based on the dynamic loading manager, according to the item identification and version number in the service request parameter, searching and obtaining a corresponding detection logic script file from the detection script warehouse; and injecting detection execution context data into a script runtime environment based on the detection logic script file, and dynamically loading a detection logic script associated with a target service detection item, wherein the context data comprises request parameters, a basic service data snapshot and an external interface data cache.
  3. 3. The method of claim 1, wherein responding to the repair operation and verifying the repair effect comprises: Constructing a repair executor and an effect verifier; And executing user-triggered repair operation based on the repair executor, wherein the operation comprises parameter adjustment, data correction or interface recall, and simultaneously, rerun the associated detection item or executing simplified verification logic through the effect verifier, collecting the repaired service state data and comparing the repaired service state data with an expected result to output a verification conclusion.
  4. 4. The method of claim 1, wherein generating an evaluation report based on the detection and repair feedback data, updating the detection script and configuration information, comprises: Constructing a feedback data aggregator and an evaluation report generator; based on the feedback data aggregator, integrating performance indexes, abnormal distribution, repair success rate and user operation logs in the detection execution process, generating a comprehensive evaluation report comprising detection coverage rate, execution efficiency, abnormal detection accuracy and repair effectiveness through the evaluation report generator, and triggering version updating of the configuration data of the detection script warehouse and the detection items according to script logic defects or configuration defects pointed in the report.
  5. 5. The method for dynamically detecting according to claim 1, wherein the priority scheduling algorithm formula: ; wherein, priority is the Priority score of the detection item; The i-th detection item node; is a weight coefficient, satisfies ; A importance score for a test item; A urgency score for the test item; detecting the entry degree of the item node; The maximum value of the node income degree of all the detection items; a resource occupancy score for a detected item.
  6. 6. A script engine technology-based dynamic detection system, comprising: The acquisition module is used for acquiring service request parameters, basic service data, external interface data and detection item configuration data; The analysis module is used for constructing a dynamic detection framework driven by a script engine based on the basic service data and the detection item configuration data, defining a detection script grammar rule, an execution sequence specification and a dependency association mechanism, dynamically loading a detection logic script associated with a target service detection item according to the service request parameter and the detection execution context data, analyzing and executing the detection logic through the script engine, and scheduling an algorithm according to topology sequencing and priority, wherein the topology sequencing formula comprises the following steps: ; Wherein, the J is a traversal variable of sum operation, n is the total number of the detection items; To represent the slave test item To the point of Is a directed edge of (2); To represent the slave test item To the point of Is a directed edge of (2); The detected item node is deleted; Is that The method comprises the steps of (1) determining the execution sequence of detection items, wherein IsValidTopo is the validity mark of topological sorting, 1 represents the legal topological sorting and 0 represents the illegal sorting, wherein the execution sequence of the detection items is determined by analyzing and executing detection logic through a script engine according to topological sorting and priority scheduling algorithm, and the method comprises the steps of constructing a dependency relation analyzer and a scheduler, analyzing the detection item dependency statement in a detection logic script based on the dependency relation analyzer to generate a directed acyclic graph of the detection items, carrying out topological sorting on the directed acyclic graph through the scheduler, and determining an execution sequence queue by combining priority weights defined in detection item configuration data; The generation module is used for providing a preset quick repair entry for the abnormal detection item according to the execution result and the diagnosis information of each detection item, wherein the preset quick repair entry is provided for the abnormal detection item according to the execution result and the diagnosis information of each detection item, the generation module comprises an abnormal matcher and a repair action mapping table, the detection item execution result and the diagnosis information are matched with a predefined abnormal mode based on the abnormal matcher to obtain a matching result, the corresponding quick repair operation entry is obtained and presented according to the repair action mapping table based on the matching result, the repair operation is responded, the repair effect is verified, an evaluation report is generated according to the detection and repair feedback data, and the detection script and the configuration information are updated.
  7. 7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement a script engine technology based dynamic detection method as claimed in any one of claims 1-5.

Description

Dynamic detection method based on script engine technology Technical Field The invention belongs to the technical field of computer detection, and particularly relates to a dynamic detection method based on a script engine technology. Background With the complexity and multi-scenario development of enterprise-level business systems, the market has higher requirements on the flexibility, adaptability and closed-loop optimization capability of dynamic detection technology, and the detection logic and business scenario dynamic matching, multi-detection item cooperative scheduling, abnormal repair and detection optimization deep linkage are required to be realized. However, in the prior art, the deep fusion of the script engine and the detection framework is not realized, a flexible detection logic dynamic loading mechanism and a collaborative scheduling framework crossing detection items are lacking, and the accurate detection requirements under diversified service scenes are difficult to support, so that a significant gap exists between the technical requirements of constructing a detection system with dynamic adaptation, efficient execution and closed loop optimization. However, the conventional dynamic detection method has the key defects that a fixed detection logic or static configuration mode is adopted, response accuracy to service demands of different service scenes and different versions is insufficient and is easily interfered by service parameter changes, interface upgrading and detection rule iteration, the model lacks a detection logic dynamic adaptation mechanism, detection items with different priorities and different dependency relationships are faced, the rationality deviation of the execution sequence of each detection node is large, the detection efficiency is low or key abnormal detection is omitted, the data dimension is limited to single detection result output or simple abnormal prompt, cooperative processing to detection process data and repair effect data is lacked, and the detection logic and service actual demands are in an adaptation splitting state. Along with the rapid iteration of business systems in the fields of e-commerce, finance, government affairs and the like, the market is urgent for the requirements of high-flexibility, high-efficiency and high-closed-loop dynamic detection technology, and the prior art is difficult to support high-efficiency detection application in complex business scenes due to poor suitability, low execution efficiency and lack of closed-loop optimization. Disclosure of Invention The application provides a dynamic detection method based on a script engine technology, which aims to solve the problems of poor suitability, low execution efficiency and the like in the prior art. The embodiment of the first aspect of the application provides a dynamic detection method based on a script engine technology, which comprises the following steps of acquiring service request parameters, basic service data and detection item configuration data, constructing a dynamic detection framework driven by a script engine based on the basic service data and the detection item configuration data, defining a detection script grammar rule, an execution sequence specification and a dependency association mechanism, simultaneously dynamically loading a detection logic script associated with a target service detection item according to the service request parameters and detection execution context data, analyzing and executing the detection logic through the script engine, determining the execution sequence of the detection items according to a topological ordering and priority scheduling algorithm, asynchronously executing the detection logic through a thread pool, outputting the execution result and diagnosis information of each detection item in real time, providing a preset quick repair entry for the abnormal detection item according to the execution result and the diagnosis information of each detection item, responding to repair operation and verifying repair effect, generating an evaluation report according to detection and repair feedback data, and updating the detection script and the configuration information. The method comprises the steps of analyzing and executing detection logic through a script engine, determining the execution sequence of detection items according to a topological sorting and priority scheduling algorithm, constructing a dependency analyzer and a scheduler, analyzing the dependency declaration of the detection items in a detection logic script based on the dependency analyzer, generating a directed acyclic graph of the detection items, carrying out topological sorting on the directed acyclic graph through the scheduler, and determining an execution sequence queue by combining priority weights defined in detection item configuration data. The method comprises the steps of establishing an abnormal matcher and a repair action mapping table, matching