Test knowledge graph construction method based on AI

By performing structured processing and vectorized modeling of the test corpus, combined with graph attention networks and hierarchical topology correction, the problems of semantic ambiguity and hierarchical disorder in existing test knowledge graphs are solved, thereby improving the accuracy and reusability of test knowledge graphs.

CN121833501APending Publication Date: 2026-04-10NANJING HUADUN ELECTRIC POWER INFORMATION SAFETY EVALUATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING HUADUN ELECTRIC POWER INFORMATION SAFETY EVALUATION CO LTD
Filing Date
2025-12-19
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing test knowledge graph construction technologies struggle to accurately depict the complex semantic relationships between test behaviors, input objects, and constraints. They also lack adaptive learning capabilities, and the graph structure is prone to hierarchical confusion, affecting the reliability of test analysis and reasoning.

Method used

By extracting test data from requirements specifications and historical test documents, performing structured processing and vectorized modeling, using graph attention networks to calculate edge weights, and employing a hierarchical topology correction strategy to weaken cyclic paths within the same layer, the final test knowledge graph is constructed.

Benefits of technology

It improves the hierarchical clarity and stability of the test knowledge graph, enhances the accuracy and reusability of test knowledge, reduces comprehension bias, and can more accurately reflect the dependence strength of test behavior and abnormal scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833501A_ABST
    Figure CN121833501A_ABST
Patent Text Reader

Abstract

The invention discloses an AI-based test knowledge graph construction method, which relates to the technical field of software testing, and comprises the following steps: extracting original test text data from a requirement specification and a historical test document of target software, labeling test behavior words, input objects and constraint conditions, and generating a structured test corpus set; extracting a test entity set, and vectorizing the test entity set to obtain a test entity vector set; inputting the graph attention network to carry out edge weight calculation to obtain a test relation matrix; and constructing an initial test knowledge graph based on the test entity set and the test relationship matrix, and weakening the same-layer loop path in the initial test knowledge graph to obtain a final test knowledge graph. According to the method, semantic association and time sequence characteristics of a test entity are described by utilizing vectorization modeling, so that test elements have computable and comparable representation forms; the hierarchical clarity of the knowledge graph structure is improved, and the expression accuracy and reuse value are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software testing, and in particular to a test knowledge graph construction method based on AI. BACKGROUND

[0002] With the continuous increase in the scale and complexity of software systems, software testing has gradually developed from a verification activity mainly relying on human experience to a systematic process relying on engineering methods and intelligent technologies. Early test management mainly relied on test case documents, requirement traceability matrices, and manually maintained test asset libraries, which were difficult to support the continuous iteration of large-scale software. In recent years, knowledge graph technology has attracted attention in the field of software engineering. By organizing test requirements, test cases, defects, and execution results in the form of a graph structure, it provides structured support for test analysis and decision-making. At the same time, the development of natural language processing and machine learning technologies has made it possible to automatically extract semantic information from requirement specifications and test documents, laying a technical foundation for the automated construction of test knowledge. Against this background, modeling test semantics using artificial intelligence methods and organizing them into test knowledge graphs has gradually become an important research direction for improving the reusability and intelligent analysis capabilities of test assets.

[0003] However, existing test knowledge graph construction techniques still have obvious deficiencies. On the one hand, most schemes rely on rule-driven or shallow semantic analysis to process test texts, making it difficult to accurately depict the complex semantic relationships between test behaviors, input objects, and constraint conditions, resulting in fuzzy entity boundaries and rough relationship expressions in the graph. On the other hand, existing methods generally use static features or manually set weights in the entity and relationship modeling process, lacking adaptive learning capabilities based on corpus distribution and insufficient ability to express low-frequency abnormal test scenarios and implicit dependency relationships. In addition, in the graph structure construction phase, existing techniques focus more on relationship completion and connectivity, but lack effective constraint and correction mechanisms for structural problems such as inter-layer circular dependencies and redundant paths, which can easily cause graph level confusion and affect the reliability of subsequent test analysis and reasoning. SUMMARY

