Kernel intelligent testing method and system based on lock-free state perception and knowledge reasoning

CN122884838APending Publication Date: 2026-10-09XIAN ZHONGSHENG POLICY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611045762.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]相关技术中,当测试类型增加或测试策略调整时需同步修改执行代码,测试策略与执行实现存在代码级绑定依赖;同时,若对待测对象施加锁阻塞或仅依赖原始采样记录进行判定,会导致部分状态参数缺失、证据间缺乏依赖指针以及测试结论缺少关联映射路径的问题;现有方式对测试任务约束、知识文档范围与审计要求之间的对应关系缺少统一约束,导致测试结果与原始规则失去关联映射,从而影响后续的优化反馈与测试类型扩展

Benefits of technology

1、本发明通过对无锁状态感知数据进行状态快照、状态迁移、行为时序、接口交互、资源访问与异常事件的结构化组织,并结合规则、约束、预期行为描述和历史发现模式执行计算比对,输出冲突、失序、泄漏、失配与违约问题的分类识别结果;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884838A_ABST
    Figure CN122884838A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of operating system kernel test and software quality assurance, in particular to a kernel intelligent test method and system based on lock-free state perception and knowledge reasoning, comprising: loading corresponding structured test knowledge documents according to test task types, and analyzing and executing steps by a general executor; collecting kernel states and time sequences without global lock blocking to form perception data; reasoning the perception data in combination with the knowledge documents, and extracting running states to form test evidence; judging the evidence according to standards to generate structured test results; and finally feeding back discovery information, evaluating test quality and driving continuous optimization of the knowledge documents. The present application realizes separation of test strategies and execution codes, and improves the scalability, traceability and result reusability of multi-type kernel tests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of operating system kernel testing and software quality assurance technology, specifically to a kernel intelligent testing method and system based on lock-free state awareness and knowledge reasoning. Background Technology

[0002] Existing kernel testing methods typically configure dedicated execution logic for different test types and rely directly on fixed rules to complete status collection, result determination, and quality assessment during the testing process.

[0003] In related technologies, when test types are added or test strategies are adjusted, the execution code needs to be modified synchronously, and there is a code-level binding dependency between the test strategy and the execution implementation. At the same time, if locks are applied to the object under test to block or judgments are made solely based on the original sampling records, it will lead to problems such as missing some state parameters, lack of dependency pointers between evidence, and lack of associated mapping paths for test conclusions. Existing methods lack unified constraints on the correspondence between test task constraints, knowledge document scope, and audit requirements, resulting in a loss of association mapping between test results and original rules, thereby affecting subsequent optimization feedback and test type expansion.

[0004] Therefore, the kernel testing methods in related technologies do not simultaneously achieve test strategy decoupling, lock-free state parameter acquisition, and knowledge document updates based on feedback data. Summary of the Invention

[0005] The purpose of this invention is to provide a kernel intelligent testing method and system based on lock-free state awareness and knowledge reasoning, and to solve the following technical problems:

[0006] The problem of tight coupling between test strategies and dedicated execution code, as well as the problems of incomplete state collection, lack of mapping pointers between evidence, and untraceable judgment results caused by blocking with global locks or relying solely on raw sampling; the solution is to decouple and dynamically load test strategies, build globally consistent state-aware data and perform knowledge reasoning in a lock-free state, and ensure the traceability of test results and the updating of the test knowledge system.

[0007] The objective of this invention can be achieved through the following technical solutions: Receive the test task corresponding to the kernel object to be tested, and obtain the corresponding test type identifier; Based on the test type identifier, the corresponding structured test knowledge document is searched and loaded from the pre-established strategy registration mapping table. The structured test knowledge document defines the execution steps, judgment criteria, output format and feedback template. The test tasks and structured test knowledge documents are assigned to the general test execution body for parsing, generating and executing the corresponding step execution sequence; Without applying a global lock to the kernel object under test, a state snapshot and timing information of the kernel object under test are collected to form lock-free state-aware data. Based on lock-free state-aware data, combined with the rules and constraints in the structured test knowledge document, knowledge reasoning is performed on the kernel object under test to obtain the reasoning judgment result; Extract the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the unlocked state perception data, and combine the reasoning and judgment results to form test evidence corresponding to the execution steps; Based on the judgment criteria, the test evidence is judged for consistency, anomalies, or grading, and structured test results containing test conclusions and findings are generated. The discovered information is fed back to the corresponding structured test knowledge document, and the test quality is quantitatively evaluated in conjunction with pre-configured evaluation dimensions.

[0008] In one possible implementation, the structured test knowledge document includes test type declarations, execution step definitions, judgment criteria definitions, output format definitions, and discovery information feedback templates. The method for finding and loading the corresponding structured test knowledge document from a pre-established strategy registration mapping table based on the test type identifier includes: establishing a mapping table between the test type identifier and the storage path of the structured test knowledge document; and parsing the corresponding test type identifier for each received test task. Based on the test type identifier, find the corresponding target structured test knowledge document path in the mapping table; Read the target structured test knowledge document and extract the test type declaration, execution step definition, judgment criterion definition, output format definition, and discovery information feedback template; combine the extracted knowledge elements to form an executable strategy description for the test task.

[0009] In one possible implementation, the method for generating and executing the corresponding step execution sequence includes: For each execution step in the execution sequence, determine the corresponding input acquisition action, status acquisition action, tool invocation action, result collection action, or reasoning and analysis action in sequence. Methods for collecting state snapshots and timing information of the kernel object under test to form lock-free state-aware data include: collecting state snapshots, state transition information, event timing information or resource access information of the kernel object under test to form lock-free state-aware data. The methods for performing knowledge reasoning on the kernel object under test by combining the rules and constraints in the structured test knowledge document include: performing knowledge reasoning on the kernel object under test by combining the rules, constraints, expected behavior descriptions or historical discovery patterns in the structured test knowledge document; The methods for forming test evidence corresponding to the execution steps include: based on the result collection actions triggered during the execution process, summarizing the status collection results, tool call results, and inference judgment results corresponding to each execution step to form a test evidence set.

[0010] In one possible implementation, the lock-free state-aware data includes state snapshot data, state transition data, behavioral timing data, interface interaction data, resource access data, and exception event data; the methods for performing knowledge reasoning include: Extract key state parameters of the kernel object under test at different sampling times from the state snapshot data; For state transition data, analyze the state change path of the kernel object under test between different execution stages; for behavioral time sequence data and interface interaction data, construct the event correlation relationship of the kernel object under test. For resource access data and abnormal event data, identify conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns; perform correlation reasoning on key state parameters, state change paths, event correlations, and the identification results of conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns to obtain conclusions on the state consistency, behavior correctness, and risk level of the kernel object under test.

