Software asset chain-based tracing and retrieval methods, systems, equipment, and media

By constructing an ontology and knowledge graph in the field of software engineering, and combining rules, statistics and semantic confidence calculation, a cross-entity asset chain is generated, which solves the isolation and fragmentation problems in software asset retrieval and reuse in existing technologies, realizes efficient and intelligent chain-based traceability retrieval, and improves reuse efficiency and accuracy.

CN123115393APending Publication Date: 2026-11-17HARBIN AEROSPACE STAR DATA SYST TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611447018.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing software asset retrieval and reuse technologies suffer from isolated retrieval methods, broken relationships, insufficient integration, and inadequate utilization of unstructured information. They are unable to automatically construct a complete logical link across requirements, design, code, and testing, which affects reuse efficiency and accuracy.

Method used

We construct an ontology in the field of software engineering, generate unified asset records through multi-source data collection and format parsing, and construct a knowledge graph by combining rules, statistics and semantic confidence calculations and vectorization processing. We adopt a dual-engine retrieval mode to generate cross-entity asset chains, and combine chain templates and comprehensive utility value calculations to achieve intelligent chain-based traceability retrieval.

Benefits of technology

It realizes the transformation from fragment retrieval to chain tracing, significantly reduces the understanding burden during reuse, improves the accuracy and workflow adaptability of software asset reuse, reduces reliance on manual maintenance, and improves the depth and breadth of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115393A_ABST
    Figure CN123115393A_ABST
Patent Text Reader

Abstract

This invention discloses a software asset chain-based traceability retrieval method, system, device, and medium, belonging to the fields of software engineering management and artificial intelligence technology. It solves the problems of isolated asset retrieval methods, broken cross-dimensional connections, insufficient integration of knowledge bases and project management tools, and inadequate utilization of unstructured information in existing traditional software traceability retrieval methods. This invention constructs a software engineering ontology, collects and uniformly records multi-source asset data, identifies entity and relationship confidence levels, and constructs a knowledge graph. It generates entity vectors using a pre-trained model and stores them in a database. Upon receiving a query, it retrieves semantic anchor points and generates candidate chains through multi-hop traversal along relationships. It then calculates utility values ​​based on semantic similarity, traversal cost, relationship confidence, and context, and outputs the results in a sorted order. This invention effectively improves the convenience of reuse and the matching degree between retrieval results and actual work scenarios, and can be applied to software engineering asset chain-based traceability retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of software engineering management and artificial intelligence technology, specifically to a software asset chain-based traceability and retrieval method, system, equipment, and medium. Background Technology

[0002] In the long-term R&D process of software companies, a large number of reusable assets are typically accumulated, including requirement documents, design documents, source code modules, test cases, defect records, commit records, and related technical documents. These assets are often scattered across different management tools, such as requirement management platforms, version control systems, project management tools, test management systems, and document repositories. Although these assets are naturally related in business logic, such as a requirement being implemented by a specific code module, and that specific code module being covered by several test cases, such relationships usually only exist in the developer's experience or are implicitly recorded in unstructured documents, commit instructions, comments, and discussion records, making them difficult for technical systems to automatically identify and utilize.

[0003] The existing software asset retrieval and reuse technologies have the following problems: (1) Isolated retrieval methods. Developers usually obtain code snippets or document paragraphs through keyword retrieval, but it is difficult to trace the original business requirements, design context and supporting tests of the components, resulting in high understanding costs and increased reuse risks; existing keyword retrieval can only return snippets that match the query string, and cannot establish a complete logical link across requirements, design, code and test. (2) Broken relationships. The logical links between requirements, design, code, test, defects and commit records have not been explicitly established in the system, and cross-dimensional automatic tracing is not possible; there is a lack of unified relationship discovery and association maintenance mechanisms among various management tools, resulting in the engineering relationships between software assets existing only in the developer's experience. (3) Insufficient integration. The knowledge base system is separated from the project management tools used in daily development, and users need to switch contexts, interrupting normal work processes, which affects reuse efficiency. (4) Insufficient utilization of unstructured information. A large amount of valuable software engineering knowledge exists in the form of natural language in documents, comments, commit records and discussion records, and traditional keyword retrieval methods are difficult to accurately capture its semantic connotation.

[0004] In recent years, the emergence of Retrieval-Augmented Generation (RAG) technology has provided new possibilities for semantic understanding of unstructured text. However, existing RAG systems focus on returning document fragments related to queries, and their output is usually point-like information, unable to automatically construct engineering logic chains across entities. On the other hand, although knowledge graph technology can express structured relationships between entities, traditional graph construction relies on manual definition and maintenance, making it difficult to cope with the dynamic changes of software assets and the characteristics of distributed storage across tools. Meanwhile, although there has been progress in Graph Retrieval-Augmented Generation (Graph RAG), which combines graphs with retrieval-augmented generation, it is mostly geared towards general domain question answering, multi-document question answering, or knowledge question answering, and still lacks specialized technical solutions for the automatic construction of asset chains such as requirements, design, code, and testing in software engineering asset reuse scenarios and context-embedded retrieval.

[0005] Furthermore, existing software bill of materials, software supply chain provenance, and software composition analysis technologies primarily focus on information such as component lists, dependent materials, build sources, vulnerabilities, and licenses. Their emphasis is on supply chain transparency, security verification, or compliance analysis, but they cannot directly solve the problems of automatically constructing logical chains between requirements, design, code, testing, and project tasks of software engineering assets within an enterprise, discovering semantic anchors, expanding graphs with multiple hops, contextual ordering, and reusable retrieval embedded in project management tools.

[0006] Therefore, there is an urgent need for a method, system, device, and medium that can automatically construct logical chains between software assets and intelligently trace and retrieve software asset chains, so as to improve the accuracy, interpretability, and workflow adaptability of software asset reuse. Summary of the Invention

[0007] A brief overview of the invention is given below to provide a basic understanding of certain aspects of it. It should be understood that this overview is not an exhaustive summary of the invention. It is not intended to identify key or essential parts of the invention, nor is it intended to limit the scope of the invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to the more detailed description that follows.

[0008] In view of this, in order to solve the problems of isolated asset retrieval methods, broken cross-dimensional associations, insufficient integration of knowledge base and project management tools, and insufficient utilization of unstructured information in the traditional software traceability and retrieval methods in the prior art, the present invention provides a software asset chain-based traceability and retrieval method, system, device and medium.

[0009] Technical Solution 1 is as follows: A software asset chain-based traceability and retrieval method, including the following steps:

[0010] S1. Construct a software engineering domain ontology, which includes at least one asset entity type and at least one engineering relation type;

[0011] Specifically: the asset entity types include one or more of the following: business requirements, functional use cases, design components, code modules, test cases, technical documents, defect records, commit records, and project tasks; the engineering relationship types include one or more of the following: described in detail, implemented as, tested and verified, referenced, derived from, dependent on, fixed as, associated with defects, and belonging to iteration.

[0012] S2. Collect software asset data from one or more software engineering data sources, including requirements management system, version control system, project management tool, test management system and document library, and perform format parsing, metadata extraction and structure conversion on the software asset data to obtain a unified asset record;

[0013] S3. Based on the ontology of the software engineering domain, identify asset entities from the unified asset record, generate candidate relationships between asset entities, calculate the relationship confidence for each candidate relationship, and construct a knowledge graph containing the asset entity and its associated edges based on the relationship confidence.

[0014] S4. Input one or more of the text content, code content, metadata and structural information corresponding to each asset entity into the pre-trained language model to obtain entity vectors, and then bind the entity vectors with the unique identifiers of the asset entities in the knowledge graph and store them in the vector database.

[0015] S5. Receive user queries, convert them into query vectors, perform similarity retrieval in the vector database, obtain the Top-K most similar asset entities as the initial semantic anchor set, and perform multi-hop traversal along the preset engineering relationship in the knowledge graph starting from each initial semantic anchor to generate candidate asset chains.

[0016] S6. Based on the aggregate semantic similarity between entities in the candidate asset chain and the user query, the traversal cost of each associated edge in the chain, the relationship confidence of each associated edge in the chain, and the user's current working context, calculate the comprehensive utility value of the candidate asset chain, and output the final result after sorting by utility value.

[0017] Furthermore, step S2 includes the following steps:

[0018] S21. Data source connection and periodic collection: Connect to the enterprise's internal requirements management system, version control system, project management tools, test management system and document library through the adapter interface to collect various assets periodically or through event-triggered collection;

[0019] S22. Format parsing and metadata extraction: Different parsers are used to parse different file formats to obtain parsed asset data. File formats include code files, Markdown documents, JSON configuration files, Word documents, test reports, commit records, defect records, and project task records. For each format, one or more metadata items are extracted from the following: title, unique identifier, version number, commit number, author, creation time, modification time, path, reference number, comment text, and body paragraph.