[0004] In view of the problems existing in the prior art test knowledge graph construction method based on AI, the present application is proposed. Therefore, the problem to be solved by the present application is how to provide a test knowledge graph construction method based on AI.

[0005] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a test knowledge graph construction method based on AI, comprising: extracting original test text data from the requirement specification and historical test documents of a target software, annotating test behavior words, input objects, and constraint conditions, and generating a structured test corpus set. extract a test entity set based on a structured test corpus, and perform vectorization processing on the test entity set to obtain a test entity vector set; input the test entity vector set into a graph attention network to perform edge weight calculation, and obtain a test relation matrix; construct an initial test knowledge graph based on the test entity set and the test relation matrix, and use a hierarchical topology correction strategy to weaken the same layer circular path in the initial test knowledge graph to obtain a final test knowledge graph.

[0006] As a preferred scheme of the AI-based test knowledge graph construction method, the generation of the structured test corpus includes: normalize the extracted original test text, unify the term expression, punctuation form and unit expression, and remove the format information irrelevant to the test; perform sentence segmentation and word division on the normalized text while maintaining the original order relationship; locate the behavior expression, input object and constraint description related to the test based on a test field clustering dictionary, and annotate the content by combining a named entity recognition model to obtain the test entity and the location identifier in the text; segment and divide the composite behavior in the annotation result according to the syntactic structure and dictionary rules to form a test text unit; unify and arrange the test text unit after completion of the annotation and division to generate the structured test corpus.

[0007] As a preferred scheme of the AI-based test knowledge graph construction method, the vectorization processing on the test entity set includes: perform word vector mapping on the text expression of the test entity, concatenate all word vectors of the segmented words in the entity text in order and calculate the average representation to obtain an initial semantic feature vector of the entity; generate a semantic adjacency matrix according to the co-occurrence frequency, behavior trigger word adjacency relationship and input-output description relationship between entities in the structured test corpus, and calculate the semantic neighborhood center vector of each entity, which is represented as: ; In the formula: the semantic neighborhood center vector of the entity, the entity having a semantic adjacency relationship with the entity in the semantic adjacency matrix, the number of semantic neighbors of the entity, the initial semantic feature vector of the entity; generate a syntactic dependency matrix according to the time sequence position, syntactic dependency chain and conditional trigger relationship of the entity in the sentence, and calculate the syntactic channel vector of each entity; The semantic channel vector and the syntactic channel vector are spliced and normalized to form a double-channel entity vector, which constitutes a test entity vector set.

[0008] As a preferred scheme of the AI-based test knowledge graph construction method, the input of the test entity vector set into the graph attention network for edge weight calculation comprises: According to the syntactic dependency chain, the action trigger word position and the input and output description recorded in the structured test corpus set, all entities are combined to form a candidate relationship pair set; The entity pair vector in the candidate relationship pair is spliced into a relationship input vector, and the corresponding relationship candidate label is recorded; Each entity in the entity set is taken as a graph node, and the entity pair in the candidate relationship pair is taken as a potential connection to construct an initial graph structure of the graph attention network; The attention coefficient of each node in the graph and the adjacent entity node is calculated, and the calculation formula of the attention coefficient is: ; In the formula: is the attention coefficient of the node and the adjacent entity node, denotes the double-channel vector of the entity, denotes the vector of the adjacent entity, denotes the training weight vector, denotes the transpose symbol, denotes the activation function, denotes vector splicing; The relationship input vector is aggregated according to the attention coefficient to generate a relationship strength vector, which is written into a test relationship matrix.

[0009] As a preferred scheme of the AI-based test knowledge graph construction method, the construction of the initial test knowledge graph comprises: Each entity in the test entity set is written into the graph structure as an independent node, and the corresponding entity identifier, entity category and order information appearing in the test corpus are bound for each node; The test relationship matrix is traversed, and for the entity pair with a non-zero relationship strength, a directed connection from the starting entity to the target entity is formed, and the relationship type composition and the corresponding relationship strength value are recorded in the connection attribute.

