A method for automatically extracting logical relations of demand entries based on a three-way fusion funnel

CN122964192APending Publication Date: 2026-10-23INFORMATION SCI RES INST OF CETC
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

其三,若直接采用大语言模型对全部条目对进行判定,其调用规模随条目数量耗时较长,导致计算资源消耗过高且容易超出上下文窗口限制,判定质量随之下降

Benefits of technology

通过并行执行向量语义相似度、关键词倒排索引与层级结构关联三路互补召回并取并集,分别覆盖表述不同但概念相近、共享技术术语以及同一功能模块下功能互补三类关联,消除了单一检索策略的系统性盲区,提高了逻辑关系的初始召回率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964192A_ABST
    Figure CN122964192A_ABST
Patent Text Reader

Abstract

The application discloses a demand entry logical relationship automatic extraction method based on a three-way fusion funnel, and relates to the technical field of computers. The method first assembles the hierarchical context text of the target demand entry, then performs three-way recall of vector semantic similarity recall, keyword inverted index recall and hierarchical structure association recall in parallel, takes the union to obtain a candidate entry set, further compresses the candidate entry set to a first number through a cross coding model, then sends the candidate into a large language model in batches to obtain structured relationship data, and finally removes the relationship data and persists it as a directed edge to a graph database. The method eliminates the systematic blind area of a single retrieval strategy through three-way complementary wide recall, controls the context length of a single call by compressing the candidate size from hundreds to tens through cross coding and precise sorting, and avoids the nonlinear growth of computing resources caused by candidate inflation while ensuring the quality of relationship extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for automatically extracting logical relationships of demand items based on a three-way fusion funnel. Background Technology

[0002] In the development of large-scale software systems, system requirements are typically broken down into numerous structured requirement items. These requirement items often have complex internal logical relationships. For example, one requirement item may be strongly dependent on the preconditions or outputs provided by another requirement item, or a change to one requirement item may potentially affect the standards or parameters of another. Accurately identifying and extracting these logical relationships is crucial for change impact analysis, task dependency planning, and system verification. With the rapid increase in the size of requirement items, relying on manually reviewing documents to discover the relationships between items is no longer sufficient for engineering practice. An automated method for extracting logical relationships is urgently needed.

[0003] In existing technologies, the automatic extraction of logical relationships between requirement items typically employs relatively simple and fixed retrieval or analysis strategies. One type of method is based on keyword matching, which pre-configures a list of related keywords and scans the text content of each requirement item, establishing suspected association markers when items share the same keywords. Another type of method is based on vector semantic similarity, which uses an embedding model to convert the requirement item text into vectors and determines the semantic relevance between items by calculating the cosine similarity between vectors. Yet another type of method combines keyword extraction with a predefined semantic lexicon and part-of-speech features to determine the dependencies between items. In addition, there is also the approach of directly using large language models to determine the relationships between items.

[0004] However, the aforementioned existing technologies all have significant shortcomings in handling large-scale, high-quality demand relationship extraction. First, single retrieval or analysis strategies have systemic blind spots: methods based on keywords or semantic lexicons are essentially word-level matching, making it difficult to handle entries with different expressions but similar concepts; while methods based on vector semantic similarity focus on textual semantic proximity rather than logical correlation, making it difficult to discover entries with complementary or opposing functions within the same context. Second, the hierarchical structure information of the demand entries is not utilized. Existing methods are text-centric, treating entries as independent text blocks, ignoring the inherent high relevance of sibling entries under the same parent node. Third, if a large language model is directly used to judge all entry pairs, the call scale increases with the number of entries, resulting in excessive computational resource consumption and easily exceeding the context window limit, thus reducing the quality of judgment.

[0005] Therefore, it is necessary to propose a new method for automatically extracting the logical relationships of requirement items, so as to simultaneously solve the technical problems of blind spots in single strategies, loss of hierarchical structure information, and uncontrollable scale of large language model calls. Summary of the Invention

[0006] The present invention aims to provide an automatic extraction method for the logical relationship of demand items based on a three-way fusion funnel, so as to solve the shortcomings of the prior art. The technical problem to be solved by the present invention is achieved through the following technical solution.