[0020] S23. Structured Transformation: Convert the parsed asset data into a unified asset record. The unified asset record includes a unique asset identifier, asset type, asset origin, text content, structural information, metadata, and original access address.

[0021] Furthermore, step S3 includes the following steps:

[0022] S31. Based on one or more of the following: asset entity identifier, requirement number, submission information, file path, call dependency, document reference, test case name, defect number, and task number, the explicit association between entities is identified through the hierarchical rule priority engine, and candidate rule-based relationships are generated.

[0023] In S31, the hierarchical rule priority engine divides the matching rules into three priorities according to their accuracy, as follows:

[0024] The first priority is precise identification matching, which includes the requirement number being directly contained in the submission information, the function number being directly contained in the test case name, and the code module being directly associated in the defect record;

[0025] The second priority is structured pattern matching, which includes hierarchical matching of code paths and module names, cross-reference numbers in design documents, and function signature matching in the call dependency chain;

[0026] The third priority is fuzzy heuristic matching, which includes approximate matching based on naming conventions and edit distance matching based on file paths;

[0027] When the same asset entity is identified and matches multiple priority rules, the result of the highest priority rule takes precedence. A priority discount factor ζ is applied to the matching scores of lower priority rules, where 0 < ζ < 1, to obtain the rule decision component. ,in, These are the decreasing weight coefficients for the first, second, and third priorities, respectively. S_p1, S_p2, and S_p3 are the matching scores for the first, second, and third priorities, respectively. υ_t = exp(-ν × Δt) is the time decay factor, Δt is the number of days since the rule matching result was obtained, and ν is the decay rate parameter. For rule matching results that have not exceeded the preset time window, υ_t = 1 is taken. exp represents the natural exponential function, which is an exponential operation with the natural constant e as the base.

[0028] S32. Based on the frequency of co-occurrence, co-occurrence time interval and co-occurrence source credibility of asset entities in multi-granularity co-occurrence scenarios, calculate the weighted statistical co-occurrence strength between entities and generate statistical relation candidates;

[0029] In step S32, the multi-granularity co-occurrence scenarios are arranged from coarse to fine granularity, including five levels: project-level co-occurrence, iteration-level co-occurrence, commit-level co-occurrence, file-level co-occurrence, and function-level co-occurrence. Each level is assigned a different basic weight w_g. A time decay factor exp(-ε × Δt_g) is applied to each co-occurrence event, where Δt_g is the number of days since the current co-occurrence event, and ε is the co-occurrence time decay rate. A credibility coefficient c_s is assigned to each co-occurrence source.

[0030] The co-occurrence strength S_stat of statistical relation candidates is expressed as:

[0031] S_stat = Σ_g Σ_j (w_g × c_s_j × exp(-ε × Δt_g_j)) / N_normalize

[0032] Where g is the co-occurrence granularity level, j is the jth co-occurrence event at the current granularity level, w_g is the basic weight of the gth granularity level, c_s_j is the source credibility coefficient of the jth co-occurrence event, and N_normalize is the normalization coefficient, which is determined by the maximum value of the unnormalized co-occurrence intensity of all entity pairs within the current statistical window, so that the value range of S_stat is normalized to [0,1].

[0033] S33. A heterogeneous embedded spatial architecture is used to vectorize different types of asset entities to obtain the semantic similarity between entity pairs and generate semantic relation candidates.

[0034] In step S33, code-type asset entities are embedded using a code-specific pre-trained language model, which is a model pre-trained on code corpora; document-type asset entities and requirement-type asset entities are embedded using a general pre-trained language model; different embedding spaces are aligned through a shared projection layer, which is a trainable fully connected layer. After mapping the vectors of different embedding spaces to a unified semantic space, the semantic similarity between entity pairs is calculated. When the semantic similarity exceeds a preset semantic threshold, semantic relation candidates are generated; both the code-specific pre-trained language model and the general pre-trained language model are fine-tuned through comparative learning on asset pair data in the software engineering domain, so that the vector distance between entity pairs with engineering-related relationships in the semantic space is less than the vector distance between unrelated entity pairs;

[0035] S34. Based on the rule-based determination of components, co-occurrence strength, and semantic similarity between entity pairs, calculate the relation confidence of each relation candidate;

[0036] In S34, the relationship confidence ξ is expressed as:

[0037] ξ = χ_r × S_rule + χ_s × S_stat + χ_m × S_semantic

[0038] Where χ_r, χ_s, and χ_m are the fusion weights of the rule decision component S_rule, the co-occurrence intensity component S_stat, and the semantic similarity component S_semantic, respectively, satisfying χ_r + χ_s + χ_m = 1;

[0039] S35. When the relation confidence is greater than or equal to the high confidence threshold Θ_high, a corresponding directed relation edge is automatically created in the knowledge graph; when the relation confidence is between the low confidence threshold Θ_low and the high confidence threshold Θ_high, a lightweight manual confirmation process is triggered, and the directed relation edge is created or discarded based on the manual confirmation result; when the relation confidence ξ is lower than the low confidence threshold Θ_low, the current relation candidate is discarded.

[0040] Furthermore, step S5 includes the following steps:

[0041] S51. Convert the user query text into a query vector through a pre-trained language model, perform similarity retrieval in the vector database, and obtain the Top-K entities most similar to the query as the initial semantic anchor set;

[0042] S52. Determine the chain template based on the task type corresponding to the user query;

[0043] In S52, the task types include code reuse tasks, test design tasks, and defect location tasks;

[0044] When the task type is a code reuse task, the chain template prioritizes extending the code module to the paths of design components, functional use cases, business requirements, and test cases; when the task type is a test design task, the chain template prioritizes extending the business requirements to the paths of functional use cases, code modules, and existing test cases; when the task type is a defect localization task, the chain template prioritizes extending the defect record to the paths of code modules, commit records, test cases, and requirement entities.

[0045] S53. Starting from each initial semantic anchor point, perform multi-hop traversal along the engineering relationship direction specified by the chain template. During the traversal, a traversal cost C_R is preset for each relationship type. The total path cost is the sum of the costs of each edge. Based on the maximum number of hops, the whitelist of relationship types, the minimum relationship confidence, the maximum traversal cost, the duplicate entity resolution rules, and the chain template constraints, path pruning is performed to eliminate redundant paths and low-confidence paths, generating a set of candidate asset chains.

[0046] Furthermore, step S6 includes the following steps:

[0047] S61. The semantic similarity between each entity in the candidate asset chain L and the user query is aggregated using a position-sensitive weighting method to obtain the chain aggregate semantic similarity.

[0048] In S61, the position-sensitive weighting method means that entities closer to the initial semantic anchor point in the chain contribute more to the aggregation score, while the contribution of entities farther away decays exponentially.

[0049] Chain aggregation semantic similarity AggSim(L) is represented as:

[0050] AggSim(L) = Σ_i (w_i × sim(e_i, q)) / Σ_i w_i

[0051] Where e_i is the i-th entity in chain L, q is the user query, sim(e_i, q) is the semantic similarity between the entity and the query, w_i = exp(-ω × d_i) is the position-sensitive weight, d_i is the shortest number of hops from the initial semantic anchor point of entity e_i in the chain, and ω is the position decay rate parameter.

[0052] S62. Decompose the chain confidence into two dimensions: edge confidence aggregation and chain integrity, and calculate the chain composite confidence.

[0053] In S62, the chain composite confidence level Conf(L) is represented as:

[0054] Conf(L) = φ × ConfEdge(L) + (1 - φ) × Comp(L)

[0055] Where ConfEdge(L) is the aggregated value of the confidence of each associated edge in chain L, using the minimum aggregation strategy, i.e., ConfEdge(L) = min(ξ_1, ξ_2, ..., ξ_m); Comp(L) is the chain completeness, which is defined as the ratio of the number of engineering dimensions covered by chain L to the preset target number of dimensions. Engineering dimensions include four categories: requirement dimension, design dimension, code dimension, and test dimension. When the chain contains requirement entity, design entity, code entity, and test entity simultaneously, Comp(L) = 1. When any dimension is missing, Comp(L) decreases proportionally according to the number of missing dimensions. φ is the balancing weight between edge confidence and completeness.

[0056] S63. Calculate the comprehensive utility value of the candidate asset chain based on the chain aggregation semantic similarity and chain composite confidence.

[0057] In S63, the comprehensive utility value U(L) of the candidate asset chain L is expressed as:

[0058] U(L) = η × [ψ × AggSim(L) + (1 - ψ) × exp(-λ × TotalCost(L))] +(1 - η) × Conf(L)

[0059] Where TotalCost(L) is the sum of the traversal costs of each associated edge in chain L, η is the balance weight between semantic relevance and chain credibility, ψ is the inner balance weight between chain aggregate semantic similarity AggSim(L) and cost penalty term exp(-λ × TotalCost(L)), and λ is the cost decay parameter.