[0011] In one possible implementation, methods for determining consistency, anomalies, or grading of test evidence based on judgment criteria include: Obtain the predefined pass conditions, failure conditions, and grading conditions from the structured test knowledge document; for each piece of test evidence in the test evidence set, compare it with the corresponding pass conditions, failure conditions, and grading conditions; When the test evidence meets the pass conditions, the corresponding execution step is determined to have passed; when the test evidence meets the failure conditions, the corresponding execution step is determined to have failed, and corresponding discovery information is generated. When the test evidence meets the classification criteria, the corresponding findings are marked as severe, high, medium, or low according to the preset risk level; the judgment results of each execution step are summarized to generate a structured test result that includes test type, execution summary, judgment conclusion, findings and risk level.

[0012] One possible implementation involves feeding the discovery information back to the corresponding structured test knowledge document and combining it with pre-configured evaluation dimensions to quantitatively evaluate test quality. Extract findings from structured test results and categorize them according to test type and problem pattern; write the categorized findings into the feedback area of ​​the corresponding structured test knowledge document and update the problem pattern, rule constraints, or execution steps of the corresponding structured test knowledge document; Based on six evaluation dimensions—coverage, stability, mutation score, timeliness, prevention capability, and detection capability—the test quality of the current test task is quantitatively calculated using a pre-defined weighting model and scoring algorithm to obtain a test quality score. Based on the test quality score, identify the structured test knowledge documents that need optimization; based on the identification results, iteratively update the execution steps, judgment criteria, or feedback templates of the corresponding structured test knowledge documents.

[0013] In one possible implementation, the method also includes: Compliance control of the testing process is achieved through a pre-deployed specification-driven governance chain. The specification-driven governance chain refers to a compliance control link composed of an association constraint graph, an automated verification engine, and an audit traceability logger. Methods for achieving compliance control of the testing process through a pre-deployed specification-driven governance chain include: establishing the relationship description between requirements, contracts, architecture, specifications, coding, and auditing. The input constraints, interface constraints, behavioral constraints, and audit requirements corresponding to the test tasks are expressed in a structured manner. Before test execution, verify the consistency between the test task and the structured test knowledge document based on the relationship description. After the test is executed, the structured test results are reviewed for compliance in accordance with audit requirements to identify missing test steps, scope deviation issues, or untraceable conclusions. Based on the compliance review results, audit conclusions are generated and linked to the corresponding structured test results and structured test knowledge documents.

[0014] In one possible implementation, the test types include at least one or more of the following: context verification testing, requirement compliance testing, unit testing, contract testing, code review testing, integration testing, system testing, security testing, deterministic simulation testing, artificial intelligence model testing, performance testing, regression testing, and tracing analysis testing. When adding a new test type, perform the following steps: Write a structured test knowledge document corresponding to the new test type to define the execution steps, judgment criteria and output format of the new test type; Add a record linking the new test type to the structured test knowledge document in the strategy registration mapping table; After receiving the test task corresponding to the newly added test type, the corresponding structured test knowledge document is loaded by searching the newly added associated records; The general test executor parses the structured test knowledge document and executes the corresponding tests.

[0015] The task receiving module is used to receive the test tasks corresponding to the kernel object under test and obtain the corresponding test type identifier; The strategy loading module is used to find and load the corresponding structured test knowledge document from the pre-established strategy registration mapping table according to the test type identifier. The structured test knowledge document defines the execution steps, judgment criteria, output format and feedback template. The task assignment module is used to assign test tasks and structured test knowledge documents to the general test execution body for parsing. The test execution module is used to generate and execute the corresponding step execution sequence; under the condition of not applying a global lock to block the kernel object under test, it collects the state snapshot and timing information of the kernel object under test to form lock-free state-aware data; based on the lock-free state-aware data, it performs knowledge reasoning on the kernel object under test in combination with the rules and constraints in the structured test knowledge document to obtain the reasoning judgment result; it extracts the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the lock-free state-aware data, and combines the reasoning judgment result to form test evidence corresponding to the execution steps; The result determination module is used to determine the consistency, anomaly, or classification of test evidence according to the determination criteria, and generate structured test results containing test conclusions and findings. The optimized evaluation module is used to feed back the findings to the corresponding structured test knowledge document and to quantitatively evaluate the test quality in conjunction with pre-configured evaluation dimensions.

[0016] The beneficial effects of this invention are: 1. This invention organizes the unlocked state perception data into a structured manner, including state snapshots, state transitions, behavior sequences, interface interactions, resource access, and abnormal events. It also combines rules, constraints, expected behavior descriptions, and historical discovery patterns to perform calculations and comparisons, and outputs classification and identification results for conflict, disorder, leakage, mismatch, and breach of contract issues. 2. This invention unifies the judgment process and structures the result expression by writing pass conditions, failure conditions and grading conditions into a knowledge document and comparing the test evidence item by item. It outputs structured test results containing test conclusions, discovery information and risk levels. By writing the discovery information back to the knowledge document feedback area and combining it with coverage, stability, mutation score, timeliness, prevention capability and detection capability for quantitative evaluation, it promotes the continuous iterative optimization of the test knowledge document. 3. This invention uses a specification-driven governance chain to perform correlation verification on requirements, contracts, architecture, specifications, coding, and auditing. When adding new test types, it only expands the knowledge document and mapping relationship without adding new dedicated execution code, ensuring consistency and traceability between test tasks, execution scope, audit results, and knowledge documents, thereby achieving strategy decoupling, accurate judgment results, and continuous optimization of the testing process. Attached Figure Description

[0017] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0018] Figure 1 This is a flowchart illustrating the steps of the kernel intelligent testing method based on lock-free state perception and knowledge reasoning of the present invention. Figure 2 This is a schematic diagram of the kernel intelligent testing system based on lock-free state perception and knowledge reasoning in the embodiments of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1 Kernel intelligent testing methods based on lock-free state awareness and knowledge reasoning include: Receive the test task corresponding to the kernel object to be tested and obtain the corresponding test type identifier; based on the test type identifier, search and load the corresponding structured test knowledge document from the pre-established policy registration mapping table, which defines the execution steps, judgment criteria, output format and feedback template; The test tasks and structured test knowledge documents are assigned to the general test execution body for parsing, generating and executing the corresponding step execution sequence; Without applying a global lock to the kernel object under test, collect state snapshots and timing information of the kernel object under test to form lock-free state-aware data; Based on lock-free state-aware data, combined with the rules and constraints in the structured test knowledge document, knowledge reasoning is performed on the kernel object under test to obtain the reasoning judgment result; Extract the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the unlocked state perception data, and combine the reasoning and judgment results to form test evidence corresponding to the execution steps; Based on the judgment criteria, the test evidence is judged for consistency, anomalies, or grading, and structured test results containing test conclusions and findings are generated. The discovered information is fed back to the corresponding structured test knowledge document, and the test quality is quantitatively evaluated in conjunction with pre-configured evaluation dimensions.