[0010] As a preferred scheme of the AI-based test knowledge graph construction method, the adoption of the hierarchical topology correction strategy to weaken the same-layer cyclic path in the initial test knowledge graph comprises: The initial test knowledge graph is fully traversed, and the nodes with an in-degree of zero are identified as a starting node set; Taking the starting node set as a benchmark, the level values of the remaining nodes in the graph are determined by expanding layer by layer along the directed connections outward; For each level, a subgraph composed of nodes in the level and mutual connection relationships is extracted, and a same-level cyclic path existing in the subgraph is detected and identified; For each identified same-level cyclic path, a weakening ratio related to path length and relationship strength is calculated, and the relationship strength of all connections in the cyclic path is reduced according to the weakening ratio; After the relationship strength weakening of the same-level cyclic path is completed, all connection relationships are traversed, and connections with a relationship strength lower than a preset lower limit are deleted; The in-degree, out-degree and level reachability information of nodes related to the deleted connections are updated to form a final test knowledge graph.

[0011] In a second aspect, the present application provides a computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the AI-based test knowledge graph construction method when executing the computer program.

[0012] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the AI-based test knowledge graph construction method.

[0013] The present application has the following beneficial effects: The present application reduces the understanding deviation caused by scattered test information by uniformly annotating and structuring the test semantics in the demand and test documents; On this basis, the semantic association and timing characteristics of test entities are described by vector modeling, so that the test elements have a computable and comparable representation form; The dependence strength between test behaviors, inputs and outputs and abnormal scenarios can be accurately reflected by adaptively weighting the entity relationships through a graph attention network; The same-level cyclic relationships are weakened by combining hierarchical topology correction, which improves the hierarchical clarity and stability of the knowledge graph structure, and enhances the accuracy and reuse value of test knowledge expression as a whole. BRIEF DESCRIPTION OF DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0015] Figure 1 It is a flowchart of an AI-based test knowledge graph construction method. DETAILED DESCRIPTION

[0016] In order to make the above objectives, characteristics and advantages of the present application more apparent, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work should belong to the protection scope of the present application.

[0017] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other different ways from the description, and those skilled in the art can make similar generalizations without departing from the concept of the present application, so the present application is not limited to the specific embodiments disclosed below.

[0018] Secondly, one embodiment or embodiments referred to herein can include a specific feature, structure or characteristic in at least one implementation of the present application. In different places in the specification, one embodiment does not refer to the same embodiment, nor does it refer to an embodiment that is separate or selectively excluded from other embodiments.

[0019] Reference Figure 1 For the first embodiment of the present application, the embodiment provides an AI-based test knowledge graph construction method, comprising: S1: extracting original test text data from the requirement specification of the target software and the historical test document, labeling the test behavior words, input objects and constraint conditions, and generating a structured test corpus set; S2: extracting a test entity set based on the structured test corpus set, and performing vectorization processing on the test entity set to obtain a test entity vector set; S3: inputting the test entity vector set into a graph attention network to calculate the edge weight, and obtaining a test relationship matrix; S4: constructing an initial test knowledge graph based on the test entity set and the test relationship matrix, and using a hierarchical topology correction strategy to weaken the same layer circular path in the initial test knowledge graph to obtain a final test knowledge graph.

[0020] Specifically, the original test text is extracted from the requirement specification of the target software and the historical test document, and unified and arranged into a to-be-processed corpus set.

[0021] The corpus set is split according to fixed rules according to documents, chapters and paragraphs, and the text content is standardized, including unified term expression, punctuation form and unit expression, and removing format information irrelevant to testing. The standardized text is divided into sentences and words, and the original order relationship is maintained.

[0022] Based on the test field clustering dictionary, the test related behavior expression, input object and constraint description are located, and the content is labeled by combining the named entity recognition model to obtain test entities and location identification in the text.

[0023] For the complex behaviors with unclear semantic boundaries in the labeling results, segmentation is performed according to the syntactic structure and dictionary rules to form test text units.