[0060] S64. Perform multi-dimensional context adaptive sorting, encode the user's current work context into a multi-dimensional context feature vector x_ctx = [x_1, x_2, ..., x_D], where each dimension corresponds to the current task type encoding, the association test coverage of entities in chain L, the historical defect density of entities in chain L, the similarity between the current project and the source project of the chain, the current iteration stage encoding, the user role encoding, and the number of days between the most recent submission time in chain L and the current time. D is the number of dimensions of the context feature vector x_ctx. Through the pre-trained context scoring model, calculate the context gain factor Δ_context = σ(θ_ctx · x_ctx + b_ctx), where θ_ctx is a trainable weight vector, b_ctx is a bias term, and σ is the Sigmoid activation function. The context scoring model is obtained through supervised training on historical user click and reuse behavior data. Adjust the final utility value to U_final(L) = U(L) × (1 + Δ_context).

[0061] S65. Sort the candidate asset chains in descending order according to the final utility value U_final(L), take the top N chains as the final result, and output the sorted software asset chains and their corresponding asset entry points, relationship descriptions and reuse prompts to the user;

[0062] In S65, the reuse prompt information includes one or more of the following: chain source project, key code module, corresponding design document chapter, related business requirements, number of existing test cases, test coverage, number of historical defects, relationship confidence, and chain integrity. The final result is embedded in the user interface of the project management tool in the form of a card, and users can directly click the link to view the original content of any asset.

[0063] Technical Solution 2 is as follows: A software asset chain-based traceability and retrieval system, characterized in that it is used to execute the software asset chain-based traceability and retrieval method described in Technical Solution 1, including a multi-source asset acquisition and parsing module, a domain knowledge graph construction and vectorization joint processing module, a dual-engine driven retrieval engine module, and a project management tool integration adapter module connected in sequence.

[0064] Technical solution three is as follows: An electronic device, including a memory and a processor; wherein, the memory is used to store a program; the processor is used to execute the program, and when the program is executed, it is specifically used to implement the software asset chain-based tracing and retrieval method as described in technical solution one.

[0065] Technical solution four is as follows: A computer storage medium for storing computer programs, which, when executed, are used to implement the software asset chain-based tracing and retrieval method as described in technical solution one.

[0066] The beneficial effects of this invention are as follows: This invention realizes the transformation from fragment retrieval to chain tracing. The returned asset chain contains a complete context from business requirements to design, code and test verification, which significantly reduces the understanding burden during reuse and enables developers to quickly obtain complete engineering background information when reusing historical assets.

[0067] This invention achieves automated construction and incremental updates of knowledge graphs by integrating rule-based, statistical, and semantic confidence calculations. A two-level threshold mechanism ensures graph quality while pursuing automation, reducing reliance on manual maintenance and improving the accuracy of relationships. Compared to traditional methods of manually defining and maintaining knowledge graphs, this invention can adapt to the dynamic changes in software assets.

[0068] Furthermore, this invention employs a dual-engine retrieval mode that combines semantic anchor discovery and graph association expansion, balancing the flexibility of semantic matching with the determinism of structured association. Semantic anchors solve the problem that traditional keyword retrieval cannot capture semantic connotations, while graph multi-hop expansion solves the problem that traditional RAG systems only return point-like information. The combination of the two makes the retrieval results superior to traditional methods in terms of depth, breadth, and interpretability.

[0069] At the engineering application level, this invention embeds intelligent retrieval capabilities into the development workflow through project management tools, and dynamically adjusts the chain order based on context such as current task type, test coverage, and historical defect density, avoiding users switching between multiple systems, improving the convenience of reuse and the matching degree between retrieval results and actual work scenarios.

[0070] This invention also effectively controls the path explosion problem in multi-hop traversal by combining chain templates, path pruning, and comprehensive utility value calculation, filtering out low-reliability and redundant links, and improving the reusability value of the returned results.

[0071] Furthermore, comparative experiments were conducted to verify the effectiveness of the various innovative mechanisms of this invention, as follows:

[0072] The experiment was conducted on a server with 64GB of memory. The dataset originated from engineering data accumulated over the past three years by a mid-sized software company. After anonymization, it contained approximately 12,000 software asset entities, including about 3,200 requirement entities, 2,800 design entities, 4,000 code entities, and 2,000 test entities. Using 200 real-world reuse queries annotated by senior engineers as the test set, the proposed solution was compared with the following four baseline solutions.

[0073] Baseline A is a pure vector retrieval scheme that uses only Sentence-BERT for semantic similarity retrieval and does not perform graph expansion.

[0074] Baseline B is a traditional knowledge graph scheme that uses manually defined rules to construct the knowledge graph, performs only graph traversal retrieval, and does not use semantic anchors.

[0075] Baseline C is a general Graph RAG scheme that uses semantic similarity retrieval plus multi-hop graph expansion, but it uses simple average to aggregate semantic similarity and geometric average to aggregate chain confidence, without including position-sensitive weighting, chain integrity calculation and multi-dimensional context scoring.

[0076] Baseline D is a software traceability link recovery scheme that uses information retrieval methods to recover the traceability link between requirements and code, without constructing cross-dimensional chains.

[0077] Evaluation metrics include: Top-3 accuracy (the percentage of correct assets contained in the top 3 return chains), chain completeness (the average percentage of return chains covering four dimensions: requirements, design, code, and testing), human evaluation satisfaction (ratings of return chain reusability by 10 senior developers on a 5-point scale), and average retrieval time.

[0078] The experimental results are as follows: The Top-3 accuracy of the proposed solution is 86.7%, the chain integrity is 91.3%, the human evaluation satisfaction score is 4.2 (standard deviation 0.3), and the average retrieval time is 335 milliseconds. Baseline A has a Top-3 accuracy of 61.3%, a chain integrity of 34.7%, a human evaluation satisfaction score of 2.7, and an average retrieval time of 82 milliseconds. Baseline B has a Top-3 accuracy of 58.5%, a chain integrity of 77.3%, a human evaluation satisfaction score of 3.1, and an average retrieval time of 146 milliseconds. Baseline C has a Top-3 accuracy of 75.3%, a chain integrity of 70.7%, a human evaluation satisfaction score of 3.5, and an average retrieval time of 287 milliseconds. Baseline D has a Top-3 accuracy of 54.7%, a chain integrity of 41.3%, a human evaluation satisfaction score of 2.5, and an average retrieval time of 118 milliseconds.

[0079] Further analysis of the contributions of each innovative mechanism reveals the following: Compared to baseline C, the introduction of position-sensitive aggregation (S61) improves Top-3 accuracy by approximately 4 percentage points because entities far from the anchor point but with significant semantic noise are effectively suppressed; the introduction of chain integrity (S62) improves chain integrity by approximately 11 percentage points because the system prioritizes returning chains covering all dimensions; the introduction of multi-dimensional context scoring (S64) improves human evaluation satisfaction by 0.7 points because the ranking results are more relevant to the current work scenario; the introduction of a hierarchical rule priority engine (S31) improves the accuracy of knowledge graph construction by approximately 6 percentage points because rule conflicts and time decay mechanisms reduce the creation of erroneous edges; and the introduction of a heterogeneous embedding space architecture (S33) improves the accuracy of cross-type entity semantic matching by approximately 8 percentage points because code and documents are modeled and aligned in different embedding spaces, avoiding the inadequacy of a single model to express heterogeneous content.

[0080] The experimental results above show that the combination of the innovative mechanisms of the present invention produces a significant improvement in technical effect, and there is a synergistic gain effect among the mechanisms, which verifies the good effect of the present invention. Attached Figure Description

[0081] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0082] Figure 1 This is a flowchart illustrating the chain-based tracing and retrieval method for software assets.

[0083] Figure 2 This is a schematic diagram illustrating the semantic anchor point expansion in a chain-like retrieval process.

[0084] Figure 3 A schematic diagram of the workflow for knowledge graph construction and vectorization.

[0085] Figure 4 This is a schematic diagram of the structure of a software asset chain-based traceability and retrieval system.

[0086] Figure descriptions: 1. Multi-source asset acquisition and parsing module; 2. Domain knowledge graph construction and vectorization joint processing module; 3. Dual-engine driven retrieval engine module; 4. Project management tool integration adapter module. Detailed Implementation

[0087] To make the technical solutions and advantages of the embodiments of the present invention clearer, the exemplary embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0088] Example 1: Reference Figures 1-3 This embodiment describes a software asset chain-based tracing and retrieval method, which specifically includes the following steps:

[0089] S1. Construct a software engineering domain ontology, which includes at least one asset entity type and at least one engineering relation type;