[0021] The structured testing knowledge document includes test type declarations, execution step definitions, judgment criterion definitions, output format definitions, and discovery information feedback templates; The structured test knowledge document is constructed using standard JavaScript Object Notation (JSON) or Extensible Markup Language (XML) formats, transforming the test strategy into a Directed Acyclic Graph (DAG) structure that can be deserialized by the program. In this standardized format: the test type declaration field serves as the document header, providing the version number and global checksum hash; the execution step definition field is represented as a node array structure, with each node element explicitly containing a unique step identifier (ID), a list of preceding dependency node IDs, a standard atomic operation instruction set, and an environment parameter mapping table; the decision criterion definition field encapsulates logical operators and state evaluation formulas, such as using a built-in deviation calculation formula to quantify state offsets. ; And limit the formula when The pass condition is triggered at time, where For feature field weights, These are the actual collected status parameters. These are the expected state parameters. The preset tolerance threshold is set; the output format definition and discovery information feedback template fields are configured as key-value pair mapping tables containing dynamic placeholders, which are used to automatically bind the extracted test evidence and execution context during execution; based on the above standardized field structure definition and data format template, the kernel test requirements and preset test logic are written into a structured test knowledge document that conforms to the general test execution body input specification, thereby ensuring that the knowledge parsing engine can extract rules and execute schedules without ambiguity; The method for finding and loading the corresponding structured test knowledge document from a pre-established strategy registration mapping table based on the test type identifier includes: establishing a mapping table between the test type identifier and the storage path of the structured test knowledge document; and parsing the corresponding test type identifier for each received test task. Based on the test type identifier, find the corresponding target structured test knowledge document path in the mapping table; Read the target structured test knowledge document and extract the test type declaration, execution step definition, judgment criterion definition, output format definition, and discovery information feedback template; combine the extracted knowledge elements to form an executable strategy description for the test task.

[0022] The method for generating and executing the corresponding step execution sequence includes: for each execution step in the step execution sequence, determining the corresponding input acquisition action, status acquisition action, tool invocation action, result collection action, or reasoning analysis action in sequence.

[0023] Methods for collecting state snapshots and timing information of the kernel object under test to form lock-free state-aware data include: collecting state snapshots, state transition information, event timing information or resource access information of the kernel object under test to form lock-free state-aware data.

[0024] Methods for performing knowledge reasoning on the kernel object under test by combining the rules and constraints in the structured test knowledge document include: performing knowledge reasoning on the kernel object under test by combining the rules, constraints, expected behavior descriptions or historical discovery patterns in the structured test knowledge document.

[0025] The methods for forming test evidence corresponding to the execution steps include: based on the result collection actions triggered during the execution process, summarizing the status collection results, tool call results, and inference judgment results corresponding to each execution step to form a test evidence set.

[0026] In practice, the object under test is the concurrent resource management object in the kernel, and the test platform performs any of the following test tasks around the object: security testing, code review testing, deterministic simulation testing, or regression testing. The general test executor loads independently stored structured test knowledge documents at runtime to execute multiple types of kernel tests; When the testing platform receives the test task corresponding to the kernel object to be tested, it parses the test type identifier from the task description; This identifier can be provided directly by the external task submission end, or it can be obtained by the platform after classifying the task according to the test objectives, constraints and call entry points. The parsing results are written into the scheduling record of the current task, serving as an index for subsequent searches of structured test knowledge documents; the scheduling side accesses the pre-established policy registration mapping table, matches the test type identifier with the storage path of the structured test knowledge document, and loads the corresponding document.

[0027] This document should include at least a test type declaration, an execution step definition, a judgment criterion definition, an output format definition, and a discovery information feedback template.

[0028] After loading, the platform performs basic verification on the document, checking whether the test type declaration is consistent with the test type identifier in the current task, whether the execution steps are complete, and whether the judgment criteria and output format are parseable. If any part is missing, the current task is terminated and prevented from entering the execution phase. An incomplete document marker is generated and the task context is preserved for subsequent rescheduling after the document is supplemented. After the document passes verification, the scheduling side assigns the test task and the structured test knowledge document to the general test execution body. The general test execution body is independent of the strategy logic of specific test types. It generates the corresponding step execution sequence by parsing the execution steps in the document. The core architecture of the general test execution unit includes a knowledge parsing engine, an instruction translation engine, an action scheduling engine, and an execution context manager; The knowledge parsing engine is responsible for deserializing the input structured test knowledge document and parsing it into a directed acyclic graph (DAG) structure representation containing prerequisite dependencies and execution levels. The instruction translation engine has a pre-defined set of standardized atomic operation interfaces decoupled from the underlying operating system. It is responsible for traversing the above DAG graph and dynamically mapping each abstract execution step to the corresponding standard atomic operation sequence, such as memory read instructions and register probe instructions. The action scheduling engine is based on a lock-free circular queue, which distributes and schedules the translated atomic operations in order. The engine incorporates a resource contention-based execution overhead assessment mechanism to determine micro-scheduling priorities by evaluating the expected execution overhead of an action at a given step. The calculation satisfies the following formula: ; in, This indicates the duration of the basic hardware call overhead for the corresponding action. Indicates the first A resource-dependent concurrent contention complexity weight. This indicates the size of the payload in bytes representing the action interaction data. and These are the environmental adjustment coefficients pre-calibrated by the system; The execution context manager is used to dynamically allocate and reclaim isolated memory pools among various scheduled actions, and to establish a variable addressing mapping table within and between steps. The calculation method for its memory offset follows... This allows for the recording of intermediate state data between steps while maintaining physical isolation; the general test execution body uses a standardized set of atomic operation interfaces and dynamically parsed results to call the corresponding test logic, enabling the execution of various types of kernel tests; For each execution step in the execution sequence, the executor sequentially determines the input acquisition action, status acquisition action, tool invocation action, result collection action, and reasoning analysis action involved in that step; The intermediate results generated by the previous action are organized into a step record and written into the execution context of the current task for subsequent steps to read in sequence.

[0029] The above mechanism enables the structured flow of data between steps: the input acquisition action obtains the identifier, interface entry, and necessary task constraints of the kernel object under test; the state acquisition action collects state snapshots, state transition information, event sequence information, or resource access information around the object.

[0030] The tool invocation action triggers the corresponding testing tool based on the definition in the knowledge document; the result collection action summarizes the observation results returned by the aforementioned actions; the reasoning and analysis action combines the rules, constraints, expected behavior descriptions or historical discovery patterns in the knowledge document to form a reasoning and judgment result; During the test execution, the platform collects state snapshots and timing information without applying a global lock to the kernel object under test, forming lock-free state-aware data; The acquisition of state snapshots and timing information is based on the execution of lock-free circular buffer and atomic memory barrier instructions; The general test execution unit allocates an independent local circular buffer for each concurrent core. When a kernel object undergoes a state change, interface call, or resource access, the original concurrent logic continues to run. At the same time, it directly writes the event identifier, the current state increment, and the absolute timestamp read from the high-precision counter of the central processing unit hardware into the local circular buffer of the corresponding core through atomic operations. During the asynchronous post-processing phase, the platform collects records from all local circular buffers and performs multi-way merge sorting strictly according to the monotonically increasing nature of absolute timestamps to reconstruct a globally consistent virtual state snapshot and the corresponding event sequence.