[0007] According to a first aspect of this application, a method for automatically extracting logical relationships of demand items based on a three-way fusion funnel is provided, applied to a demand item processing device, wherein the demand items are stored in a demand item library with a tree-like hierarchical structure, and the method includes: S1: Assemble the hierarchical context text of the target requirement item, wherein the hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure; S2: Based on the hierarchical context text, perform three-way recall in parallel. The three-way recall includes vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall. The results of the three-way recall are combined and the target requirement item itself is excluded to obtain a candidate item set. S3: The candidate item set is finely ranked using a cross-coding model, and the first number of candidate items with the highest relevance after fine ranking are retained; S4: The retained candidate entries are split into multiple batches. For each batch, structured prompt words are constructed and fed into the large language model for batch-by-batch fine judgment to obtain structured relation data. The structured relation data includes target identifier, relation type and judgment reason. S5: After deduplication of the structured relational data, it is persistently stored in the graph database in the form of directed edges.

[0008] Preferably, in S1, the hierarchical context text for assembling the target requirement item includes: tracing upwards from the parent node identifier chain of the target requirement item in the requirement item library to the root node; The name fields of all ancestor nodes on the tracing path are concatenated in order from the root node to the target requirement item to form the path information; The description field of the target requirement entry is appended after the path information to form the hierarchical context text.

[0009] Preferably, the vector semantic similarity recall includes: feeding the hierarchical context text into an embedding model and outputting the corresponding dense floating-point vector; performing cosine similarity retrieval in the vector database using the dense floating-point vector as the query condition, excluding itself and sorting in descending order of similarity, and taking the second number of the top-ranked entries as the result of the vector semantic similarity recall.

[0010] Preferably, the keyword inverted index retrieval includes: performing keyword extraction on the hierarchical context text, wherein the keyword extraction includes extracting combinations of numerical values ​​and units using regular expressions, extracting continuous sequences of English letters with a length of not less than two, and segmenting Chinese words using a word segmentation tool and filtering single characters, pure numbers, and stop words; merging the three results, removing duplicates, and taking a preset upper limit of keywords; querying the inverted index table using the keywords as query conditions, and sorting them in descending order by the number of keywords hit; taking the third-highest number of required entries as the result of the keyword inverted index retrieval, wherein the inverted index table uses the combination of keywords and entry identifiers as a composite primary key.

[0011] Preferably, the hierarchical structure association recall includes: querying the parent node identifier and grandparent node identifier of the target requirement item; when the parent node identifier is valid, finding other leaf nodes under the parent node whose description field is not empty and which have no child nodes as sibling node candidates; when the grandparent node identifier is valid, finding the leaf nodes of each subdirectory under the grandparent node as cousin node candidates; and taking the union of the sibling node candidates and the cousin node candidates as the result of the hierarchical structure association recall.

[0012] Preferably, in S3, the step of refining the candidate item set through a cross-coding model and retaining the first number of candidate items with the highest relevance after refining includes: obtaining the hierarchical context text of each candidate item in the candidate item set; Organize the hierarchical context text of the target requirement item and the hierarchical context text of each candidate item into text pairs, and truncate the length of the text pairs; The text pairs are fed into the cross-coding model, which outputs a relevance score for each text pair. Sort the candidate entries in descending order of their relevance scores and retain the first number of entries that rank highest.

[0013] Preferably, in S4, the step of constructing structured prompt words for each batch and sending them into a large language model for batch-by-batch fine-tuning to obtain structured relationship data includes: splitting the retained candidate entries into multiple batches according to a preset batch size; For each batch, construct structured prompts that include role settings, source item information, a list of candidate items for this batch, judgment rules, and output format requirements; The structured prompts are fed into the large language model, which then returns a result in the form of a JSON array. Perform multi-layer fault-tolerant parsing on the JSON array. The multi-layer fault-tolerant parsing includes prioritizing standard parsing, scanning curly brace objects line by line for separate parsing when standard parsing fails, and cleaning up marker characters. The relationship types include a first relationship type representing strong dependency and a second relationship type representing potential influence.