[0090] Specifically: the asset entity types include one or more of the following: business requirements, functional use cases, design components, code modules, test cases, technical documents, defect records, commit records, and project tasks. The engineering relationship types include: described in detail (between design components and functional use cases), implemented as (between design components and code modules, and between functional use cases and code modules), tested and verified (between test cases and code modules), referenced (between documents and code modules), derived from (between functional use cases and requirements), dependent on (between code modules), fixed in (between defects and commit records), associated with defects (between defects and code modules), and belong to iteration (between each asset entity and the iteration cycle). Through the domain ontology definition, the system provides structured type constraints and semantic frameworks for subsequent entity identification and relationship discovery.

[0091] S2. Collect multi-source software asset data from one or more software engineering data sources, such as requirements management system, version control system, project management tools, test management system, and document library, and perform format parsing, metadata extraction, and structure transformation to obtain a unified asset record;

[0092] S3. Based on the ontology of the software engineering domain, identify asset entities from the unified asset record, generate candidate relationships between asset entities, calculate the relationship confidence for each candidate relationship, and construct a knowledge graph containing the asset entity and its associated edges based on the relationship confidence.

[0093] S4. Input one or more of the text content, code content, metadata and structural information corresponding to each asset entity into the pre-trained language model to obtain entity vectors, and bind the entity vectors with the unique identifiers of the asset entities in the knowledge graph and store them in the vector database; thus, the vector retrieval results no longer correspond only to isolated text fragments, but can be traced back to specific asset entities in the knowledge graph, providing an entry point for subsequent chain expansion;

[0094] S5. Receive user queries, convert them into query vectors, perform similarity retrieval in the vector database, obtain the Top-K most similar asset entities as the initial semantic anchor set, and perform multi-hop traversal along the preset engineering relationship in the knowledge graph starting from each initial semantic anchor to generate candidate asset chains.

[0095] S6. Based on the aggregate semantic similarity between entities in the candidate asset chain and the user query, the traversal cost of each associated edge in the chain, the relationship confidence of each associated edge in the chain, and the user's current working context, calculate the comprehensive utility value of the candidate asset chain, and output the final result after sorting by utility value.

[0096] Specifically, the combination of modules in the above technical solution is not a simple superposition of existing technologies, but a collaborative technical system formed to address the specific problem of chain-like tracing and retrieval of software engineering assets. The non-obviousness of its combination and the synergistic effect are reflected in the following aspects:

[0097] First, the invention couples semantic anchor discovery with multi-hop knowledge graph expansion into a dual-engine approach. Existing RAG (Research and Acquisition) technology, centered on vector retrieval, outputs point-like document fragments and cannot automatically construct logical chains across entities. While existing knowledge graph traversal technologies possess structured path search capabilities, they lack a semantically driven entry point localization mechanism. This invention binds vector retrieval results to semantic anchor entities within the knowledge graph, enabling graph traversal to start from the most semantically relevant nodes rather than blindly searching. Simultaneously, multi-hop knowledge graph expansion compensates for the deficiency of vector retrieval, which only returns isolated fragments. The two form a closed loop of semantic localization → structural expansion → chain scoring, a design not previously reported in existing RAG and knowledge graph technologies.

[0098] Second, the synergy between three-way confidence fusion and a two-level threshold mechanism. Using rule matching, statistical co-occurrence, or semantic similarity alone cannot balance accuracy and coverage: rule matching is accurate but has narrow coverage, statistical co-occurrence has broad coverage but high noise, and semantic matching is flexible but has limited effectiveness on code-based assets. This invention fuses the three signals into a unified confidence level and achieves a balance between automation and quality assurance in graph construction through two-level thresholds (automatic creation / manual verification / discarding). This fusion mechanism allows high-confidence rule-based relationships to be automatically added to the database, medium-confidence semantic and statistical relationships to be supplemented through lightweight manual verification, and low-confidence relationships to be automatically filtered out, thus achieving incremental graph construction without relying on full manual annotation.

[0099] Third, joint optimization of heterogeneous embedding space and position-sensitive chain scoring. Software engineering assets contain two fundamentally different types of content: code and natural language documents. A single embedding model cannot model them simultaneously. This invention uses a heterogeneous embedding space to model code and documents separately, and then unifies the semantic space through an alignment layer, making the semantic similarity between cross-type entities comparable. On this basis, the position-sensitive chain scoring mechanism applies decreasing weights based on the distance of each entity in the chain from the initial anchor point, effectively suppressing semantic noise introduced by multi-hop expansion. This ensures that the final returned chain not only covers the complete engineering dimensions across types but also maintains semantic relevance to the user's query.

[0100] In step S4, entity vectorization and joint indexing: The system uses a pre-trained language model to convert the text content, code content, metadata, and structural information of each asset entity into entity vectors with a dimension of 768. Specifically, code-type asset entities are vectorized using the CodeBERT model, while document-type and requirement-type asset entities are vectorized using the Sentence-BERT model, consistent with the heterogeneous embedding space architecture in step S33. Each entity vector is bound to a unique identifier of the asset entity in the knowledge graph and stored in a vector database (Milvus in this embodiment). This binding mechanism ensures that vector retrieval results can directly trace back to specific asset entity nodes in the knowledge graph, providing an entry point for subsequent multi-hop expansion.

[0101] Furthermore, step S2 includes the following steps:

[0102] S21. Data source connection and periodic collection: Connect to the enterprise's internal requirements management system (such as ZenTao), version control system (such as GitLab, GitHub), project management tools, test management system (test case library) and document library through adapter interfaces to periodically collect various assets or collect data based on Webhook event triggering.

[0103] S22. Format parsing and metadata extraction: Different parsers are used to parse different file formats to obtain parsed asset data. File formats include code files, Markdown documents, JSON configuration files, Word documents, test reports, commit records, defect records, and project task records. For each format, one or more metadata items are extracted from the following: title, unique identifier, version number, commit number, author, creation time, modification time, path, reference number, comment text, and body paragraph.

[0104] S23. Structured Transformation: Convert the parsed asset data into a unified asset record. The unified asset record includes a unique asset identifier, asset type, asset origin, text content, structural information, metadata, and original access address.

[0105] Furthermore, step S3 includes the following steps:

[0106] S31. Based on one or more of the following: asset entity identifier, requirement number, submission information, file path, call dependency, document reference, test case name, defect number, and task number, the explicit association between entities is identified through the hierarchical rule priority engine, and candidate rule-based relationships are generated.

[0107] In S31, the hierarchical rule priority engine divides the matching rules into three priorities according to their accuracy, as follows:

[0108] The first priority is precise identification matching, which includes the requirement number being directly contained in the submission information, the function number being directly contained in the test case name, and the code module being directly associated in the defect record;

[0109] The second priority is structured pattern matching, which includes hierarchical matching of code paths and module names, cross-reference numbers in design documents, and function signature matching in the call dependency chain;

[0110] The third priority is fuzzy heuristic matching, which includes approximate matching based on naming conventions and edit distance matching based on file paths;

[0111] When the same asset entity is identified and matches multiple priority rules, the result of the highest priority rule takes precedence. A priority discount factor ζ is applied to the matching scores of lower priority rules, where 0 < ζ < 1, to obtain the rule decision component. ,in, These are the decreasing weight coefficients for the first, second, and third priorities, respectively. S_p1, S_p2, and S_p3 are the matching scores for the first, second, and third priorities, respectively. υ_t = exp(-ν × Δt) is the time decay factor, Δt is the number of days since the rule matching result was obtained, and ν is the decay rate parameter. For rule matching results that have not exceeded the preset time window, υ_t = 1 is taken. exp represents the natural exponential function, which is an exponential operation with the natural constant e as the base.

[0112] S32. Based on the frequency of co-occurrence, co-occurrence time interval and co-occurrence source credibility of asset entities in multi-granularity co-occurrence scenarios, calculate the weighted statistical co-occurrence strength between entities and generate statistical relation candidates;

[0113] In S32, the multi-granularity co-occurrence scenarios are arranged from coarse to fine granularity, including five levels: project-level co-occurrence, iteration-level co-occurrence, commit-level co-occurrence, file-level co-occurrence, and function-level co-occurrence. Each level is assigned a different basic weight w_g. A time decay factor exp(-ε × Δt_g) is applied to each co-occurrence event, where Δt_g is the number of days since the current co-occurrence event, and ε is the co-occurrence time decay rate. A credibility coefficient c_s is assigned to each co-occurrence source, and the credibility of co-occurrence from direct commit records is higher than that from co-occurrence in the same iteration, and the credibility of co-occurrence in the same iteration is higher than that from co-occurrence in the same project.

[0114] The co-occurrence strength S_stat of statistical relation candidates is expressed as:

[0115] S_stat = Σ_g Σ_j (w_g × c_s_j × exp(-ε × Δt_g_j)) / N_normalize

[0116] Where g is the co-occurrence granularity level, j is the jth co-occurrence event at the current granularity level, w_g is the basic weight of the gth granularity level, c_s_j is the source credibility coefficient of the jth co-occurrence event, and N_normalize is the normalization coefficient, which is determined by the maximum value of the unnormalized co-occurrence intensity of all entity pairs within the current statistical window, so that the value range of S_stat is normalized to [0,1].