[0031] The lock-free state awareness data includes the object state obtained by the current sampling after the above multi-path merging, the state change trajectory during execution, the interface call order, and resource access records; the general test execution body matches these data with the rules and constraints in the structured test knowledge document to determine whether the kernel object conforms to the expected behavior in each execution stage.

[0032] Specific constraints include: in deterministic simulation testing, verifying the consistency of state transition order under specific concurrency; in security testing, verifying the compliance of interface interaction and resource access constraints; and in regression testing, verifying the non-repeatability of historically discovered problem patterns.

[0033] The reasoning and judgment results obtained through this correspondence process, together with the running status, behavior trajectory, interface response, resource changes and interaction results, will be organized into test evidence and archived into a test evidence set according to the execution steps. After forming a set of test evidence, the platform calls the judgment criteria in the knowledge document to perform consistency judgment, anomaly judgment, or classification judgment on each piece of evidence. If the test evidence corresponding to a certain execution step meets the pass condition, the step is recorded as passed; if the failure condition is met, it is recorded as failed and the corresponding discovery information is generated. If the classification criteria are met, the discovery information is further marked to the corresponding risk level; the judgment results of all steps are summarized in the result record of the current task to form a structured test result, which includes at least the test conclusion and discovery information.

[0034] The results are written out in the output format of the document for subsequent aggregation and auditing; the findings are fed back to the feedback template area of ​​the corresponding structured test knowledge document to supplement new problem patterns, correct rule constraints, or adjust the definition of execution steps.

[0035] The platform combines pre-configured evaluation dimensions to quantitatively evaluate the execution quality of the test task, and saves the evaluation results along with the test type for subsequent identification of structured test knowledge documents that need optimization.

[0036] If a complete state snapshot or timing information is not obtained in a certain execution step, the general test execution entity will set an incomplete evidence flag for that step and separately retain the successfully obtained state acquisition results, tool call results, and inference judgment results.

[0037] If the knowledge document allows for further anomaly determination based on the remaining evidence, the platform will continue to execute subsequent steps and indicate the evidence gap in the structured test results. If the knowledge document requires that the current judgment be stopped when a key state is missing, this step will be marked as pending review in the result to prevent the missing data from being judged as a normal state conclusion. Based on the aforementioned retention mechanism that includes supplementary markers, a context record with evidence gap descriptions is established in the structured test results. This allows for the extraction of corresponding collection nodes, rule parsing nodes, or decision calculation nodes based on the evidence gaps during subsequent knowledge document optimization.

[0038] Based on the above processing mechanism, the structured test results remain traceable, and subsequent optimization of knowledge documents for the same test type can accurately pinpoint whether the problem occurred in the data collection stage, the rule-making stage, or the judgment stage.

[0039] In a preferred embodiment of the present invention, the lock-free state awareness data includes state snapshot data, state transition data, behavior timing data, interface interaction data, resource access data, and abnormal event data; the method for performing knowledge reasoning includes: extracting key state parameters of the kernel object under test at different sampling times based on the state snapshot data.

[0040] For state transition data, analyze the state change path of the kernel object under test between different execution stages; for behavioral time sequence data and interface interaction data, construct the event correlation relationship of the kernel object under test.

[0041] For resource access data and abnormal event data, identify conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns; perform correlation reasoning on key state parameters, state change paths, event correlations, and the identification results of conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns to obtain conclusions on the state consistency, behavior correctness, and risk level of the kernel object under test.

[0042] According to the judgment criteria, the methods for determining the consistency, anomaly, or grading of test evidence include: obtaining the predefined pass conditions, failure conditions, and grading conditions from the structured test knowledge document; and comparing each piece of test evidence in the test evidence set with the corresponding pass conditions, failure conditions, and grading conditions.

[0043] When the test evidence meets the pass conditions, the corresponding execution step is determined to have passed; when the test evidence meets the failure conditions, the corresponding execution step is determined to have failed, and corresponding discovery information is generated. When the test evidence meets the classification criteria, the corresponding findings are marked as severe, high, medium, or low according to the preset risk level; the judgment results of each execution step are summarized to generate a structured test result containing test type, execution summary, judgment conclusion, findings and risk level; Methods for feeding back findings to the corresponding structured test knowledge document and quantifying test quality by combining it with pre-configured evaluation dimensions include: Extract findings from structured test results and categorize them according to test type and problem pattern; write the categorized findings into the feedback area of ​​the corresponding structured test knowledge document and update the problem pattern, rule constraints, or execution steps of the corresponding structured test knowledge document; Based on six evaluation dimensions—coverage, stability, mutation score, timeliness, prevention capability, and detection capability—the test quality of the current test task is quantitatively calculated using a pre-defined weighting model and scoring algorithm to obtain a test quality score. Based on the test quality score, identify the structured test knowledge documents that need optimization; based on the identification results, iteratively update the execution steps, judgment criteria, or feedback templates of the corresponding structured test knowledge documents.

[0044] In practice, the object under test is still the concurrent resource management object in the kernel, but the general test execution will extract the key state parameters of the kernel object under test at different sampling times based on the state snapshot data. Key state parameters are extracted from the state content exposed by the kernel object under test to characterize the current running state for subsequent comparison. The executor then organizes the state transition data to obtain the state change path of the object between different execution stages; this path, together with the aforementioned key state parameters, is stored in the reasoning context of the current task as input data for subsequent knowledge reasoning steps; After the key state parameters and state change paths are written into the inference context, the executor continues to process behavioral timing data and interface interaction data. The platform extracts interface calls, response returns, status changes, and exception events in chronological order of their occurrence timestamps, and performs causal matching by extracting the global memory address identifier carried by each event. If within the time window If the preceding interface call event and the following state change event contain the same global memory address identifier, and the two satisfy the partial order association condition by parsing the memory barrier instruction sequence, and the state increment satisfies the modification constraint of the preceding interface, then the dependency is confirmed, and the event association relationship between the two is established. Event correlation indicates the record of state changes triggered by specific interface interactions, as well as the sequence of resource access before and after an abnormal event occurs.

[0045] The platform identifies conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns in resource access data and abnormal event data. For example, if the same resource has multiple access records during the set mutual exclusion execution phase, it can be classified as a conflict mode; if the state change path is inconsistent with the expected order in the document, it can be classified as an out-of-order mode; if no corresponding release result occurs after the resource is occupied, it can be classified as a leak mode. If the interface response is inconsistent with the object state, it can be classified as a mismatch mode; if the object behavior deviates from the constraint combination specified in the knowledge document, it can be classified as a breach mode. The above identification results, together with key state parameters, state change paths, and event correlations, constitute the inference input set;