[0014] According to a second aspect of this application, an automatic extraction device for the logical relationship of demand items based on a three-way fusion funnel is provided, comprising: The hierarchical context assembly module is configured to assemble the hierarchical context text of the target requirement item, wherein the hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure; The three-way parallel recall module is configured to perform three-way recall based on the hierarchical context text, including vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall, and then take the union of the results of the three-way recall and exclude the target requirement item itself to obtain the candidate item set; The cross-coding fine ranking module is configured to fine-rank the candidate item set through the cross-coding model and retain the first number of candidate items with the highest relevance after fine ranking. The batch-by-batch fine-judgment module of the large language model is configured to split the retained candidate entries into multiple batches, construct structured prompt words for each batch and send them into the large language model for batch-by-batch fine-judgment, and obtain structured relation data including target identifier, relation type and judgment reason; The relation deduplication and graph storage module is configured to deduplicat the structured relation data and persistently store the deduplicated relations in the form of directed edges in the graph database.

[0015] According to a third aspect of this application, an electronic device is provided, the device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel.

[0016] According to a fourth aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the above-described method for automatically extracting the logical relationship of requirement items based on a three-way fusion funnel.

[0017] The embodiments of the present invention have the following advantages: By performing parallel execution of vector semantic similarity, keyword inverted index and hierarchical structure association three complementary recall and taking the union, it covers three types of associations: different expressions but similar concepts, shared technical terms and complementary functions under the same functional module. This eliminates the systematic blind spots of a single search strategy and improves the initial recall rate of logical relationships. By assembling the hierarchical location information of demand items into hierarchical context text and using it as an independent recall route and judgment criterion, the structural information ignored by existing methods is fully utilized, so that the semantics of items with the same name but different chapters can be distinguished. By using a funnel structure consisting of cross-coding model fine ranking and small batch fine judgment of large language model, the calling scale of large language model is reduced from being proportional to the square of the number of entries to the order of magnitude linearly related to the number of entries, which significantly reduces the consumption of computing resources and avoids exceeding the context window limit. By requiring the large language model to return structured data and performing multi-layer fault-tolerant parsing on it, the judgment results can be reliably parsed and stored by the program, and persisted to the graph database with directed edges containing judgment reasons and expiration tags, thus realizing a traceable logical relationship knowledge graph. Attached Figure Description

[0018] Figure 1 This is a flowchart of the steps of an automatic extraction method for the logical relationship of demand items based on a three-way fusion funnel according to the present invention; Figure 2 This is a schematic diagram of the structure of an automatic extraction system for logical relationships of demand items based on a three-way fusion funnel, according to the present invention. Figure 3 This is a schematic diagram of the structure of an electronic device according to the present invention; Figure 4 This is a schematic diagram of the structure of a computer storage medium according to the present invention. Detailed Implementation

[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] It should be noted that the above detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0021] The embodiments of the present invention are applied to a demand item processing device, which is communicatively connected to a demand item library, a vector database, an inverted index storage, and a graph database. The demand item library organizes and stores demand items in a tree-like hierarchical structure. Each demand item includes at least an item identifier, a parent node identifier, a name field, and a description field. Multiple child nodes under the same parent node are sibling nodes, and nodes that no longer have child nodes are leaf nodes.

[0022] Example 1

[0023] This embodiment provides an automatic extraction method for logical relationships of requirement items based on a three-way fusion funnel. By executing each target requirement item one by one, the method automatically extracts the logical relationship between the target requirement item and other items in the requirement item library, including the following steps.

[0024] Step 1: Assemble the hierarchical context text of the target requirement item. The hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure.

[0025] The demand item processing device reads the record of the target demand item from the demand item library, obtains its parent node identifier, and traces upwards along the parent node identifier chain until it reaches the root node without a parent node, thereby obtaining the complete ancestor node sequence from the root node to the target demand item.

[0026] Subsequently, the name fields of each ancestor node in the sequence are concatenated sequentially from the root node to the target requirement item, separated by a hierarchy separator, to form path information; the description field of the target requirement item itself is appended after the path information to form hierarchical context text.