[0117] S33. A heterogeneous embedded spatial architecture is used to vectorize different types of asset entities to obtain the semantic similarity between entity pairs and generate semantic relation candidates.

[0118] In step S33, code-type asset entities are embedded using a code-specific pre-trained language model, which is a model pre-trained on code corpus and can simultaneously understand code syntax structure and natural language annotation semantics. Document-type asset entities and requirement-type asset entities are embedded using a general pre-trained language model. Different embedding spaces are aligned through a shared projection layer, which is a trainable fully connected layer. After mapping the vectors of different embedding spaces to a unified semantic space, the semantic similarity between entity pairs is calculated. When the semantic similarity exceeds a preset semantic threshold, a semantic relation candidate is generated. Both the code-specific pre-trained language model and the general pre-trained language model are fine-tuned through comparative learning on asset pair data in the software engineering domain, so that the vector distance between entity pairs with engineering-related relationships in the semantic space is less than the vector distance between unrelated entity pairs.

[0119] S34. Based on the rule-based determination of components, co-occurrence strength, and semantic similarity between entity pairs, calculate the relation confidence of each relation candidate;

[0120] In S34, the relationship confidence ξ is expressed as:

[0121] ξ = χ_r × S_rule + χ_s × S_stat + χ_m × S_semantic

[0122] Where S_rule is the rule decision component, with a value range of [0,1], calculated by the hierarchical rule priority engine, and adopts... The mechanism combines priority weighting and time decay, where the time decay factor υ_t = exp(-ν × Δt) is applied as a multiplicative factor to the priority weighting result. For rule matching results that do not exceed the preset time window, υ_t = 1. S_stat is a component based on co-occurrence statistics, with a value range of [0,1]. It is calculated by the multi-granularity weighted time decay co-occurrence strength formula, covering five co-occurrence granularity levels: project level, iteration level, submission level, file level, and function level. S_semantic is a semantic similarity component, with a value range of [0,1]. It is obtained by vectorizing the code-specific embedding model and the general embedding model in the heterogeneous embedding space architecture, aligning them to a unified semantic space through a shared projection layer, and then calculating the cosine similarity. χ_r, χ_s, and χ_m are the fusion weights of the rule decision component S_rule, the co-occurrence strength component S_stat, and the semantic similarity component S_semantic, respectively, satisfying χ_r + χ_s + χ_m = 1.

[0123] S35. When the relation confidence is greater than or equal to the high confidence threshold Θ_high, a corresponding directed relation edge is automatically created in the knowledge graph; when the relation confidence is between the low confidence threshold Θ_low and the high confidence threshold Θ_high, a lightweight manual confirmation process is triggered, and the directed relation edge is created or discarded based on the manual confirmation result; when the relation confidence ξ is lower than the low confidence threshold Θ_low, the current relation candidate is discarded.

[0124] For details, please refer to Figure 3The rule matching mechanism employs a hierarchical rule priority engine. The first priority is precise identifier matching, checking whether the submitted information contains a requirement number (e.g., [REQ-001]), whether the test case name contains a function number (e.g., TC_FUNC_003), and whether the defect record directly relates to a code module; the matching score is 1.0. The second priority is structured pattern matching, checking the hierarchical matching of code paths and module names, cross-reference numbers in design documents, and function signature matching in the call dependency chain; the matching score ranges from 0.6 to 0.9 depending on the matching precision. The third priority is fuzzy heuristic matching, including approximate matching based on naming conventions and edit distance matching based on file paths; the matching score ranges from 0.3 to 0.6. When the same entity matches multiple priorities, the priority is taken. In this embodiment, ζ = 0.7, and a time decay factor υ_t = exp(-0.005 × Δt) is applied to rule matching results that exceed 90 days, while υ_t = 1 is taken for rule matching results that do not exceed the 90-day time window;

[0125] The co-occurrence statistical mechanism employs a multi-granularity weighted time decay model; the basic weights for the five granularity levels are: project level w_1 = 0.1, iteration level w_2 = 0.2, commit level w_3 = 0.3, file level w_4 = 0.25, and function level w_5 = 0.15. The co-occurrence source credibility coefficients are: direct commit records c_s = 1.0, same iteration c_s = 0.8, and same project c_s = 0.5. The co-occurrence time decay rate ε = 0.003.

[0126] The semantic proximity mechanism employs a heterogeneous embedding space architecture. Code-type entities are embedded using the CodeBERT model with 768 dimensions; document-type and requirement-type entities are embedded using the Sentence-BERT model with 768 dimensions. The two embedding spaces are aligned using a trainable fully connected layer (256 hidden dimensions, ReLU activation function), and the alignment training uses a bidirectional projection loss function. P_code and P_doc are the projection matrices from the code space and document space to the unified semantic space, respectively. During training, positive samples are sampled from known code-document association pairs (such as the code module corresponding to the requirement number referenced in the submission information), and negative samples are sampled from irrelevant entity pairs. The Adam optimizer (learning rate 1×10^6) is used. -4The model was trained for 50 epochs until convergence. Both base models were fine-tuned through comparative learning on asset pair data in the software engineering domain. Positive samples were entity pairs with known engineering relationships, while negative samples were randomly sampled unrelated entity pairs (positive to negative sample ratio of 1:4). The InfoNCE loss function (temperature parameter τ=0.07) was used for training. Semantic relation candidates were generated when the aligned semantic similarity exceeded a threshold of 0.75.

[0127] In this embodiment, χ_r = 0.5, χ_s = 0.3, χ_m = 0.2, high confidence threshold Θ_high = 0.85, and low confidence threshold Θ_low = 0.60 are set. The two thresholds are determined as follows: a confidence distribution histogram is plotted on a validation set containing 500 manually labeled relationships. The 5th percentile of correct relationships is set as Θ_high (ensuring that over 95% of correct relationships are automatically added to the database), and the 95th percentile of incorrect relationships is set as Θ_low (ensuring that over 95% of incorrect relationships are automatically filtered out). The gray area between the two is left for manual confirmation. When ξ ≥ 0.85, the system automatically creates directed association edges in the knowledge graph; when 0.60 ≤ ξ < 0.85, the system pushes the candidate relationship to the manual confirmation queue; when ξ < 0.60, the system discards the candidate. The two-level threshold mechanism enables the automatic creation of relationships with clear rules (such as those where the submission information directly includes the requirement number), while fuzzy relationships are guaranteed in terms of map quality through lightweight manual confirmation.

[0128] Furthermore, step S5 includes the following steps:

[0129] S51. Convert the user query text into a query vector through a pre-trained language model, perform similarity retrieval in the vector database, and obtain the Top-K entities most similar to the query as the initial semantic anchor set;

[0130] S52. Determine the chain template based on the task type corresponding to the user query;

[0131] In S52, the task types include code reuse tasks, test design tasks, and defect location tasks;

[0132] When the task type is a code reuse task, the chain template prioritizes extending the code module to the paths of design components, functional use cases, business requirements, and test cases; when the task type is a test design task, the chain template prioritizes extending the business requirements to the paths of functional use cases, code modules, and existing test cases; when the task type is a defect localization task, the chain template prioritizes extending the defect record to the paths of code modules, commit records, test cases, and requirement entities.

[0133] S53. Starting from each initial semantic anchor point, perform multi-hop traversal along the engineering relationship direction specified by the chain template. During the traversal, a traversal cost C_R is preset for each relationship type. The total path cost is the sum of the costs of each edge. Based on the maximum number of hops, the whitelist of relationship types, the minimum relationship confidence, the maximum traversal cost, the duplicate entity resolution rules, and the chain template constraints, path pruning is performed to eliminate redundant paths and low-confidence paths, generating a set of candidate asset chains.

[0134] Specifically, semantic anchor discovery and multi-hop chain expansion: When a user inputs query text, the system first converts the query into a 768-dimensional query vector and retrieves the Top-K (K = 5 in this embodiment) most similar asset entities from the vector database as the initial semantic anchor set. Subsequently, the system determines the chain template based on the task type corresponding to the user query: If the current task is a code reuse task, the path of code module → design component → functional use case → business requirements and code module → test case → test report is expanded first; if it is a test design task, the path of business requirements → functional use case → code module → test case is expanded first; if it is a defect localization task, the path of defect record → code module → submission record → test case is expanded first.

[0135] During multi-hop traversal, the system presets a traversal cost C_R for each relation type. In this embodiment, the cost is set to 0.5 for relation type, 0.8 for test and verification relation type, 1.0 for reference relation type, and 0.3 for derived relation type. The traversal costs for other relation types are as follows: 0.4 for detailed description relation type, 0.5 for dependency relation type, 0.4 for repair relation type, 0.7 for associated defect relation type, and 0.2 for iterative relation type. The design principle for the traversal cost of each relation type is: the closer the engineering semantics of the relation type, the lower the cost; the looser the relation type, the higher the cost, to guide multi-hop traversal to prioritize expansion along strongly associated paths. Path pruning is performed based on the maximum number of hops (set to 4 hops in this embodiment), the relation type whitelist, the minimum relation confidence (set to 0.65 in this embodiment), the maximum traversal cost, and the duplicate entity resolution rule, eliminating redundant and low-confidence paths.