[0046] Based on this, the platform performs associative reasoning according to the rules, constraints, expected behavior descriptions or historical discovery patterns in the structured test knowledge document to form conclusions on state consistency, behavior correctness and risk level. The state consistency conclusion indicates the numerical difference attribute between state parameters at different sampling times; the behavior correctness conclusion characterizes the matching status of interface interaction, state change and resource access with the knowledge document execution logic; the risk level conclusion corresponds to the degree of influence of the identified problem pattern in the current test type. The system performs associative reasoning based on a structured logical decision tree. For a state consistency conclusion, the platform extracts the difference between key state parameters at adjacent sampling times and compares them with the expected state increment declared in the interface interaction data field by field. If the actual difference of each field of interest is exactly equal to the expected increment, the system outputs a state consistency judgment; otherwise, it outputs the inconsistency and difference fields. Regarding the conclusion of the correctness of the behavior, the platform uses the timestamp of the event as a benchmark to construct a directed time sequence graph of the event relationship, and uses a graph traversal algorithm to check whether the identified conflict, disorder, leakage, mismatch or default pattern nodes are triggered.

[0047] The graph traversal algorithm uses a depth-first search strategy, taking the starting event node as the root node and visiting the nodes layer by layer downwards along the dependency edges with increasing timestamps. When accessing each node, the platform extracts the event type and resource identifier of that node and performs attribute matching with the previously identified abnormal event data set; If the current node has a record with the same event type and the same resource identifier in the abnormal event data set, it is determined that the corresponding abnormal mode node has been triggered, and the search of the current branch is immediately interrupted. The traversal path from the root node to the current abnormal node is recorded as the access link that hits the abnormal node. If the entire directed sequence graph is traversed without touching any abnormal pattern nodes, and the start and end events conform to the execution logic preset in the document, then the output behavior is correctly determined; otherwise, the output behavior is incorrectly determined and includes the access link of the abnormal node.

[0048] For risk level conclusions, the platform has a pre-set static mapping table of patterns and weights. It directly reads the basic risk score configured in the mapping table for the identified problem patterns, and calculates the weighted product based on the system level of the affected kernel objects to obtain the specific risk judgment value.

[0049] The platform predefines the conversion boundary conditions between hierarchical topology and dimensionless amplification factor: if the affected object is located in an independent process at the application layer, it is assigned a base amplification factor of 1.0; if it involves cross-process shared resources, it is assigned a base amplification factor of 2.0; if it directly involves the kernel core scheduling domain, it is assigned a preset base amplification factor greater than or equal to 3.0; the platform multiplies the extracted basic risk score by the corresponding dimensionless amplification factor to obtain a specific risk judgment value with unified dimensions; The system uses numerical comparison, graph traversal calculation and coefficient scaling mechanism to generate inference and judgment results, and combines the state consistency conclusion, behavior correctness conclusion and risk level conclusion with the original test evidence to form a test evidence set; The system uses predefined pass conditions, failure conditions, and grading conditions in the structured test knowledge document to compare each piece of test evidence in the test evidence set. For any execution step, if the corresponding test evidence meets the pass condition, the step is determined to pass; if it meets the failure condition, the step is determined to fail and corresponding discovery information is generated; if it meets the classification condition, the platform marks the discovery information as severe, high, medium or low according to the preset risk level.

[0050] The aforementioned risk level classification criteria are determined by two independent indicators: the scope of the anomaly's impact and the system response delay. The platform predefines, in its knowledge documentation, the first wave and threshold of the impact within a single process, the second wave and threshold of the impact of cross-process scheduling, and the latency timeout threshold. When the information indicating an abnormal event is limited to a mismatch pattern within a single process, and the resource waiting time is less than the delay timeout threshold, the corresponding risk will be marked as low. If the scope of the anomaly reaches the second impact threshold and causes local resource leakage, it is marked as medium risk or high risk; if the anomaly causes deadlock blocking that is greater than or equal to the delay timeout threshold, or if the default mode affects the kernel core process, it is directly judged as severe. Through the structured decomposition of the above multi-branch judgment conditions, the qualitative risk concept is transformed into a deterministic quantitative assessment. After completing the item-by-item comparison, the platform summarizes the judgment results of each execution step and generates a structured test result that includes test type, execution summary, judgment conclusion, discovery information and risk level. The results are then written in the output format defined in the knowledge document to achieve unified aggregation of multiple test results for the same kernel object; Under high concurrency conditions, some abnormal events may arrive before the complete state snapshot, or some resource access records may be missing. If a failure is made directly based on this, the discovered information may be inconsistent with the actual problem pattern. When the event correlation has not been fully established, or a certain type of pattern recognition lacks necessary evidence, the platform retains the confirmed evidence chain and marks the current evidence as to be supplemented. If the existing evidence meets the failure threshold defined by the judgment criteria, a failure conclusion is output, but the evidence missing explanation needs to be retained in the discovery information; if the existing evidence is insufficient to meet the pass and fail conditions, this step will not be graded, and the status pending review will only be recorded in the execution summary. This approach allows structured test results to be accepted by subsequent processes even when evidence is incomplete, while avoiding the solidification of insufficient evidence into definitive conclusions. After the test results are generated, the platform extracts the findings from the structured test results and categorizes them according to test type and problem pattern; The categorized findings are written into the feedback area of ​​the corresponding structured test knowledge document; for new problem patterns, the platform extracts the interface call sequence and resource access conflict features contained therein into regular expressions, which are then directly appended to the set of failure conditions defined in the judgment criteria. To address the constraints of the revised rules, the key state parameter differences that cause the failure of the state consistency determination are extracted from the discovery information, and the allowable floating threshold range in the original rule constraints is updated by taking the union of the values. After the feedback is written, the platform then uses a preset weighting model and scoring algorithm to quantify the test quality of the current test task based on six evaluation dimensions: coverage, stability, mutation score, timeliness, prevention capability, and detection capability, to obtain a test quality score.

[0051] In the above scoring algorithm, the platform formulates independent scoring rules for each of the six evaluation dimensions and maps them to a unified benchmark score range of 0 to 100. For the mapping mechanism of each dimension's measurement data to the benchmark score range, the platform adopts an extreme value transformation strategy based on historical reference boundaries. Taking the coverage dimension as an example, the highest reference coverage in the same historical test tasks is extracted in advance as the upper limit of the full score benchmark, and the lowest reference coverage is extracted as the lower limit of the zero score benchmark.

[0052] Calculate the deviation ratio of the measured coverage index of the current test task within the interval formed by the upper and lower limits mentioned above, and directly convert the ratio into the corresponding score of 0 to 100. If the current measured index is greater than or equal to the upper limit boundary mentioned above, it is directly constrained to 100 points; if it is less than or equal to the lower limit boundary, it is recorded as 0 points. For other evaluation dimensions, the platform obtains the collected measurement data and maps it to the benchmark score range through the following determined logic: extract the ratio of the number of execution steps that did not cause system crashes to the total number of steps during the test period as stability measurement data; The ratio of the number of manually injected faults that were successfully intercepted to the total number of injected faults was extracted as the mutation score metric; based on the formula Calculate timeliness measurement data, where, For timeliness measurement data, To preset the timeout threshold, To measure the execution time.