[0027] In a specific example, the hierarchical context text is organized in the form of "path [document title > chapter title > sub-chapter title], function details: description of this entry," which allows the text to carry both the entry's structural position in the document tree and the entry's own semantic content. Compared to using only the entry's own description, hierarchical context text enables entries with the same name but located in different chapters to be distinguished in subsequent retrieval and judgment.

[0028] Step two involves parallel execution of three-way recall based on the hierarchical context text. The demand item processing device simultaneously initiates three independent recall routes: vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall. These three routes are independent of each other and can be executed in parallel. After all results are returned, the results are combined, and the target demand item itself is excluded to obtain a candidate item set.

[0029] The specific handling for the three routes is as follows: Vector semantic similarity recall involves feeding the hierarchical context text assembled from the target entry into an embedding model (such as bge-m3), which outputs a 1024-dimensional dense floating-point vector. This vector mathematically encodes the semantic features of the text—texts with similar semantics are closer in cosine distance in the vector space. In the vector database, a cosine similarity search is performed using the dense floating-point vector as the query condition. After excluding itself, the results are sorted in descending order of similarity. The second-highest number of requested entries are taken as the result of the vector semantic similarity recall. In this embodiment, the top 30 most similar entry IDs are taken as the recall result for route A.

[0030] Keyword inverted index retrieval includes: the demand item processing device performing keyword extraction on the hierarchical context text, which comprises three parts: Extract combinations of numerical values ​​and units from text using regular expressions (e.g., "100Mbps", "20ms", "-40℃"). Extract consecutive sequences of English letters with a length of at least two (e.g., "JWT", "API", "OAuth"). The text was segmented using a Chinese word segmentation tool, and single characters, pure numbers, and stop words (such as "system", "demand", "should", "of" and 30+ other high-frequency words with no discriminative power) were filtered out. The keywords obtained from the above three parts are merged and deduplicated, and when the limit is exceeded, a number of the first few keywords are selected. In this embodiment, a maximum of 15 keywords are selected.

[0031] Subsequently, these keywords are used as query conditions to search the inverted index table, which uses the combination of keywords and entry identifiers as the composite primary key. Candidate entries are sorted from highest to lowest based on the number of times they match the keywords, and the third-highest number of entries in the sorted list are taken as the keyword inverted index recall result. Keyword inverted index recall focuses on capturing entries that share the same technical terms. In this embodiment, the top 30 entry IDs are taken as the recall result for route B.

[0032] The hierarchical structure association recall includes: the demand item processing device queries the parent node identifier and grandparent node identifier of the target demand item; when the parent node identifier is valid (not -1), it searches for other leaf nodes under the parent node whose description field is not empty and which have no child nodes themselves, as candidates for sibling nodes; When the grandfather node identifier is valid, leaf nodes are searched in each subdirectory under the grandfather node as candidates for cousin nodes; the union of the candidate sibling nodes and the candidate cousin nodes is taken as the result of the hierarchical structure association recall.

[0033] Hierarchical structure-based recall focuses on capturing items that are within the same functional module and whose functions are complementary or contradictory.

[0034] After all three retrieval paths have been completed, the demand item processing device takes the union of the three results and excludes the target demand item itself and duplicate items from the candidate items to obtain a candidate item set. Since the three-way retrieval starts from three mutually orthogonal dimensions of semantics, terminology, and structure, its union can cover multiple types of potential associations with a high initial recall rate, thereby eliminating the systematic blind spots inherent in any single retrieval strategy.

[0035] Step 3: The candidate item set is finely ranked using a cross-coding model, and the first number of candidate items with the highest relevance ranking after fine ranking are retained.

[0036] The requirement item processing device first obtains the hierarchical context text of each candidate item in the candidate item set, then organizes the hierarchical context text of the target requirement item and the hierarchical context text of each candidate item into text pairs, and truncates the length of each text pair to adapt to the input length limit of the model. The text pairs are then fed into a cross-coding model (such as bge-reranker-v2-m3), which directly outputs a relevance score for each text pair. Finally, the text pairs are sorted from high to low according to their relevance scores, and only the top few candidate entries are retained, thus compressing the candidate size to a smaller and controllable range.