[0136] Furthermore, step S6 includes the following steps:

[0137] S61. The semantic similarity between each entity in the candidate asset chain L and the user query is aggregated using a position-sensitive weighting method to obtain the chain aggregate semantic similarity.

[0138] In S61, the position-sensitive weighting method means that entities closer to the initial semantic anchor point in the chain contribute more to the aggregation score, while the contribution of entities farther away decays exponentially.

[0139] Chain aggregation semantic similarity AggSim(L) is represented as:

[0140] AggSim(L) = Σ_i (w_i × sim(e_i, q)) / Σ_i w_i

[0141] Where e_i is the i-th entity in chain L, q is the user query, sim(e_i, q) is the semantic similarity between the entity and the query, w_i = exp(-ω × d_i) is the position-sensitive weight, d_i is the shortest number of hops from the initial semantic anchor point of entity e_i in the chain, and ω is the position decay rate parameter.

[0142] S62. Decompose the chain confidence into two dimensions: edge confidence aggregation and chain integrity, and calculate the chain composite confidence.

[0143] In S62, the chain composite confidence level Conf(L) is represented as:

[0144] Conf(L) = φ × ConfEdge(L) + (1 - φ) × Comp(L)

[0145] Where ConfEdge(L) is the aggregated value of the confidence of each associated edge in chain L, and the minimum value aggregation strategy is adopted, that is, ConfEdge(L) = min(ξ_1, ξ_2, ..., ξ_m), to reduce the impact of any low confidence edge in the chain on the overall credibility; Comp(L) is the chain completeness, which is defined as the ratio of the number of engineering dimensions covered by chain L to the number of preset target dimensions. Engineering dimensions include four categories: requirement dimension, design dimension, code dimension and test dimension. When the chain contains requirement entity, design entity, code entity and test entity at the same time, Comp(L) = 1. When any dimension is missing, Comp(L) decreases proportionally according to the number of missing dimensions. φ is the balancing weight between edge confidence and completeness.

[0146] S63. Calculate the comprehensive utility value of the candidate asset chain based on the chain aggregation semantic similarity and chain composite confidence.

[0147] In S63, the comprehensive utility value U(L) of the candidate asset chain L is expressed as:

[0148] U(L) = η × [ψ × AggSim(L) + (1 - ψ) × exp(-λ × TotalCost(L))] +(1 - η) × Conf(L)

[0149] Where AggSim(L) is the position-sensitive weighted aggregate semantic similarity between the entity and the query in chain L, with the entity closer to the anchor point contributing more; TotalCost(L) is the sum of the traversal costs of each associated edge in chain L; Conf(L) is the composite confidence of chain L, which combines the minimum edge confidence aggregation and chain completeness; η is the balance weight between semantic relevance and chain confidence; ψ is the inner balance weight between the chain aggregate semantic similarity AggSim(L) and the cost penalty term exp(-λ × TotalCost(L)); and λ is the cost decay parameter, which controls the exponential decay strength of the total path cost on the utility value.

[0150] In this embodiment, η = 0.6, ψ = 0.5, and λ = 0.5 are selected. AggSim(L) is calculated using a position-sensitive weighting method with a position decay rate ω = 0.3. That is, the weight of an entity 1 hop from the anchor point is exp(-0.3) ≈ 0.74, the weight of 2 hops is exp(-0.6) ≈ 0.55, and the weight of 3 hops is exp(-0.9) ≈ 0.41, so that entities closer to the semantic anchor point in the chain contribute more to the final score. Conf(L) is calculated using composite confidence with φ = 0.6. ConfEdge(L) uses the minimum confidence of each side relationship. Comp(L) is calculated based on the four engineering dimensions of requirements, design, code, and testing covered by the chain, and then the utility value is adjusted through a multi-dimensional context scoring model.

[0151] S64. Perform multi-dimensional context adaptive sorting, encode the user's current work context into a multi-dimensional context feature vector x_ctx = [x_1, x_2, ..., x_D], where each dimension corresponds to the current task type encoding, the association test coverage of entities in chain L, the historical defect density of entities in chain L, the similarity between the current project and the source project of the chain, the current iteration stage encoding, the user role encoding, and the number of days between the most recent submission time in chain L and the current time. D is the number of dimensions of the context feature vector x_ctx. Through the pre-trained context scoring model, calculate the context gain factor Δ_context = σ(θ_ctx · x_ctx + b_ctx), where θ_ctx is a trainable weight vector, b_ctx is a bias term, and σ is the Sigmoid activation function. The context scoring model is obtained through supervised training on historical user click and reuse behavior data. Adjust the final utility value to U_final(L) = U(L) × (1 + Δ_context).

[0152] The context feature vector x_ctx contains 7 dimensions: current task type encoding (code reuse=1, test design=2, defect localization=3), chain-related test coverage, historical defect density, code similarity between the current project and the chain source project, current iteration stage encoding (planning=1, development=2, testing=3, release=4), user role encoding (development=1, testing=2, architecture=3), and the number of days since the most recent chain submission. The weight vector θ_ctx of the context scoring model is obtained by training logistic regression on historical user clicks and reuse behavior data. The specific training method is as follows: collect users' clicks on search results and actual reuse behavior in the past 6 months (using whether the user introduces the code or document in the chain into the current task as a positive sample label), take the 7-dimensional context feature vector as input and the binary label of reuse behavior as output, and use L2 regularized logistic regression (regularization coefficient C=1.0) for training. The training set and test set are divided in an 8:2 ratio. The model is considered to have converged when the 5-fold cross-validation AUC reaches 0.82 or above. The system sorts the results in descending order by U_final(L), and takes the first N results (N = 3 in this embodiment) as the final result;

[0153] S65. Sort the candidate asset chains in descending order according to the final utility value U_final(L), take the top N chains as the final result, and output the sorted software asset chains and their corresponding asset entry points, relationship descriptions and reuse prompts to the user;

[0154] In S65, the reuse prompt information includes one or more of the following: chain source project, key code module, corresponding design document chapter, related business requirements, number of existing test cases, test coverage, number of historical defects, relationship confidence, and chain integrity. The final result is embedded in the user interface of the project management tool in the form of a card, and users can directly click the link to view the original content of any asset.

[0155] Example 2: Software asset chain-based tracing and retrieval system, used to execute the software asset chain-based tracing and retrieval method described in Example 1, including a multi-source asset acquisition and parsing module 1, a domain knowledge graph construction and vectorization joint processing module 2, a dual-engine driven retrieval engine module 3, and a project management tool integration adapter module 4 connected in sequence;

[0156] The multi-source asset acquisition and parsing module 1 is used to execute step S2, which involves acquiring software asset data from multiple software engineering data sources and converting the software asset data into a unified asset record.

[0157] Domain knowledge graph construction and vectorization joint processing module 2 is used to execute steps S1, S3 and S4, including a software engineering domain ontology subunit, an automated graph construction subunit and a joint vectorization index subunit. It is used to identify asset entities based on the software engineering domain ontology, generate relation candidates, calculate relation confidence, construct a knowledge graph, and generate vector indexes bound to asset entities. The automated graph construction subunit adopts a two-level confidence threshold mechanism, automatically creating graph edges for high-confidence relations, triggering manual confirmation for intermediate-confidence relations, and automatically discarding low-confidence relations.

[0158] The dual-engine driven retrieval engine module 3 is used to execute steps S5 and S6, perform vector retrieval based on user queries to determine initial semantic anchors, and perform multi-hop expansion, chain scoring, and chain sorting based on the knowledge graph; the dual-engine driven retrieval engine module determines the chain template according to the task type during the retrieval process, and controls the quality of multi-hop traversal based on traversal cost, relationship confidence, and path pruning rules.

[0159] The project management tool integration adapter module 4 is used to interface with the project management tool, obtain the user's current work context, and return the sorted software asset chain to the user interface of the project management tool. The work context includes the current task type, associated test coverage, historical defect density, project, iteration stage, and user role. The project management tool integration adapter module 4 and the dual-engine driven retrieval engine module 3 have a bidirectional data connection: the project management tool integration adapter module 4 feeds back the obtained user's current work context to the dual-engine driven retrieval engine module 3 for multi-dimensional context adaptive sorting; the dual-engine driven retrieval engine module 3 outputs the sorted software asset chain to the project management tool integration adapter module 4, which then returns it to the user interface of the project management tool.