[0024] The test text units with completed labeling and segmentation are uniformly arranged to generate a test corpus set.

[0025] The entity records are read from the structured test corpus set, and the entity identification, standardized expression, category label and position index contained in the records are parsed in the order of document level, paragraph level and sentence level.

[0026] The positions of the entities with the same entity identification are merged to form a preliminary set of test entities, wherein each entity item records the text expression of the entity, the category feature and the sequence number sequence appearing in different sentences.

[0027] For each entity item in the preliminary set of test entities, the associated syntactic feature vector is extracted from the structured test corpus set according to the syntactic dependency relationship in the sentence and the context word distribution, and the syntactic feature vector and the sequence number sequence are stored as the syntactic description information of the entity.

[0028] The text expression of the test entity is subjected to deterministic word vector mapping, the word vectors of all words in the entity text are spliced in order and the average representation is calculated to obtain the initial semantic feature vector of the entity.

[0029] The semantic channel features for semantic association expression are constructed, the semantic adjacency matrix is generated according to the co-occurrence frequency of entities in the structured test corpus set, the adjacency relationship of behavior trigger words and the input-output description relationship, and the semantic neighborhood center vector of each entity is calculated and represented as: ; In the formula: the semantic neighborhood center vector of the entity, the entity having a semantic adjacency relationship with the entity in the semantic adjacency matrix, the number of semantic neighbors of the entity, the initial semantic feature vector of the entity.

[0030] The syntactic description information of the test entity is processed in order to construct a grammar channel analysis sequence for expressing time sequence dependence. According to the time sequence position of the entity in the sentence, the syntactic dependency chain and the conditional trigger relationship, a syntactic dependency matrix is generated, and a syntactic channel vector of each entity is calculated and represented as: ; In the formula: The syntactic channel vector representing the entity. Represents the sequence of occurrence of entities in a sentence. Aggregated temporal location features Indicates that the entity is from Dependency aggregation features extracted from the data. and These are the weighting coefficients.

[0031] The semantic channel vector and the syntactic channel vector are concatenated and normalized to form a dual-channel entity vector. The dual-channel vectors of all entities are then summarized to form a test entity vector set.

[0032] The dual-channel vector of each entity is read from the test entity vector set in the order of entity identifiers. Based on the syntactic dependency chains, action trigger word positions and input / output descriptions recorded in the structured test corpus, all entities are combined to form a candidate relation pair set.

[0033] The candidate relation pair set is parsed item by item, and the entity pair vectors are concatenated into a relation input vector. The relation candidate labels corresponding to the relation input vector are recorded, including: behavior trigger class, input-output dependency class and abnormal scenario class.

[0034] The initial graph structure of the graph attention network is constructed by taking each entity in the entity set as a graph node, treating each pair of entities in the candidate relation pair as a potential connection between nodes, and using the relation input vector as the feature input between the node pairs.

[0035] For each node in the graph, calculate the attention coefficient with its neighboring entity nodes. The formula for calculating the attention coefficient is: ; In the formula: Let be the attention coefficient between the node and its neighboring entity nodes. Represents a two-channel vector of an entity. A vector representing adjacent entities. Represents the training weight vector. Indicates the transpose symbol. This represents the activation function. This indicates vector concatenation.

[0036] The relation input vector is aggregated based on the attention coefficient to generate a relation strength vector, and the relation strength vector is written into the corresponding position of the test relation matrix. The matrix index is determined by the entity identifier in the relation pair. Each row of the test relation matrix is ​​normalized to make the relation strengths pointing to the same entity comparable.

[0037] When constructing the initial test knowledge graph based on the test entity set and the test relation matrix, each entity in the test entity set is written into the graph structure as an independent node, and each node is bound with its corresponding entity identifier, entity category, and order of appearance in the test corpus.

[0038] Traverse the test relation matrix. For any pair of entities with non-zero relation strength, write the relation corresponding to the entity pair into the graph structure to form a directed connection from the starting entity to the target entity. Record the relation type and corresponding relation strength value in the connection attribute to obtain the initial test knowledge graph containing all entities and relations.