[0053] After collecting the aforementioned metric data, using the same extreme value transformation strategy as for coverage, the highest reference value from historical similar test tasks is extracted as the upper limit of the benchmark, and the lowest reference value is extracted as the lower limit of the benchmark. A linear interpolation algorithm is then used to transform the current metric data into the corresponding... to Score; The specific calculation process of the scoring algorithm is expressed as follows: ; in, To score the test quality; the first Scores of measurement data extracted from each evaluation dimension Compared with the preset weight allocation model, the first Weights corresponding to each evaluation dimension Multiply, and divide by the total. The products of all evaluation dimensions are summed and accumulated;

[0054] For example, in a specific test, the extracted metrics showed a coverage score of 90, a stability score of 85, a mutation score of 80, a timeliness score of 95, a prevention capability score of 70, and a detection capability score of 90. The preset weight allocation model sets the weights for each dimension as follows: coverage weight 0.25, detection capability weight 0.25, stability weight 0.15, prevention capability weight 0.15, mutation score weight 0.1, and timeliness weight 0.1. The platform completes the quantitative calculation by multiplying the scores of each dimension with their corresponding weights one by one and then summing them up. That is, the calculation is: 90×0.25+85×0.15+80×0.1+95×0.1+70×0.15+90×0.25, and finally obtains a comprehensive score of 85.75 points as the test quality score. The platform uses this score to identify structured test knowledge documents that need optimization, and iteratively updates the definitions of execution steps, judgment criteria, or feedback templates accordingly. The updated documentation continues to serve as the strategy basis for subsequent tasks of the same type, thereby enabling the knowledge documentation to gradually converge with the test results without the need to add new dedicated executable code.

[0055] In a preferred embodiment of the present invention, the method further includes: performing compliance control on the testing process through a pre-deployed specification-driven governance chain; the specification-driven governance chain refers to a compliance control link composed of an association constraint graph, an automated verification engine, and an audit trace recorder; the method for performing compliance control on the testing process through a pre-deployed specification-driven governance chain includes: establishing an association description relationship between requirements, contracts, architecture, specifications, coding, and auditing; The input constraints, interface constraints, behavioral constraints, and audit requirements corresponding to the test tasks are expressed in a structured manner; before test execution, the consistency between the test tasks and the structured test knowledge document is verified based on the relationship between the descriptions. After the test is executed, the structured test results are reviewed for compliance in accordance with audit requirements to identify missing test steps, scope deviation issues, or untraceable conclusions. Based on the compliance review results, audit conclusions are generated and linked to the corresponding structured test results and structured test knowledge documents.

[0056] The test types should include at least one or more of the following: context verification testing, requirement compliance testing, unit testing, contract testing, code review testing, integration testing, system testing, security testing, deterministic simulation testing, artificial intelligence model testing, performance testing, regression testing, and tracing analysis testing.

[0057] When adding a new test type, perform the following steps: Write a structured test knowledge document corresponding to the new test type to define the execution steps, judgment criteria and output format of the new test type; Add a record linking the new test type to the structured test knowledge document in the strategy registration mapping table; After receiving the test task corresponding to the newly added test type, the corresponding structured test knowledge document is loaded by searching the newly added associated records; The general test executor parses the structured test knowledge document and executes the corresponding tests.

[0058] Please see Figure 2 A kernel intelligent testing system based on lock-free state awareness and knowledge reasoning includes: The task receiving module is used to receive the test tasks corresponding to the kernel object under test and obtain the corresponding test type identifier; The strategy loading module is used to find and load the corresponding structured test knowledge document from the pre-established strategy registration mapping table according to the test type identifier. It defines the execution steps, judgment criteria, output format and feedback template. The task assignment module is used to assign test tasks and structured test knowledge documents to the general test execution body for parsing. The test execution module is used to generate and execute the corresponding step execution sequence; under the condition of not applying a global lock to block the kernel object under test, it collects the state snapshot and timing information of the kernel object under test to form lock-free state-aware data; based on the lock-free state-aware data, it performs knowledge reasoning on the kernel object under test in combination with the rules and constraints in the structured test knowledge document to obtain the reasoning judgment result; it extracts the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the lock-free state-aware data, and combines the reasoning judgment result to form test evidence corresponding to the execution steps; The result determination module is used to determine the consistency, anomaly, or classification of test evidence according to the determination criteria, and generate structured test results containing test conclusions and findings. The optimized evaluation module is used to feed back the findings to the corresponding structured test knowledge document and to quantitatively evaluate the test quality in conjunction with pre-configured evaluation dimensions.

[0059] In practice, the object under test is still the concurrent resource management object in the kernel. The test platform configures and calls one or more of the following tests for the kernel object under test that is in the iterative state: context verification test, requirement compliance test, unit test, contract test, code review test, integration test, system test, security test, deterministic simulation test, artificial intelligence model test, performance test, regression test, and link tracing analysis test.

[0060] The platform pre-deploys a specification-driven governance chain to control compliance during the testing process. This chain, comprised of a constraint graph, an automated verification engine, and an audit traceability logger, is a compliance control mechanism. Its technical boundaries are limited to automatically parsing and comparing multi-dimensional test constraints before and after test task execution to implement compliance interception and evidence traceability. The platform establishes descriptive relationships between requirements, contracts, architecture, specifications, coding, and auditing. The relationship description is based on the test requirements of the kernel object under test, forming the following constraints: requirements are used to limit the test objectives, contracts are used to limit the interface relationships, architecture is used to limit the system boundary where the object is located, specifications are used to limit the specific test behaviors, coding is used to limit the program implementation that can be called and observed by the test executor, and auditing is used to limit the basis for reviewing the results; The platform will express the input constraints, interface constraints, behavioral constraints and audit requirements corresponding to the test tasks in a structured way, and establish a corresponding relationship with the current task record.

[0061] Through the above constraint expression mechanism, before test execution, the scheduling side can check whether the test task and the structured test knowledge document are consistent based on the above association description relationship. For example, it can check whether the execution steps in the document exceed the interface scope limited by the task, whether the judgment criteria in the document cover the behavioral constraints required by the task, and whether the feedback template meets the audit requirements.