[0160] For details, please refer to Figure 2This implementation describes a specific application scenario: Developers input a query for retry strategies after payment failure via a plugin in the task panel of the ZenTao project management tool. The system background executes step S5, a retrieval process, matching the payment retry design document (semantic similarity 0.92) and the RetryHandler.java code file (semantic similarity 0.89) from the vector library as initial semantic anchors. The semantic similarity values ​​are obtained by converting the query text into query vectors using a pre-trained language model, and then calculating the cosine similarity with each entity vector. Code entities use the CodeBERT model, and document entities use the Sentence-BERT model. The system expands the graph in multiple hops and generates candidate asset chains starting from each initial semantic anchor point. The following is an example of a candidate chain with RetryHandler.java as the semantic anchor point: Tracing upwards along the implementation relation to the payment retry design document (traversal cost 0.5), tracing upwards along the detailed description relation to the payment retry function use case (traversal cost 0.4), tracing upwards along the derived relation to the payment reliability requirement (traversal cost 0.3), and extending downwards along the test verification relation to the RetryHandlerTest test suite (traversal cost 0.8).

[0161] The system employs a position-sensitive weighted calculation method to determine aggregate semantic similarity. Using RetryHandler.java as the anchor (d=0, weight 1.0), the payment retry design document is 1 hop from the anchor (d=1, weight exp(-0.3) ≈ 0.74), the payment retry functional test case is 2 hops from the anchor (d=2, weight exp(-0.6) ≈ 0.55), the payment reliability requirement is 3 hops from the anchor (d=3, weight exp(-0.9) ≈ 0.41), and RetryHandlerTest is 1 hop from the anchor (d=1, weight 0.74). The weighted aggregate semantic similarity AggSim(L) = (1.0×0.89 + 0.74×0.92 + 0.55×0.85 + 0.41×0.80 + 0.74×0.78) / (1.0 + 0.74 + 0.55 + 0.41 + 0.74) = (0.890 + 0.681 + 0.468 + 0.328 + 0.577) / 3.44 = 0.856.

[0162] The total cost of traversing the chain is TotalCost(L) = 0.5 + 0.4 + 0.3 + 0.8 = 2.0. The confidence scores of each edge are 0.95, 0.91, 0.93, and 0.88, respectively, with the minimum ConfEdge(L) = min(0.95, 0.91, 0.93, 0.88) = 0.88. The chain covers four dimensions: requirements, design, code, and testing, with Comp(L) = 1.0. Taking φ = 0.6, the composite confidence score Conf(L) = 0.6 × 0.88 + 0.4 × 1.0 = 0.928.

[0163] The overall utility value U(L) = 0.6 × [0.5 × 0.856 + 0.5 × exp(-0.5 × 2.0)] +0.4 × 0.928 = 0.6 × [0.428 + 0.184] + 0.371 = 0.367 + 0.371 = 0.738.

[0164] Multidimensional context scoring: Current task type is code reuse (encoding 1), chain-related test coverage is 0.91, historical defect density is 0.15, project similarity is 0.85, iteration stage is development (encoding 2), user role is development (encoding 1), and the most recent submission is 7 days ago. After calculating the linear combination θ_ctx · x_ctx + b_ctx using the context scoring model, the above 7-dimensional features are input into a trained logistic regression model. The result is then mapped using the Sigmoid function σ to obtain Δ_context = 0.28, and the final utility value U_final(L) = 0.738 × (1 + 0.28) = 0.945.

[0165] The system integrates the above information into a structured chain containing requirements, design, code, and tests, and generates the following description: This chain originates from the payment module of Project A. The core code, RetryHandler.java, implements an exponential backoff retry strategy. The accompanying test, RetryHandlerTest, contains 12 test cases with 91% coverage. Refer to the requirements document for constraints on the number of retries. The results are embedded in the ZenTao task details page in card format, allowing developers to directly click the link to view the original content of any asset.

[0166] Incremental update scenario: When the version control system detects a new code commit event, the system only re-executes steps S3 (relationship candidate generation, relationship confidence calculation) and step S4 (vector index update) for the affected asset entities and their adjacency relationships, rather than rebuilding the entire asset set. For example, when RetryHandler.java is modified, the system only updates the vectors of the entities in that code module, recalculates the relationship confidence between them and related requirements and test cases, and updates the affected graph edges. This incremental update mechanism allows the system to maintain the timeliness of the knowledge graph and vector indexes with lower computational cost, adapting to the dynamically changing engineering environment of software assets.

[0167] Example 3: An electronic device includes a memory and a processor; wherein the memory is used to store a program; the processor is used to execute the program, and when the program is executed, it is specifically used to implement the software asset chain tracing and retrieval method as described in Example 1.

[0168] Example 4: A computer storage medium, characterized in that it is used to store a computer program, which, when executed, is used to implement the software asset chain-based tracing and retrieval method as described in Example 1.

[0169] Specifically, computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.

[0170] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A software asset chain traceability search method, characterized by, Includes the following steps: S1. Construct a software engineering domain ontology, which includes at least one asset entity type and at least one engineering relation type; Specifically: the asset entity types include one or more of the following: business requirements, functional use cases, design components, code modules, test cases, technical documents, defect records, commit records, and project tasks; the engineering relationship types include one or more of the following: described in detail, implemented as, tested and verified, referenced, derived from, dependent on, fixed as, associated with defects, and belonging to iteration. S2. Collect software asset data from one or more software engineering data sources, including requirements management system, version control system, project management tool, test management system and document library, and perform format parsing, metadata extraction and structure conversion on the software asset data to obtain a unified asset record; S3. Based on the ontology of the software engineering domain, identify asset entities from the unified asset record, generate candidate relationships between asset entities, calculate the relationship confidence for each candidate relationship, and construct a knowledge graph containing the asset entity and its associated edges based on the relationship confidence. S4. Input one or more of the text content, code content, metadata and structural information corresponding to each asset entity into the pre-trained language model to obtain entity vectors, and then bind the entity vectors with the unique identifiers of the asset entities in the knowledge graph and store them in the vector database. S5. Receive user queries, convert them into query vectors, perform similarity retrieval in the vector database, obtain the Top-K most similar asset entities as the initial semantic anchor set, and perform multi-hop traversal along the preset engineering relationship in the knowledge graph starting from each initial semantic anchor to generate candidate asset chains. S6. Based on the aggregate semantic similarity between entities in the candidate asset chain and the user query, the traversal cost of each associated edge in the chain, the relationship confidence of each associated edge in the chain, and the user's current working context, calculate the comprehensive utility value of the candidate asset chain, and output the final result after sorting by utility value.

2. The software asset chain-of-custody forensic retrieval method of claim 1, wherein, S2 includes the following steps: S21. Data source connection and periodic collection: Connect to the enterprise's internal requirements management system, version control system, project management tools, test management system and document library through the adapter interface to collect various assets periodically or through event-triggered collection; S22. Format parsing and metadata extraction: Different parsers are used to parse different file formats to obtain parsed asset data. File formats include code files, Markdown documents, JSON configuration files, Word documents, test reports, commit records, defect records, and project task records. For each format, one or more metadata items are extracted from the following: title, unique identifier, version number, commit number, author, creation time, modification time, path, reference number, comment text, and body paragraph. S23. Structured Transformation: Convert the parsed asset data into a unified asset record. The unified asset record includes a unique asset identifier, asset type, asset origin, text content, structural information, metadata, and original access address.