[0037] Unlike the independent encoding of query vectors and item vectors in vector semantic similarity recall, the cross-coding model concatenates text pairs and encodes them together. Therefore, it can characterize the relevance between target items and candidate items with higher accuracy and play a medium-cost fine ranking role in the funnel.

[0038] Step four: The retained candidate entries are split into multiple batches. For each batch, structured prompt words are constructed and fed into the large language model for batch-by-batch fine-tuning to obtain structured relationship data.

[0039] The demand item processing device evenly divides the first number of candidate items retained after fine sorting into multiple batches according to a preset batch size; For each batch, a structured prompt word is constructed, which includes five parts: role setting, source item information, candidate item list for this batch, judgment rules, and output format requirements. The structured prompts are fed into the large language model, which returns the judgment results in the form of a JSON array. Each array element contains at least three fields: target identifier, relation type, and judgment reason.

[0040] The relationship types include a first relationship type representing strong dependency and a second relationship type representing potential impact. The former indicates that the target entry depends on the premises or outputs provided by the candidate entry in its implementation, while the latter indicates that changes to the target entry may potentially affect the criteria or parameters of the candidate entry.

[0041] To improve the robustness of parsing, the requirement item processing device performs multi-layer fault-tolerant parsing on the content returned by the large language model: it prioritizes parsing the entire content as JSON in a standard manner; When standard parsing fails, it degenerates into line-by-line scanning, identifying and parsing segments that match the curly brace enclosed pattern, where each curly brace object contains the following fields: target_id represents the identifier of the target entry that is determined to have a logical relationship with the source entry; relation_type indicates the type of the logical relationship, and its value can be either a first relation type that indicates strong dependency or a second relation type that indicates potential influence. "reason" represents the reason text for the large language model's judgment on this logical relationship.

[0042] The process of scanning the curly brace objects line by line and parsing them individually includes matching the literal values ​​of JSON objects enclosed in curly braces line by line in the original text returned by the large language model, and performing JSON parsing independently on each matched curly brace object to extract the values ​​of the target_id, relation_type, and reason fields, so that a valid relation determination result can still be recovered even if the overall JSON array parsing fails.

[0043] Simultaneously, irrelevant characters such as code block markers that may be embedded in the returned content are cleaned up. By compressing the candidate size before sending it in batches, the call size of the large language model is reduced from being proportional to the square of the number of entries to being linearly related to the number of entries. This relationship can be expressed as: , Where C represents the scale of language model calls required to complete relation determination for a single target item, N represents the number of items in the requirement item library, M represents the number of candidate items retained after fine ranking, and b represents the number of candidate items in each batch. M / b This indicates that the result of dividing M by b is rounded up. N(N-1) / 2 on the right side of the inequality sign indicates the call size when evaluating each item pair one by one.

[0044] As can be seen, this invention controls the per-target invocation scale to a constant order of magnitude related to the number of candidates, significantly reducing the consumption of computing resources.

[0045] Step 5: After deduplication of the structured relationship data, persist it to the graph database in the form of directed edges.

[0046] The demand item processing device summarizes and parses the structured relationship data returned in each batch. When the same pair of items is determined to be related multiple times, the relationship type with higher priority is retained according to the preset conflict resolution rules. For example, when strong dependency and potential impact occur at the same time, strong dependency is retained. Subsequently, for each deduplicated relation, starting from the source entry and ending at the target entry, a directed edge is written into the graph database using a graph query language (Neo4j / Memgraph compatible), and a decision reason field and an expiration flag field are attached to the directed edge.

[0047] The "Judgment Reason" field records the judgment criteria provided by the large language model, which facilitates subsequent manual traceability; the "Expiration Mark" field is used to mark the relationship as needing to be re-verified when the relevant entries are changed, thereby supporting the incremental maintenance and reuse of the relational knowledge graph.

[0048] In a specific application example, the dense floating-point vector output by the embedding model used for vector semantic similarity recall has a dimension of 1024. Vector semantic similarity recall and keyword inverted index recall each take the top 30 items in the sorted list. After taking the union of the three paths, the size of the candidate item set is about 60 to 90. Keyword extraction filters out single characters shorter than two characters and retains a maximum of 15 keywords; after fine ranking by the cross-coding model, the first 15 candidate entries are retained; the first 800 characters of each text pair are truncated before being fed into the cross-coding model. When performing precise judgment using the large language model, each batch contains 3 candidate entries, and the total number of batches is 5.