[0039] After completing the initial test knowledge graph construction, the graph structure is fully traversed to count the in-degree and out-degree information of each node and identify nodes in the graph that do not depend on other entities.

[0040] Nodes with an in-degree of zero are collectively used as the starting node set, and the remaining nodes in the graph are then divided into hierarchical levels based on this set.

[0041] The hierarchy is determined as follows: starting from any initial node, expand outwards layer by layer along directed connections. The expansion layer number where a node is first visited is recorded as its hierarchy value. For nodes that cannot be accessed from the initial node during traversal, they are assigned to the same higher level based on their order of first appearance in the structured test corpus, while preserving their connection relationships with other nodes. This organizes the entire test knowledge graph into multiple node layers with clear hierarchical relationships.

[0042] After completing the hierarchical division, a subgraph consisting of nodes within that level and their interconnections is extracted for each level. In each subgraph, it is checked whether there is a closed path that can return to the starting node along a directed connection, and the cyclic paths formed between nodes in the same level are identified. For each detected cyclic path in the same level, the sequence of nodes participating in the cycle and the strength of the relationship between each connection in the path are recorded.

[0043] For identified loop paths at the same level, the connection direction between nodes is not changed; only the relationship strength of each connection in the loop path is uniformly weakened.

[0044] The weakening method is as follows: based on the overall level of relation strength in the loop path, a weakening ratio related to the path length and relation strength is calculated, and the relation strength of all connections in the loop path is reduced according to this ratio, so that the influence of the loop in the overall graph structure is lower than that of the cross-level trunk path, thereby avoiding interference of the same-level loop on the graph hierarchy.

[0045] After weakening the relationship strength of the same-level circular path, perform a relationship strength filtering operation on the entire graph structure. Traverse all connections in the graph, delete connections with relationship strength below the preset lower limit, and update the in-degree, out-degree, and level reachability information of the nodes related to the connection.

[0046] The topological structure of the initial test knowledge graph is corrected to control the influence of the same-level circular relationship, making the hierarchical relationship clearer and more stable, thus forming the final test knowledge graph.

[0047] This embodiment also provides a computer device applicable to an AI-based test knowledge graph construction method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement all or part of the steps of the method described in the above embodiments of the present invention.

[0048] This embodiment also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, it performs the method in any optional implementation of the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0049] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0050] In summary, this invention reduces comprehension bias caused by scattered test information by uniformly annotating and structuring the test semantics in requirements and test documents. Based on this, it utilizes vectorized modeling to characterize the semantic relationships and temporal features of test entities, giving test elements a computable and comparable representation. Through graph attention networks, it adaptively weights entity relationships, accurately reflecting the dependence strength between test behaviors, inputs / outputs, and abnormal scenarios. Finally, it weakens cyclical relationships within the same layer by combining hierarchical topology correction, improving the hierarchical clarity and stability of the knowledge graph structure, thereby enhancing the overall accuracy and reusability of test knowledge expression.

[0051] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for constructing a test knowledge graph based on AI, characterized in that: include, Raw test text data is extracted from the target software's requirements specification and historical test documents. Test behavior words, input objects, and constraints are labeled to generate a structured test corpus. The test entity set is extracted from the structured test corpus and then vectorized to obtain the test entity vector set. The test entity vector set is input into the graph attention network to calculate the edge weights, thus obtaining the test relation matrix; An initial test knowledge graph is constructed based on the test entity set and the test relationship matrix. A hierarchical topology correction strategy is then used to weaken the same-level loop paths in the initial test knowledge graph to obtain the final test knowledge graph.