3. The software asset chain-of-custody forensic retrieval method of claim 2, wherein, S3 includes the following steps: S31. Based on one or more of the following: asset entity identifier, requirement number, submission information, file path, call dependency, document reference, test case name, defect number, and task number, the explicit association between entities is identified through the hierarchical rule priority engine, and candidate rule-based relationships are generated. In S31, the hierarchical rule priority engine divides the matching rules into three priorities according to their accuracy, as follows: The first priority is precise identification matching, which includes the requirement number being directly contained in the submission information, the function number being directly contained in the test case name, and the code module being directly associated in the defect record; The second priority is structured pattern matching, which includes hierarchical matching of code paths and module names, cross-reference numbers in design documents, and function signature matching in the call dependency chain; The third priority is fuzzy heuristic matching, which includes approximate matching based on naming conventions and edit distance matching based on file paths; When the same asset entity identified hits multiple priority rules, the decision result of the highest priority rule is dominant, and a priority discount factor ζ, 0 < ζ < 1, is applied to the matching score of the low priority rule to obtain the rule decision component wherein, are descending weight coefficients of the first priority, the second priority and the third priority respectively, S_p1, S_p2, S_p3 are matching scores of the first priority, the second priority and the third priority respectively, υ_t = exp(-ν × Δt) is a time decay factor, Δt is the number of days from the rule matching result to the current time, ν is a decay rate parameter, υ_t = 1 is taken for the rule matching result not exceeding the preset time window, and exp represents a natural exponential function, that is, an exponential operation with the natural constant e as the base; S32. Based on the frequency of co-occurrence, co-occurrence time interval and co-occurrence source credibility of asset entities in multi-granularity co-occurrence scenarios, calculate the weighted statistical co-occurrence strength between entities and generate statistical relation candidates; In step S32, the multi-granularity co-occurrence scenarios are arranged from coarse to fine granularity, including five levels: project-level co-occurrence, iteration-level co-occurrence, commit-level co-occurrence, file-level co-occurrence, and function-level co-occurrence. Each level is assigned a different basic weight w_g. A time decay factor exp(-ε × Δt_g) is applied to each co-occurrence event, where Δt_g is the number of days since the current co-occurrence event, and ε is the co-occurrence time decay rate. A credibility coefficient c_s is assigned to each co-occurrence source. The co-occurrence strength S_stat of statistical relation candidates is expressed as: S_stat = Σ_g Σ_j (w_g × c_s_j × exp(-ε × Δt_g_j)) / N_normalize Where g is the co-occurrence granularity level, j is the jth co-occurrence event at the current granularity level, w_g is the basic weight of the gth granularity level, c_s_j is the source credibility coefficient of the jth co-occurrence event, and N_normalize is the normalization coefficient, which is determined by the maximum value of the unnormalized co-occurrence intensity of all entity pairs within the current statistical window, so that the value range of S_stat is normalized to [0,1]. S33. A heterogeneous embedded spatial architecture is used to vectorize different types of asset entities to obtain the semantic similarity between entity pairs and generate semantic relation candidates. In step S33, code-type asset entities are embedded using a code-specific pre-trained language model, which is a model pre-trained on code corpora; document-type asset entities and requirement-type asset entities are embedded using a general pre-trained language model; different embedding spaces are aligned through a shared projection layer, which is a trainable fully connected layer. After mapping the vectors of different embedding spaces to a unified semantic space, the semantic similarity between entity pairs is calculated. When the semantic similarity exceeds a preset semantic threshold, semantic relation candidates are generated; both the code-specific pre-trained language model and the general pre-trained language model are fine-tuned through comparative learning on asset pair data in the software engineering domain, so that the vector distance between entity pairs with engineering-related relationships in the semantic space is less than the vector distance between unrelated entity pairs; S34. Based on the rule-based determination of components, co-occurrence strength, and semantic similarity between entity pairs, calculate the relation confidence of each relation candidate; In S34, the relationship confidence ξ is expressed as: ξ = χ_r × S_rule + χ_s × S_stat + χ_m × S_semantic Where χ_r, χ_s, and χ_m are the fusion weights of the rule decision component S_rule, the co-occurrence intensity component S_stat, and the semantic similarity component S_semantic, respectively, satisfying χ_r + χ_s + χ_m = 1; S35. When the relation confidence is greater than or equal to the high confidence threshold Θ_high, a corresponding directed relation edge is automatically created in the knowledge graph; when the relation confidence is between the low confidence threshold Θ_low and the high confidence threshold Θ_high, a lightweight manual confirmation process is triggered, and the directed relation edge is created or discarded based on the manual confirmation result; when the relation confidence ξ is lower than the low confidence threshold Θ_low, the current relation candidate is discarded.

4. The software asset chain-based tracing and retrieval method according to claim 3, characterized in that, S5 includes the following steps: S51. Convert the user query text into a query vector through a pre-trained language model, perform similarity retrieval in the vector database, and obtain the Top-K entities most similar to the query as the initial semantic anchor set; S52. Determine the chain template based on the task type corresponding to the user query; In S52, the task types include code reuse tasks, test design tasks, and defect location tasks; When the task type is a code reuse task, the chain template prioritizes extending the code module to the paths of design components, functional use cases, business requirements, and test cases; when the task type is a test design task, the chain template prioritizes extending the business requirements to the paths of functional use cases, code modules, and existing test cases; when the task type is a defect localization task, the chain template prioritizes extending the defect record to the paths of code modules, commit records, test cases, and requirement entities. S53. Starting from each initial semantic anchor point, perform multi-hop traversal along the engineering relationship direction specified by the chain template. During the traversal, a traversal cost C_R is preset for each relationship type. The total path cost is the sum of the costs of each edge. Based on the maximum number of hops, the whitelist of relationship types, the minimum relationship confidence, the maximum traversal cost, the duplicate entity resolution rules, and the chain template constraints, path pruning is performed to eliminate redundant paths and low-confidence paths, generating a set of candidate asset chains.

5. The software asset chain-based tracing and retrieval method according to claim 4, characterized in that, S6 includes the following steps: S61. The semantic similarity between each entity in the candidate asset chain L and the user query is aggregated using a position-sensitive weighting method to obtain the chain aggregate semantic similarity. In S61, the position-sensitive weighting method means that entities closer to the initial semantic anchor point in the chain contribute more to the aggregation score, while the contribution of entities farther away decays exponentially. Chain aggregation semantic similarity AggSim(L) is represented as: AggSim(L) = Σ_i (w_i × sim(e_i, q)) / Σ_i w_i Where e_i is the i-th entity in chain L, q is the user query, sim(e_i, q) is the semantic similarity between the entity and the query, w_i = exp(-ω × d_i) is the position-sensitive weight, d_i is the shortest number of hops from the initial semantic anchor point of entity e_i in the chain, and ω is the position decay rate parameter. S62. Decompose the chain confidence into two dimensions: edge confidence aggregation and chain integrity, and calculate the chain composite confidence. In S62, the chain composite confidence level Conf(L) is represented as: Conf(L) = φ × ConfEdge(L) + (1 - φ) × Comp(L) Where ConfEdge(L) is the aggregated value of the confidence of each associated edge in chain L, using the minimum aggregation strategy, i.e., ConfEdge(L) = min(ξ_1, ξ_2, ..., ξ_m); Comp(L) is the chain completeness, which is defined as the ratio of the number of engineering dimensions covered by chain L to the preset target number of dimensions. Engineering dimensions include four categories: requirement dimension, design dimension, code dimension, and test dimension. When the chain contains requirement entity, design entity, code entity, and test entity simultaneously, Comp(L) = 1. When any dimension is missing, Comp(L) decreases proportionally according to the number of missing dimensions. φ is the balancing weight between edge confidence and completeness. S63. Calculate the comprehensive utility value of the candidate asset chain based on the chain aggregation semantic similarity and chain composite confidence. In S63, the comprehensive utility value U(L) of the candidate asset chain L is expressed as: U(L) = η × [ψ × AggSim(L) + (1-ψ) × exp(-λ×TotalCost(L))] + (1-η) ×Conf(L) Where TotalCost(L) is the sum of the traversal costs of each associated edge in chain L, η is the balance weight between semantic relevance and chain credibility, ψ is the inner balance weight between chain aggregate semantic similarity AggSim(L) and cost penalty term exp(-λ×TotalCost(L)), and λ is the cost decay parameter. S64. Perform multi-dimensional context adaptive sorting, encode the user's current working context into a multi-dimensional context feature vector x_ctx = [x_1, x_2, ..., x_D], where each dimension corresponds to the current task type encoding, the association test coverage of entities in chain L, the historical defect density of entities in chain L, the similarity between the current project and the source project of the chain, the current iteration stage encoding, the user role encoding, and the number of days between the most recent submission time in chain L and the current time. D is the number of dimensions of the context feature vector x_ctx. Through the pre-trained context scoring model, calculate the context gain factor Δ_context = σ(θ_ctx · x_ctx + b_ctx), where θ_ctx is a trainable weight vector, b_ctx is a bias term, and σ is the Sigmoid activation function. The context scoring model is obtained through supervised training on historical user click and reuse behavior data. Adjust the final utility value to U_final(L) = U(L) × (1 + Δ_context). S65. Sort the candidate asset chains in descending order according to the final utility value U_final(L), take the top N chains as the final result, and output the sorted software asset chains and their corresponding asset entry points, relationship descriptions and reuse prompts to the user; In S65, the reuse prompt information includes one or more of the following: chain source project, key code module, corresponding design document chapter, related business requirements, number of existing test cases, test coverage, number of historical defects, relationship confidence, and chain integrity. The final result is embedded in the user interface of the project management tool in the form of a card, and users can directly click the link to view the original content of any asset.

6. A software asset chain-based traceability and retrieval system, characterized in that, The software asset chain tracing retrieval method according to any one of claims 1-5 includes a multi-source asset acquisition and parsing module (1), a domain knowledge graph construction and vectorization joint processing module (2), a dual-engine driven retrieval engine module (3), and a project management tool integration adapter module (4) connected in sequence.

7. An electronic device, characterized in that, It includes a memory and a processor; wherein the memory is used to store a program; the processor is used to execute the program, and when the program is executed, it is specifically used to implement the software asset chain tracing and retrieval method as described in any one of claims 1-5.

8. A computer storage medium, characterized in that, Used to store computer programs, which, when executed, are used to implement the software asset chain tracing and retrieval method as described in any one of claims 1-5.