[0049] In this example, for an item library containing approximately 1000 demand items, if all item pairs were fed into the large language model for judgment one by one, the theoretical call scale would be on the order of 500,000. However, with the funnel structure of this embodiment, the call scale of the large language model per target is compressed to the order of approximately 5, and the overall call scale increases linearly with the number of items. The three-way parallel recall effectively reduces the systemic missed recall risk under a single retrieval strategy through complementary coverage in three dimensions.

[0050] As a further explanation of the implementation details of each step in the above specific application example: In step one, when assembling the hierarchical context, the name field of all ancestor nodes is concatenated, and the description field of this node is appended to the end.

[0051] In the second step of vector semantic similarity recall, an embedding model with a vector dimension of 1024 is used. Its output is a dense floating-point vector with a vector dimension of 1024. When performing a search in the vector database, the top 30 entries are excluded from the target entry itself. That is, the top 30 entries are selected from each recall path. After merging the three paths, the candidate set is about 60 to 90 entries, and the target entry itself is excluded. In the keyword inverted index recall, the jieba Chinese word segmentation tool is used to segment words and filter stop words, extract English letter sequences, and merge and deduplicate to select a maximum of 15 keywords. In the hierarchical structure association recall, sibling leaf nodes and cousin leaf nodes are searched as candidates to make full use of the document tree structure information, that is, the association between sibling / cousin nodes.

[0052] In step three, a cross-encoder re-ranking model (such as bge-reranker-v2-m3) is used to perform Cross-Encoder fine ranking to retain the top 15 candidates, and the first 800 characters of the text pair are extracted and the top 15 are selected in descending order of relevance score.

[0053] In step four, the LLM selects three candidates per batch, for a total of five batches. The structured JSON output returned by the large language model can be reliably parsed and stored by the program. Its JSON fields include target_id, relation_type, and reason. If standard parsing fails, the curly brace objects are scanned line by line and the markdown tags are cleaned up.

[0054] In step five, when the same pair appears multiple times, the DEPENDS_ON relationship is preserved and written in the form of directed edges in the graph database.

[0055] The above-mentioned processes run within a demand item database / graph database / vector database / relational database environment. Preliminary verification shows that this embodiment employs a three-way parallel recall approach, leveraging complementary coverage across three dimensions to effectively reduce the systemic missed recall risk associated with a single retrieval strategy.

[0056] In another embodiment of this application, both vector semantic similarity recall and keyword inverted index recall select the top 50 entries, resulting in a candidate entry set of approximately 100 to 140 after the union of the three methods. After fine-tuning by the cross-coding model, a first-order quantity of 20 candidate entries is retained. During the fine-tuning by the large language model, each batch contains 4 candidate entries, resulting in a total of 5 batches. This embodiment achieves higher relevance coverage with a wider initial recall, while simultaneously increasing the number of entries retained during fine-tuning in tandem with the batch size, maintaining the per-target invocation scale of the large language model at a constant order of magnitude related to the number of candidates. This balances recall rate and computational resource consumption on a larger entry database. Furthermore, this embodiment retains a maximum of 20 keywords during keyword extraction to accommodate entries with longer description fields.

[0057] In another embodiment of this application, hierarchical structure association recall only includes sibling node candidates in the results, excluding cousin node candidates. This is suitable for scenarios with deep document hierarchies and weak correlation between cousin nodes, reducing noise in the candidate item set. Correspondingly, vector semantic similarity recall and keyword inverted index recall each select the top 20 items. In the deduplication process of step five, in addition to retaining the conflict resolution rule of prioritizing strong dependencies, this embodiment also marks the directed edge as a high-confidence relationship when the same pair of items is repeatedly judged as a potential influence and the judgment reasons are highly consistent, so that it can be presented first in subsequent change impact analysis. This embodiment is suitable for scenarios with high requirements for result accuracy and tolerable slight decrease in the initial recall rate.