[0062] In the specific verification execution, the platform transforms the interface constraints of the task into a whitelist of allowed interfaces, and extracts all target interfaces involved in the execution steps from the structured test knowledge document to form an execution interface set. The platform calculates the difference between the set of execution interfaces and the whitelist set. If the difference is not empty, it determines that the range of interfaces is exceeded and records the out-of-bounds interface identifier. For concurrent behavior constraints with pre-dependencies and causal order, the platform parses the behavior features according to the preset syntax tree, sets the extracted triggering events and state changes as nodes, converts the pre-condition keywords between events into dependency direction edges, constructs a directed acyclic graph structure, and parses the coverage of the decision criteria in the document into a decision behavior network graph through the same syntax tree. By performing subgraph matching and traversal operations, we verify one by one whether the node execution order, prerequisite events, and mutual exclusion conditions required by the task are fully embedded in the valid path of the behavior network graph. In the subgraph matching traversal operation, the platform selects the starting node with an in-degree of zero in the directed acyclic graph structure required by the task, and searches for candidate starting nodes with the same feature identifier in the decision behavior network graph. After determining the candidate starting node, the platform extracts the current node to be matched and all its preceding dependent edges in sequence according to the topological sorting sequence of the directed acyclic graph required by the task, and checks whether there are connected paths with the same direction and consistent constraints between the corresponding candidate nodes in the network graph of the judgment behavior. When checking mutual exclusion conditions, the platform reads the mutual exclusion node pairs required by the task and verifies whether there is no direct or indirect directed path between these two in the behavior network graph. If, during the matching process, it is found that a certain node required by the task does not have a corresponding node with the same feature identifier in the network graph of the judgment behavior, it is marked as an isolated node. If the prerequisite dependencies required by the task are found to be opposite in the corresponding path direction in the decision behavior network graph, then it is marked as a dependency edge with temporal reversal. If there are isolated nodes or time-reversed dependency edges, it is determined that there are uncovered blind spots or time-series contradictions in the behavioral constraints; the platform outputs consistency verification identifiers and data structure matching records between the test task and the structured test knowledge document based on the determined set difference and the subgraph matching traversal results of the directed acyclic graph. If inconsistencies are found between the test task and the knowledge document before execution, the platform will stop the test execution phase and record the inconsistency in the consistency verification results. When the output format or feedback template does not match, the system triggers document update and secondary verification instructions while keeping the execution steps unchanged. In cases involving execution range offsets or missing constraints, the current task remains pending to avoid outputting unfounded test conclusions when the documentation and task constraints are inconsistent.

[0063] This pre-verification ensures that all tasks entering the test execution module are marked with a confirmed consistency flag, thereby reducing range offset issues in subsequent audit phases.

[0064] Once the test is completed and structured test results are generated, the platform will conduct a compliance review of the results in accordance with audit requirements to identify missing test steps, scope deviation issues, or untraceable conclusions. Missing test steps refer to steps where the constraints covered by the knowledge document are not reflected in the execution summary and test evidence; range offset issues refer to test results involving object behaviors or interface relationships not required by the task; untraceable conclusion issues refer to the problem where the discovered information or judgment conclusion lacks corresponding test evidence, judgment criteria, or knowledge document entries.

[0065] After the review is completed, the platform generates an audit conclusion and links the audit conclusion to both the structured test results and the structured test knowledge document. Based on the above association mechanism, when calling the test results, the corresponding compliance status identifier is output, and during the knowledge document optimization stage, the node positions of the execution steps definition, judgment criteria definition or feedback template involved in the correction are output. When a new test type is added, the execution steps, judgment criteria and output format of the new test type are defined by writing a structured test knowledge document corresponding to the new test type. Add an association record between the new test type and the structured test knowledge document to the strategy registration mapping table; after the platform receives the test task corresponding to the new test type, the strategy loading module loads the corresponding document according to the newly added association record, and then the general test execution body parses the document and executes the test; Based on the dynamic loading and parsing method, when adding a new test type, the system only updates the associated records in the structured test knowledge document and the strategy registration mapping table, and the code structure of the general test executor remains unchanged; for the same kernel object, the differences between different test types are limited to the structured document, and the platform code structure remains stable.

[0066] From a system composition perspective, the test system used to implement the above methods includes at least a task receiving module, a strategy loading module, a task dispatching module, a test execution module, a result judgment module, and an optimization evaluation module; the task receiving module is responsible for receiving the test tasks corresponding to the kernel object under test and obtaining the test type identifier; The strategy loading module is responsible for finding and loading the corresponding structured test knowledge document based on the test type identifier; the task dispatching module is responsible for dispatching test tasks and documents to the general test execution body. The test execution module is responsible for parsing the document, generating the step execution sequence, and collecting state snapshots and timing information without applying a global lock to the kernel object under test to form lock-free state-aware data. It then combines the rules and constraints in the document to perform knowledge reasoning. The results judgment module is responsible for judging the consistency, anomalies, or classification of test evidence according to the judgment criteria in the document, and generating structured test results; the optimization evaluation module is responsible for feeding back the findings to the corresponding structured test knowledge document, and quantitatively evaluating the test quality in combination with the pre-configured evaluation dimensions. The modules mentioned above are connected through task records, execution context, inference context, structured test results, and audit conclusions, so that test tasks, strategy documents, execution evidence, and audit results maintain a corresponding relationship within the same platform.

[0067] When some constraints in the audit requirements cannot be supported by corresponding evidence in the current task, the platform retains the existing test conclusions and marks the parts for which corresponding evidence has not been obtained as audit supplementary items, and saves them together with the structured test results; If the same type of test is performed again after subsequent knowledge document updates, the platform, in conjunction with the specification-driven governance chain, can directly read the items to be supplemented in the previous test and check whether the new results have covered the corresponding gaps during compliance review.

[0068] For newly added test types, if the associated record has been added to the policy registration mapping table but the knowledge document content is still incomplete, the task receiving module can accept the task. However, after reading the document, the policy loading module will stop dispatching downwards due to the lack of execution step definition, judgment criterion definition, or output format definition, so as to prevent the general test execution body from entering the test execution when the definition is incomplete.

[0069] Through the above processing, the testing system can support the expansion of test types while maintaining the correspondence between various test results, audit conclusions, and the basis for modifying knowledge documents.

[0070] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A kernel intelligent testing method based on lock-free state awareness and knowledge reasoning, characterized in that, include: Receive the test task corresponding to the kernel object to be tested, and obtain the corresponding test type identifier; Based on the test type identifier, the corresponding structured test knowledge document is searched and loaded from the pre-established strategy registration mapping table. The structured test knowledge document defines the execution steps, judgment criteria, output format and feedback template. The test task and the structured test knowledge document are assigned to the general test execution body for parsing, generating and executing the corresponding step execution sequence; Without applying a global lock to the kernel object under test, a state snapshot and timing information of the kernel object under test are collected to form lock-free state-aware data. Based on the lock-free state perception data, and combined with the rules and constraints in the structured test knowledge document, knowledge reasoning is performed on the kernel object under test to obtain the reasoning judgment result; Extract the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the unlocked state perception data, and combine the inference and judgment results to form test evidence corresponding to the execution steps; Based on the judgment criteria, the test evidence is judged for consistency, anomaly, or classification, and a structured test result containing test conclusions and findings is generated. The findings are fed back to the corresponding structured test knowledge document, and the test quality is quantitatively evaluated in conjunction with pre-configured evaluation dimensions.

2. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 1, characterized in that, The structured test knowledge document includes test type declaration, execution step definition, judgment criterion definition, output format definition, and discovery information feedback template; The method for finding and loading the corresponding structured test knowledge document from a pre-established strategy registration mapping table based on the test type identifier includes: establishing a mapping table between the test type identifier and the storage path of the structured test knowledge document; and parsing the corresponding test type identifier for each received test task. Based on the test type identifier, find the corresponding target structured test knowledge document path in the mapping table; Read the target structured test knowledge document and extract the test type declaration, execution step definition, judgment criterion definition, output format definition, and discovery information feedback template; combine the extracted knowledge elements to form an executable strategy description for the test task.

3. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 2, characterized in that, Methods for generating and executing the corresponding step execution sequence include: For each execution step in the execution sequence, determine the corresponding input acquisition action, status acquisition action, tool invocation action, result collection action, or reasoning and analysis action in sequence. Methods for collecting state snapshots and timing information of the kernel object under test to form lock-free state-aware data include: collecting state snapshots, state transition information, event timing information or resource access information of the kernel object under test to form lock-free state-aware data. The method of performing knowledge reasoning on the kernel object under test by combining the rules and constraints in the structured test knowledge document includes: performing knowledge reasoning on the kernel object under test by combining the rules, constraints, expected behavior descriptions or historical discovery patterns in the structured test knowledge document; The method for forming test evidence corresponding to the execution steps includes: summarizing the state collection results, tool call results and reasoning judgment results corresponding to each execution step based on the result collection actions triggered during the execution process, and forming a test evidence set.

4. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 3, characterized in that, The lockless state awareness data includes state snapshot data, state transition data, behavior timing data, interface interaction data, resource access data, and abnormal event data. Methods for performing knowledge reasoning include: Extract key state parameters of the kernel object under test at different sampling times from the state snapshot data; For state transition data, analyze the state change path of the kernel object under test between different execution stages; for behavioral time sequence data and interface interaction data, construct the event correlation relationship of the kernel object under test. For resource access data and abnormal event data, identify conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns; perform correlation reasoning on the key state parameters, the state change paths, the event correlations, and the identification results of the conflict patterns, disorder patterns, leakage patterns, mismatch patterns, or breach patterns to obtain the state consistency conclusion, behavior correctness conclusion, and risk level conclusion of the kernel object under test.

5. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 4, characterized in that, The methods for determining consistency, anomalies, or grading of the test evidence according to the aforementioned criteria include: Obtain the predefined pass conditions, failure conditions, and grading conditions from the structured test knowledge document; for each piece of test evidence in the test evidence set, compare it with the corresponding pass conditions, failure conditions, and grading conditions; When the test evidence meets the pass conditions, the corresponding execution step is determined to have passed; when the test evidence meets the failure conditions, the corresponding execution step is determined to have failed, and corresponding discovery information is generated. When the test evidence meets the classification criteria, the corresponding findings are marked as severe, high, medium, or low according to the preset risk level; the judgment results of each execution step are summarized to generate a structured test result that includes test type, execution summary, judgment conclusion, findings and risk level.

6. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 5, characterized in that, The method of feeding back the discovery information to the corresponding structured test knowledge document and quantitatively evaluating the test quality in conjunction with pre-configured evaluation dimensions includes: Extract findings from structured test results and categorize them according to test type and problem pattern; write the categorized findings into the feedback area of ​​the corresponding structured test knowledge document and update the problem pattern, rule constraints, or execution steps of the corresponding structured test knowledge document; Based on six evaluation dimensions—coverage, stability, mutation score, timeliness, prevention capability, and detection capability—the test quality of the current test task is quantitatively calculated using a pre-defined weighting model and scoring algorithm to obtain a test quality score. Based on the test quality score, identify the structured test knowledge documents that need optimization; based on the identification results, iteratively update the execution steps, judgment criteria, or feedback templates of the corresponding structured test knowledge documents.

7. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 6, characterized in that, The method further includes: Compliance control of the testing process is achieved through a pre-deployed specification-driven governance chain; the specification-driven governance chain refers to a compliance control link composed of an association constraint graph, an automated verification engine, and an audit traceability logger; the method of achieving compliance control of the testing process through a pre-deployed specification-driven governance chain includes: establishing the association description relationship between requirements, contracts, architecture, specifications, coding, and auditing; The input constraints, interface constraints, behavioral constraints, and audit requirements corresponding to the test tasks are expressed in a structured manner. Before the test is executed, the consistency between the test task and the structured test knowledge document is verified based on the aforementioned relationship description. After the test is executed, the structured test results are reviewed for compliance in accordance with the audit requirements to identify missing test steps, scope deviation issues, or untraceable conclusions. Based on the compliance review results, an audit conclusion is generated and associated with the corresponding structured test results and structured test knowledge documents.

8. The kernel intelligent testing method based on lock-free state awareness and knowledge reasoning according to claim 7, characterized in that, The test types include at least one or more of the following: context verification testing, requirement compliance testing, unit testing, contract testing, code review testing, integration testing, system testing, security testing, deterministic simulation testing, artificial intelligence model testing, performance testing, regression testing, and tracing analysis testing. When a new test type is added, the following steps are performed: Write a structured test knowledge document corresponding to the new test type to define the execution steps, judgment criteria and output format of the new test type; Add an association record between the newly added test type and the structured test knowledge document to the strategy registration mapping table; Upon receiving the test task corresponding to the newly added test type, the corresponding structured test knowledge document is loaded by searching for the newly added associated records; The general test executor parses the structured test knowledge document and executes the corresponding tests.

9. A kernel intelligent testing system based on lock-free state awareness and knowledge reasoning, used to implement the kernel intelligent testing method based on lock-free state awareness and knowledge reasoning as described in any one of claims 1-8, characterized in that, include: The task receiving module is used to receive the test tasks corresponding to the kernel object under test and obtain the corresponding test type identifier; The strategy loading module is used to search for and load the corresponding structured test knowledge document from the pre-established strategy registration mapping table according to the test type identifier. The structured test knowledge document defines the execution steps, judgment criteria, output format and feedback template. The task assignment module is used to assign the test tasks and the structured test knowledge documents to the general test execution body for parsing. The test execution module is used to generate and execute the corresponding step execution sequence; without applying a global lock to the kernel object under test, it collects the state snapshot and timing information of the kernel object under test to form lock-free state-aware data. Based on the lock-free state perception data, and combined with the rules and constraints in the structured test knowledge document, knowledge reasoning is performed on the kernel object under test to obtain the reasoning judgment result; Extract the running state, behavior trajectory, interface response, resource changes or interaction results of the kernel object under test from the unlocked state perception data, and combine the inference and judgment results to form test evidence corresponding to the execution steps; The result determination module is used to determine the consistency, anomaly, or classification of the test evidence according to the determination criteria, and generate a structured test result containing test conclusions and findings. The optimization evaluation module is used to feed back the findings to the corresponding structured test knowledge document and to quantitatively evaluate the test quality in conjunction with pre-configured evaluation dimensions.