2. The AI-based test knowledge graph construction method as described in claim 1, characterized in that: The generated structured test corpus includes: The extracted raw test text is standardized by unifying terminology, punctuation, and unit expressions, and removing formatting information irrelevant to the test. The normalized text is segmented into sentences and words while maintaining the original word order. Based on the clustering dictionary of the test domain, the behavior descriptions, input objects and constraint descriptions related to the test are located. The content is labeled by combining the named entity recognition model to obtain the test entities and their position identifiers in the text. For complex behaviors in the annotation results, they are segmented according to syntactic structure and dictionary rules to form test text units; The labeled and segmented test text units are organized in a unified manner to generate a structured test corpus.

3. The AI-based test knowledge graph construction method as described in claim 1, characterized in that: The vectorization process of the test entity set includes: Perform word vector mapping on the text representation of the test entity, concatenate the word vectors of all words in the entity text in order and calculate the average representation to obtain the initial semantic feature vector of the entity; Based on the co-occurrence frequency of entities, the adjacency relationship of action trigger words, and the input-output description relationship in the structured test corpus, a semantic adjacency matrix is ​​generated, and the semantic neighborhood center vector of each entity is calculated, represented as: ; In the formula: The semantic neighborhood center vector of an entity. This represents entities in the semantic adjacency matrix that have semantic adjacency relationships with the entity. This represents the number of semantic neighbors of an entity. The initial semantic feature vector representing the entity; Based on the temporal position of entities in a sentence, syntactic dependency chains, and conditional triggering relationships, a syntactic dependency matrix is ​​generated, and the syntactic channel vector for each entity is calculated. The semantic channel vector and the syntactic channel vector are concatenated and normalized to form a dual-channel entity vector, which constitutes the test entity vector set.

4. The AI-based test knowledge graph construction method as described in claim 1, characterized in that: The step of inputting the test entity vector set into the graph attention network and calculating edge weights includes: Based on the syntactic dependency chains, action trigger word positions, and input / output descriptions recorded in the structured test corpus, all entities are combined to form a candidate relation pair set; Concatenate the entity pair vectors in the candidate relation pairs into a relation input vector, and record the corresponding relation candidate labels; Using each entity in the entity set as a graph node and the entity pairs in the candidate relation pairs as potential connections, we construct the initial graph structure of the graph attention network. Calculate the attention coefficient between each node in the graph and its neighboring entity nodes. The formula for calculating the attention coefficient is: ; In the formula: Let be the attention coefficient between the node and its neighboring entity nodes. Represents a two-channel vector of an entity. A vector representing adjacent entities. Represents the training weight vector. Indicates the transpose symbol. This represents the activation function. This indicates vector concatenation; The relation input vector is aggregated based on the attention coefficient to generate a relation strength vector, which is then written into the test relation matrix.

5. The AI-based test knowledge graph construction method as described in claim 4, characterized in that: The construction of the initial test knowledge graph includes: Each entity in the test entity set is written into the graph structure as an independent node, and each node is bound with the corresponding entity identifier, entity category, and order of appearance in the test corpus. Traverse the test relation matrix. For entity pairs with non-zero relation strength, form a directed connection from the starting entity to the target entity, and record the relation type and corresponding relation strength value in the connection attribute.

6. The AI-based test knowledge graph construction method as described in claim 1, characterized in that: The method of weakening same-level loop paths in the initial test knowledge graph using a hierarchical topology correction strategy includes: Perform a full traversal of the initial test knowledge graph and identify nodes with an in-degree of zero as the starting node set; Using the initial set of nodes as a reference, expand outward layer by layer along the directed connections to determine the level values ​​of the remaining nodes in the graph; For each level, extract the subgraph consisting of nodes within the level and their interconnections, and detect and identify the cyclic paths within the same level in the subgraph; For each identified loop path at the same level, calculate the weakening ratio related to the path length and relationship strength, and reduce the relationship strength of all connections in the loop path according to the weakening ratio; After weakening the relationship strength of the same-level loop path, traverse all connection relationships and delete the connections whose relationship strength is lower than the preset lower limit; Update the in-degree, out-degree, and hierarchical reachability information of the nodes related to the deleted connections to form the final test knowledge graph.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the AI-based test knowledge graph construction method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the AI-based test knowledge graph construction method according to any one of claims 1 to 6.