[0058] This embodiment also provides an automatic extraction device for the logical relationship of demand items based on a three-way fusion funnel, corresponding to the above method. The device includes: The hierarchical context assembly module is configured to assemble the hierarchical context text of the target requirement item, wherein the hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure; The three-way parallel recall module is configured to perform three-way recall based on the hierarchical context text, including vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall, and then take the union of the results of the three-way recall and exclude the target requirement item itself to obtain the candidate item set; The cross-coding fine ranking module is configured to fine-rank the candidate item set using the cross-coding model and retain the first number of candidate items with the highest relevance after fine ranking. The batch-by-batch fine-judgment module of the large language model is configured to split the retained candidate entries into multiple batches, construct structured prompt words for each batch and send them into the large language model for batch-by-batch fine-judgment, and obtain structured relation data including target identifier, relation type and judgment reason; The relation deduplication and graph storage module is configured to deduplicat the structured relation data and persistently store the deduplicated relations in the form of directed edges in the graph database.

[0059] The modules mentioned above are connected sequentially in the form of data streams, with the output of the previous module serving as the input of the next module, together completing the automatic extraction of the logical relationships of the target requirement items.

[0060] like Figure 3As shown, the demand item processing device described in various embodiments of the present invention can be implemented in various hardware forms. In one implementation, the demand item processing device includes one or more processors, a storage device, a communication interface, and a bus connecting the above components. The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments. The communication interface is used for data interaction between the demand item processing device and the demand item library, vector database, inverted index storage, and graph database. The processor can be a general-purpose processor such as a central processing unit, a graphics processing unit, or a digital signal processor. The computationally intensive links such as vector retrieval and model inference involved in the present invention can also be implemented by dedicated hardware logic components such as field-programmable gate arrays, application-specific integrated circuits, or systems-on-a-chip, or by a general-purpose processor and dedicated hardware logic components working together. The present invention does not limit this.

[0061] like Figure 4 As shown, the methods described in the various embodiments of the present invention can be carried out by a computer program product. In one implementation, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the methods described in any of the above embodiments. The computer-readable storage medium can be an electrical, magnetic, optical, electromagnetic, or semiconductor system, apparatus, or device, or any suitable combination thereof, and more specific examples include, but are not limited to, read-only memory, random access memory, flash memory, optical fiber, portable compact disk read-only memory, and magnetic storage devices. The computer program can be written in any combination of one or more programming languages ​​and can be downloaded and installed on a corresponding device via a communication network for execution.

[0062] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0063] It should be noted that the terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein.

[0064] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0065] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatial relative descriptions used herein will be interpreted accordingly.

[0066] In the detailed description above, reference has been made to the accompanying drawings, which form part of this document. In the drawings, similar symbols typically identify similar parts unless the context otherwise indicates otherwise. The illustrated embodiments described in the detailed specification, drawings, and claims are not intended to be limiting. Other embodiments may be used and other changes may be made without departing from the spirit or scope of the subject matter presented herein.

[0067] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatically extracting logical relationships of requirement items based on a three-way fusion funnel, applied to a requirement item processing device, wherein the requirement items are stored in a requirement item library with a tree-like hierarchical structure, characterized in that... The method includes: S1: Assemble the hierarchical context text of the target requirement item, wherein the hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure; S2: Based on the hierarchical context text, perform three-way recall in parallel. The three-way recall includes vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall. The results of the three-way recall are combined and the target requirement item itself is excluded to obtain a candidate item set. S3: The candidate item set is finely ranked using a cross-coding model, and the first number of candidate items with the highest relevance after fine ranking are retained; S4: The retained candidate entries are split into multiple batches. For each batch, structured prompt words are constructed and fed into the large language model for batch-by-batch fine judgment to obtain structured relation data. The structured relation data includes target identifier, relation type and judgment reason. S5: After deduplication of the structured relational data, it is persistently stored in the graph database in the form of directed edges.

2. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, In S1, the hierarchical context text for assembling the target requirement item includes: tracing upwards from the parent node identifier chain of the target requirement item in the requirement item library to the root node; The name fields of all ancestor nodes on the tracing path are concatenated in order from the root node to the target requirement item to form the path information; The description field of the target requirement entry is appended after the path information to form the hierarchical context text.

3. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, The vector semantic similarity recall includes: feeding the hierarchical context text into an embedding model and outputting the corresponding dense floating-point vector; performing cosine similarity retrieval in the vector database using the dense floating-point vector as the query condition, excluding itself and sorting in descending order of similarity, and taking the second number of the top-ranked entries as the result of the vector semantic similarity recall, wherein the first number is less than the second number.

4. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, The keyword inverted index retrieval includes: performing keyword extraction on the hierarchical context text; the keyword extraction includes extracting combinations of numerical values ​​and units using regular expressions, extracting continuous sequences of English letters with a length of not less than two, and segmenting Chinese words using a word segmentation tool and filtering out single characters, pure numbers, and stop words; merging the three results, removing duplicates, and taking a preset upper limit of keywords; querying the inverted index table using the keywords as query conditions, and sorting them in descending order by the number of keywords hit; taking the third-highest number of required entries as the result of the keyword inverted index retrieval; the inverted index table uses the combination of keywords and entry identifiers as the composite primary key.

5. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, The hierarchical structure association recall includes: querying the parent node identifier and grandparent node identifier of the target requirement item; when the parent node identifier is valid, finding other leaf nodes under the parent node whose description field is not empty and which have no child nodes as sibling node candidates; when the grandparent node identifier is valid, finding the leaf nodes of each subdirectory under the grandparent node as cousin node candidates; and taking the union of the sibling node candidates and the cousin node candidates as the result of the hierarchical structure association recall.

6. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, In S3, the step of refining the candidate item set through a cross-coding model and retaining the first number of candidate items with the highest relevance after refining includes: obtaining the hierarchical context text of each candidate item in the candidate item set; Organize the hierarchical context text of the target requirement item and the hierarchical context text of each candidate item into text pairs, and truncate the length of the text pairs; The text pairs are fed into the cross-coding model, which outputs a relevance score for each text pair. Sort the candidate entries in descending order of their relevance scores and retain the first number of entries that rank highest.

7. The method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to claim 1, characterized in that, In S4, the construction of structured prompt words for each batch and their input into a large language model for batch-by-batch fine-tuning to obtain structured relation data includes: splitting the retained candidate entries into multiple batches according to a preset batch size; For each batch, construct structured prompts that include role settings, source item information, a list of candidate items for this batch, judgment rules, and output format requirements; The structured prompts are fed into the large language model, which then returns a result in the form of a JSON array. Perform multi-layer fault-tolerant parsing on the JSON array. The multi-layer fault-tolerant parsing includes prioritizing standard parsing, scanning curly brace objects line by line for separate parsing when standard parsing fails, and cleaning up marker characters. The relationship types include a first relationship type representing strong dependency and a second relationship type representing potential influence.

8. An automatic extraction device for logical relationships of demand items based on a three-way fusion funnel, characterized in that, include: The hierarchical context assembly module is configured to assemble the hierarchical context text of the target requirement item, wherein the hierarchical context text includes the path information and description information of the target requirement item in the tree-like hierarchical structure; The three-way parallel recall module is configured to perform three-way recall based on the hierarchical context text, including vector semantic similarity recall, keyword inverted index recall, and hierarchical structure association recall, and then take the union of the results of the three-way recall and exclude the target requirement item itself to obtain the candidate item set; The cross-coding fine ranking module is configured to fine-rank the candidate item set through the cross-coding model and retain the first number of candidate items with the highest relevance after fine ranking. The batch-by-batch fine-judgment module of the large language model is configured to split the retained candidate entries into multiple batches, construct structured prompt words for each batch and send them into the large language model for batch-by-batch fine-judgment, and obtain structured relation data including target identifier, relation type and judgment reason; The relation deduplication and graph storage module is configured to deduplicat the structured relation data and persistently store the deduplicated relations in the form of directed edges in the graph database.

9. An electronic device, characterized in that, The device includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the automatic extraction method for demand item logical relationships based on a three-way fusion funnel according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for automatically extracting the logical relationship of demand items based on a three-way fusion funnel according to any one of claims 1 to 7.