A method for generating a document based on a multi-source alignment matrix and related products
Patent Information
- Application Number
- CN202611132086.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-16
AI Technical Summary
然而,然而,该方法因向量检索的召回率不可控,导致部分需求条目无法检索到对应的参考内容,所生成的设计文档中设计点缺失,且已有设计点缺乏可追溯的证据支撑,致使所生成的文档质量参差不齐
从上述技术方案可知,本申请提供的一种基于多源对齐矩阵的文档的生成方法及相关产品,所述方法包括:首先,获取多源对齐矩阵,多源对齐矩阵的行对应多个需求条目,列对应多个证据源,每个矩阵元素用于表征各需求条目在多个证据源下分别对应的证据等级。随后,将多源对齐矩阵中各需求条目对应的证据等级为第一类证据等级的比例与第一比例阈值进行比较,确定比较结果。接着,将多源对齐矩阵中证据等级为第二类证据等级对应的需求条目标记为待确认,得到更新后的多源对齐矩阵。最后,在比较结果满足预设的达标条件的情况下,基于更新后的多源对齐矩阵,生成文档,文档包括正文部分和待确认条目清单,其中,正文部分为包括多个需求条目对应的设计内容,且每个设计内容均标注对应的证据等级,待确认条目清单为标记为待确认的需求条目汇总而成。
Smart Images

Figure CN122925616A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method for generating documents based on a multi-source alignment matrix and related products. Background Technology
[0002] In recent years, with the continuous expansion of enterprise software scale and the increasing complexity of business processes, the writing of technical design documents has become a crucial part of the software development process. High-quality technical design documents not only need to fully cover all functional points in the requirements document, but also need to provide reliable sources of evidence for each design conclusion, ensuring the rationality and traceability of the design solution.
[0003] Currently, there is some research on methods for generating design documents based on large language models. A common approach involves vectorizing key information in the requirements document and retrieving the most similar document fragments from a historical design document database as references to guide the large language model in generating the design document. However, this method suffers from uncontrollable recall rates in vector retrieval, resulting in some requirements items failing to find corresponding references. Consequently, the generated design documents often lack design points, and existing design points lack traceable evidence, leading to inconsistent document quality. Summary of the Invention
[0004] This application provides a document generation method and related products based on a multi-source alignment matrix, which enables each requirement item to have corresponding design content in the document and each design content to have a traceable source of evidence. At the same time, requirement items with insufficient evidence are presented in a list format.
[0005] In a first aspect, embodiments of this application provide a method for generating documents based on a multi-source alignment matrix, the method comprising: Obtain a multi-source alignment matrix, wherein rows of the multi-source alignment matrix correspond to multiple requirement items, columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under the multiple evidence sources; The proportion of the evidence level corresponding to each requirement item in the multi-source alignment matrix that is of the first type of evidence level is compared with a first proportion threshold to determine the comparison result. Mark the requirement item corresponding to the second type of evidence level in the multi-source alignment matrix as pending confirmation to obtain the updated multi-source alignment matrix; If the comparison result meets the preset compliance conditions, a document is generated based on the updated multi-source alignment matrix. The document includes a main body and a list of items to be confirmed. The main body includes the design content corresponding to the multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
[0006] One feasible implementation includes comparing the proportion of evidence levels of the first type in the multi-source alignment matrix with a first proportion threshold to determine the comparison result, comprising: Traverse each row of the multi-source alignment matrix and count the number of required items whose evidence level is the first type of evidence level to obtain the first number; Based on the first quantity and the total number of the requirement items in the multi-source alignment matrix, determine the proportion of the evidence level in the multi-source alignment matrix that is of the first type of evidence level; The ratio is compared with the first ratio threshold to determine the comparison result.
[0007] One feasible implementation is that the plurality of evidence sources include source code evidence sources, historical reference evidence sources, and demand inference evidence sources; The source code evidence is the source code related to the multiple requirement items; The historical reference evidence source is historical reference information related to the multiple requirement items; The source of evidence for demand inference is inference information related to the multiple demand items.
[0008] One feasible implementation of the method further includes: Extract architectural intent from the historical reference information; Based on the aforementioned architectural intent, the implementation strategies corresponding to the multiple requirement items are determined, resulting in a decision list; The process of generating a document based on the updated multi-source alignment matrix includes: The document is generated based on the updated multi-source alignment matrix and the decision list.
[0009] One feasible implementation further includes, before obtaining the multi-source alignment matrix: Obtain and parse the requirements document to obtain the multiple requirements items; Each of the aforementioned requirement items is compared with the source code evidence source. If the source code evidence source contains the corresponding source code, the source code evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. Each of the aforementioned requirement items is compared with the historical reference evidence source. If the historical reference evidence source contains corresponding historical reference information, the historical reference evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. Each of the aforementioned requirement items is compared with the requirement inference evidence source. If the requirement inference evidence source contains corresponding inference information, the requirement inference evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. The multi-source alignment matrix is constructed based on each of the aforementioned requirement items, the source code evidence level, the historical reference evidence level, and the requirement inference evidence level.
[0010] One feasible implementation is that the first type of evidence level is either the source code evidence level or the historical reference evidence level. The second type of evidence level is invalid for the source code evidence level, the historical reference evidence level, and the demand inference evidence level.
[0011] One feasible implementation is that the preset compliance condition is that the proportion is greater than or equal to the first proportion threshold.
[0012] Secondly, embodiments of this application provide a document generation apparatus based on a multi-source alignment matrix, comprising: The matrix acquisition module is used to acquire a multi-source alignment matrix, wherein the rows of the multi-source alignment matrix correspond to multiple requirement items, the columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under the multiple evidence sources. The result determination module is used to compare the proportion of the evidence level corresponding to each requirement item in the multi-source alignment matrix that is of the first type of evidence level with a first proportion threshold, and determine the comparison result. The matrix update module is used to mark the requirement items in the multi-source alignment matrix that correspond to the second type of evidence level as pending confirmation, so as to obtain the updated multi-source alignment matrix. The document generation module is used to generate a document based on the updated multi-source alignment matrix when the comparison result meets the preset compliance conditions. The document includes a main body and a list of items to be confirmed. The main body includes the design content corresponding to the multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
[0013] Thirdly, embodiments of this application provide an electronic device, the device including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the document generation method based on the multi-source alignment matrix described above.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program, which, when executed by a terminal device, implements any of the implementation steps of the above-described document generation method based on a multi-source alignment matrix.
[0015] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: As can be seen from the above technical solution, this application provides a document generation method and related products based on a multi-source alignment matrix. The method includes: First, obtaining a multi-source alignment matrix, where rows correspond to multiple requirement items and columns correspond to multiple evidence sources. Each matrix element is used to characterize the evidence level corresponding to each requirement item under multiple evidence sources. Then, comparing the proportion of requirement items in the multi-source alignment matrix corresponding to the first type of evidence level with a first proportion threshold to determine the comparison result. Next, marking requirement items in the multi-source alignment matrix corresponding to the second type of evidence level as pending confirmation, resulting in an updated multi-source alignment matrix. Finally, if the comparison result meets preset compliance conditions, a document is generated based on the updated multi-source alignment matrix. The document includes a main text and a list of items to be confirmed. The main text includes design content corresponding to multiple requirement items, and each design content is labeled with its corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as pending confirmation.
[0016] As can be seen, this application obtains a multi-source alignment matrix, where each matrix element represents the evidence level corresponding to each requirement item under multiple evidence sources. Based on this, this application compares the proportion of evidence level 1 in the multi-source alignment matrix with a first proportion threshold to determine the comparison result, thereby quantitatively evaluating the overall evidence quality of the multi-source alignment matrix and achieving pre-control of the document generation threshold. Simultaneously, requirement items corresponding to evidence level 2 in the multi-source alignment matrix are marked as pending confirmation, and requirement items with insufficient evidence are identified and marked from the multi-source alignment matrix, resulting in an updated multi-source alignment matrix. Finally, if the comparison results meet the preset criteria, a document is generated based on the updated multi-source alignment matrix. The main body of the document includes design content corresponding to multiple requirement items, with each design item marked with a corresponding level of evidence. This ensures that each requirement item has corresponding design content in the document, and each design content has a traceable source of evidence. At the same time, the document also includes a list of items to be confirmed, which is a summary of requirement items marked as requiring confirmation. This allows requirement items with insufficient evidence to be presented in a centralized manner through a list, thereby solving the problems of missing design points and lack of evidence to support design conclusions in the prior art. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a document generation method based on a multi-source alignment matrix, provided for embodiments of this application; Figure 2 This is a schematic diagram of a document generation device based on a multi-source alignment matrix, provided in an embodiment of this application. Detailed Implementation
[0018] As mentioned earlier, various technical design document generation schemes already exist in this field. For example, schemes based on RAG retrieval recall relevant technical document fragments for generation using vector similarity retrieval; however, the recall rate of vector retrieval is uncontrollable, and the generated design points lack traceable evidence support. Furthermore, most existing schemes rely on only a single source of evidence, lacking cross-validation and comprehensive consideration of multi-source evidence.
[0019] To address the aforementioned issues, this application provides a document generation method and related products based on a multi-source alignment matrix. The method includes: First, obtaining a multi-source alignment matrix. Rows in the matrix correspond to multiple requirement items, and columns correspond to multiple evidence sources. Each matrix element represents the evidence level corresponding to each requirement item under the multiple evidence sources. Next, comparing the proportion of requirement items in the multi-source alignment matrix corresponding to the first type of evidence level with a first proportion threshold to determine the comparison result. Then, marking requirement items in the multi-source alignment matrix corresponding to the second type of evidence level as pending confirmation, resulting in an updated multi-source alignment matrix. Finally, if the comparison result meets preset compliance conditions, generating a document based on the updated multi-source alignment matrix. The document includes a main text and a list of pending confirmation items. The main text contains design content corresponding to multiple requirement items, with each design content labeled with its corresponding evidence level. The list of pending confirmation items is a summary of the requirement items marked as pending confirmation.
[0020] As can be seen, this application obtains a multi-source alignment matrix, where each matrix element represents the evidence level corresponding to each requirement item under multiple evidence sources. Based on this, this application compares the proportion of evidence level 1 in the multi-source alignment matrix with a first proportion threshold to determine the comparison result, thereby quantitatively evaluating the overall evidence quality of the multi-source alignment matrix and achieving pre-control of the document generation threshold. Simultaneously, requirement items corresponding to evidence level 2 in the multi-source alignment matrix are marked as pending confirmation, and requirement items with insufficient evidence are identified and marked from the multi-source alignment matrix, resulting in an updated multi-source alignment matrix. Finally, if the comparison results meet the preset criteria, a document is generated based on the updated multi-source alignment matrix. The main body of the document includes design content corresponding to multiple requirement items, with each design item marked with a corresponding level of evidence. This ensures that each requirement item has corresponding design content in the document, and each design content has a traceable source of evidence. At the same time, the document also includes a list of items to be confirmed, which is a summary of requirement items marked as requiring confirmation. This allows requirement items with insufficient evidence to be presented in a centralized manner through a list, thereby solving the problems of missing design points and lack of evidence to support design conclusions in the prior art.
[0021] It should be noted that the embodiments of this application are not limited to the executing entity of the document generation method based on the multi-source alignment matrix. For example, the document generation method based on the multi-source alignment matrix of this application can be applied to information processing devices such as servers or terminal devices. The server can be a standalone server, a cluster server, or a cloud server. The terminal device can be an electronic device such as a smartphone, computer, personal digital assistant (PDA), or tablet computer.
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0023] Figure 1 This is a flowchart illustrating a document generation method based on a multi-source alignment matrix, provided as an embodiment of this application. (Combined with...) Figure 1 As shown, it may include steps S101-S104.
[0024] S101: Obtain the multi-source alignment matrix. The rows of the multi-source alignment matrix correspond to multiple requirement items, and the columns correspond to multiple evidence sources. Each matrix element is used to represent the evidence level corresponding to each requirement item under multiple evidence sources.
[0025] In this embodiment of the application, multiple requirement entries are obtained by acquiring and parsing the requirement document. These multiple requirement entries are used as row indices of the multi-source alignment matrix, so that each requirement entry has a corresponding storage location in the multi-source alignment matrix.
[0026] Meanwhile, the multiple evidence sources in this application embodiment include source code evidence sources, historical reference evidence sources, and requirement inference evidence sources. The source code evidence source is the source code related to multiple requirement items. When comparing in the source code evidence source, the corresponding controller, service layer, and / or entity class is located based on the key information of each requirement item, and the field definitions and interface specifications in the corresponding source code are obtained. The historical reference evidence source is historical reference information related to multiple requirement items. Historical reference information related to each requirement item is retrieved from the historical design document database. The requirement inference evidence source is inferred information related to multiple requirement items. When comparing in the requirement inference evidence source, reasonable inferences can be made based on the logical descriptions in the requirement documents to obtain the inferred information.
[0027] Furthermore, for each requirement item, comparisons are made across multiple sources of evidence to determine the level of evidence for each requirement item within each source of evidence.
[0028] Specifically, each requirement item is compared with the source code evidence source. If the corresponding source code exists in the source code evidence source, the source code evidence level corresponding to that requirement item is marked as valid; otherwise, it is marked as invalid. Each requirement item is also compared with the historical reference evidence source. If the corresponding historical reference information exists in the historical reference evidence source, the historical reference evidence level corresponding to that requirement item is marked as valid; otherwise, it is marked as invalid. Finally, each requirement item is compared with the requirement inference evidence source. If the corresponding inference information exists in the requirement inference evidence source, the requirement inference evidence level corresponding to that requirement item is marked as valid; otherwise, it is marked as invalid. Based on each requirement item and its corresponding source code evidence level, historical reference evidence level, and requirement inference evidence level, a multi-source alignment matrix is constructed.
[0029] Therefore, in this embodiment, the rows of the multi-source alignment matrix correspond to multiple requirement items, the columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under multiple evidence sources. The evidence level can include source code evidence level, historical reference evidence level, and requirement inference evidence level, with source code evidence level being higher than historical reference evidence level, and historical reference evidence level being higher than requirement inference evidence level.
[0030] S102: Compare the proportion of evidence levels corresponding to each requirement item in the multi-source alignment matrix that are of the first type of evidence level with the first proportion threshold to determine the comparison result.
[0031] In this embodiment, the process first iterates through each row of the multi-source alignment matrix and counts the number of requirement items with the first level of evidence, which is then used as the first quantity. Next, the first quantity is compared with the total number of requirement items in the multi-source alignment matrix to determine the proportion of items with the first level of evidence in the matrix. Finally, this proportion is compared with a first proportion threshold to determine the comparison result.
[0032] It should be noted that the first type of evidence level in this application embodiment is either source code evidence level or historical reference evidence level. That is, for any demand item, as long as valid evidence can be obtained from at least one of the source code evidence source or historical reference evidence source, the demand item belongs to the first type of evidence level. In other words, the first type of evidence level has traceable objective evidence, and therefore serves as the basis for measuring the overall evidence quality.
[0033] Furthermore, the first proportion threshold is used to measure whether the overall evidence quality of the multi-source alignment matrix meets the minimum requirements for generating a document. By comparing the proportion of the first type of evidence level with the first proportion threshold, the overall evidence quality of the matrix can be pre-assessed before generating the document, avoiding direct document generation when the overall evidence is insufficient. Preferably, the first proportion threshold can be 60%.
[0034] S103: Mark the requirement item in the multi-source alignment matrix that corresponds to the second type of evidence level as pending confirmation, and obtain the updated multi-source alignment matrix.
[0035] In this embodiment, the second type of evidence level is invalid for all three evidence sources: source code evidence level, historical reference evidence level, and demand inference evidence level. Specifically, each row of the multi-source alignment matrix is traversed. For each row, if the corresponding demand item has an invalid evidence level under all three evidence sources (source code evidence source, historical reference evidence source, and demand inference evidence source), then the demand item is marked as pending confirmation. After marking, the updated multi-source alignment matrix is obtained.
[0036] It should be noted that the updated multi-source alignment matrix in this embodiment is obtained by adding corresponding labeling information to the original multi-source alignment matrix for the requirement items marked as pending confirmation. Requirement items marked as pending confirmation refer to those for which no valid evidence can be obtained from any of the three evidence sources. By explicitly marking these requirement items in the multi-source alignment matrix, they are effectively distinguished from requirement items with sufficient evidence, enabling requirement items with insufficient evidence to be identified and tracked in subsequent processes.
[0037] Simultaneously, marking the requirement items corresponding to the second level of evidence as pending confirmation allows for the rapid identification of requirement items from the multi-source alignment matrix that lack valid evidence from all three sources, and distinguishing them from the well-supported requirement items by marking them. This marking operation provides the data foundation for the subsequent generation of the list of pending confirmation items, enabling the final document to present all requirement items with insufficient evidence in a centralized list format, facilitating reviewers to quickly locate and supplement them.
[0038] S104: If the comparison results meet the preset compliance conditions, generate a document based on the updated multi-source alignment matrix. The document includes a main body and a list of items to be confirmed. The main body contains the design content corresponding to multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
[0039] In this embodiment of the application, the preset compliance condition is that the proportion of evidence with the first level of evidence in the multi-source alignment matrix is greater than or equal to a first proportion threshold, that is, the proportion of evidence with the first level of evidence in the multi-source alignment matrix is greater than or equal to 60%. At this time, when the above comparison result meets the preset compliance condition, a document can be generated based on the updated multi-source alignment matrix.
[0040] Furthermore, embodiments of this application can extract architectural intent from historical reference information. This architectural intent includes five dimensions: architectural philosophy, reserved extension entry points, team division of labor, development conventions, and explicit constraints. Specifically, the architectural philosophy characterizes the architectural concept of module splitting and layering extracted from historical design document pairs; the reserved extension entry points characterize the strategy extension points and interface extension points extracted from historical design document pairs; the team division of labor characterizes the division of responsibilities among teams or modules extracted from historical design document pairs; the development conventions characterize development conventions such as package paths, interface naming, and object mapping extracted from historical design document pairs; and the explicit constraints characterize the inviolable hard rules extracted from historical design document pairs.
[0041] This application's embodiments extract architectural intent from historical reference information, transforming it from a simple copy of example documents into structured, transferable architectural knowledge. This architectural intent encompasses dimensions such as team development conventions and architectural philosophy, making the implicit architectural intent in historical designs explicit. This solves the problem in template generation schemes based on Few-shot prompts where the lack of structured historical references hinders the transmission of architectural intent and team development conventions.
[0042] Meanwhile, this application embodiment achieves multi-source information alignment of requirement documents, source code, and historical design information by mapping rows to requirement items, columns to source code evidence sources, historical reference evidence sources, and requirement inference evidence sources in a multi-source alignment matrix. This overcomes the technical limitations of traditional solutions that only complete and generate within the current code scope. Through the structured organization of the aforementioned multi-source alignment matrix and the extraction of architectural intent, the historical evolution of the team's design style can be captured and used to guide the current design, thereby solving the problems of code understanding-based auxiliary generation solutions being unable to perform cross-source alignment and capture the historical evolution of the team's design style.
[0043] Therefore, this embodiment of the application extracts the architectural intent from the above five dimensions, transforming historical reuse from template copying to pattern inheritance, thus avoiding architectural degradation caused by simple copy-and-paste. Based on this, implementation strategies corresponding to multiple requirement items are determined according to the architectural intent, resulting in a decision list. Then, based on the updated multi-source alignment matrix and the decision list, a document is generated. This ensures that the generated document inherits reasonable architectural patterns and design concepts from the historical design, rather than directly copying the specific content of the historical implementation.
[0044] In the specific implementation of document generation, a draft document can be generated first, based on the updated multi-source alignment matrix and decision list. This draft includes the main text and a list of items to be confirmed. The main text includes the design content corresponding to each requirement item, and each design item is marked with a corresponding level of evidence. The list of items to be confirmed summarizes the requirement items marked as pending confirmation.
[0045] Furthermore, after generating the initial draft, a self-check can be performed on the draft to assess its requirement coverage and evidence completeness, identifying any omissions or insufficient evidence. Specifically, the design content in the initial draft can be compared one by one with the requirement items in the multi-source alignment matrix. Each requirement item can be checked to ensure it has a corresponding design element in the main text; any missing elements are marked as omissions. Simultaneously, each design element in the main text is checked to ensure it is labeled with its corresponding level of evidence; any unlabeled or incompletely labeled elements are marked as insufficient evidence. After the self-check, the review results are obtained.
[0046] Finally, the initial draft and review results are integrated to generate the final technical design document. Specifically, any omissions or insufficient evidence found during the self-check are supplemented and corrected in the final draft to ensure that it meets the preset requirements in terms of requirement coverage and evidence completeness.
[0047] It should be noted that the document generated in this embodiment includes both a main body and a list of items to be confirmed, which together constitute a complete design document. The main body includes the design content corresponding to all requirement items, ensuring that each requirement item has corresponding design content in the document, achieving complete coverage of requirement items. Furthermore, each design content is marked with a corresponding level of evidence, ensuring that each design point has a traceable source of evidence. Reviewers can quickly determine the reliability of each design conclusion based on the level of evidence. The list of items to be confirmed presents all requirement items marked as requiring confirmation, allowing design points with insufficient evidence to be presented in a centralized manner rather than scattered throughout the main body, facilitating reviewers to quickly locate and supplement the evidence.
[0048] Based on the steps S101-S104 above, firstly, a multi-source alignment matrix is obtained. Rows in the multi-source alignment matrix correspond to multiple requirement items, and columns correspond to multiple evidence sources. Each matrix element represents the evidence level corresponding to each requirement item under multiple evidence sources. Then, the proportion of requirement items in the multi-source alignment matrix corresponding to the first type of evidence level is compared with a first proportion threshold to determine the comparison result. Next, requirement items in the multi-source alignment matrix corresponding to the second type of evidence level are marked as pending confirmation, resulting in an updated multi-source alignment matrix. Finally, if the comparison result meets preset compliance conditions, a document is generated based on the updated multi-source alignment matrix. The document includes a main text and a list of items to be confirmed. The main text contains design content corresponding to multiple requirement items, and each design content is labeled with its corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as pending confirmation. Therefore, this application obtains a multi-source alignment matrix, and each matrix element represents the evidence level corresponding to each requirement item under multiple evidence sources. Based on this, this application compares the proportion of evidence level 1 in the multi-source alignment matrix with a first proportion threshold to determine the comparison result, thereby quantitatively evaluating the overall evidence quality of the multi-source alignment matrix and achieving pre-control of the document generation threshold. Simultaneously, requirement items corresponding to evidence level 2 in the multi-source alignment matrix are marked as pending confirmation, and requirement items with insufficient evidence are identified and marked, resulting in an updated multi-source alignment matrix. Finally, if the comparison result meets preset compliance conditions, a document is generated based on the updated multi-source alignment matrix. The main body of the document includes design content corresponding to multiple requirement items, each design content being labeled with its corresponding evidence level, ensuring that each requirement item has corresponding design content in the document and that each design content has a traceable source of evidence. The document also includes a list of pending confirmation items, compiled from the requirement items marked as pending confirmation, allowing requirement items with insufficient evidence to be presented in a centralized list format, thus solving the problems of missing design points and lack of evidence supporting design conclusions in existing technologies.
[0049] Furthermore, this application embodiment can be illustrated using a technical design document generation project of a financial platform as an example. This financial platform already has over 20 historical design document libraries, covering 5 product lines, and currently needs to add two new business models to these product lines.
[0050] During implementation, the requirement document is first parsed to obtain multiple requirement items. Then, each requirement item is compared with the source code evidence source, historical reference evidence source, and requirement inference evidence source. Based on the comparison results, the evidence level of each requirement item under each evidence source is marked as valid or invalid, and a multi-source alignment matrix is constructed.
[0051] Next, the proportion of requirement items with the first level of evidence was calculated. This proportion reached the first threshold, thus meeting the eligibility criteria. Simultaneously, requirement items with the second level of evidence were marked as pending confirmation to obtain an updated multi-source alignment matrix. Based on this, architectural intent was extracted from historical reference information. Architectural intent was extracted from a historical design document library, and based on this intent, the implementation strategy was determined to be a strategy implementation class for a new pattern dimension, rather than directly copying historical implementation classes, resulting in a decision list. Finally, if the comparison results met the eligibility criteria, a document was generated based on the updated multi-source alignment matrix and the decision list. The document includes a main body and a list of items pending confirmation. The main body contains the design content corresponding to each requirement item, and each design content is marked with its corresponding level of evidence. The list of items pending confirmation summarizes the requirement items marked as pending confirmation.
[0052] Practical experience shows that the requirement coverage rate has increased from approximately 50% to 70% in the traditional way to 100%, achieving complete coverage of requirement items; the proportion of the first level of evidence has increased from less than 30% to 60%, ensuring that the vast majority of design points are supported by traceable objective evidence; the review rework rate has decreased from approximately 60% to approximately 15%, significantly improving review efficiency; and the generation time has been shortened from the traditional 3 to 5 days to 0.5 to 1 day, greatly improving the efficiency of design document generation. Furthermore, by extracting architectural intent, historical reuse has shifted from template copying to pattern inheritance, avoiding architectural degradation caused by simple copy-and-paste. This allows the generated documents to inherit reasonable architectural patterns and design concepts from historical designs, rather than directly copying the specific content of historical implementations.
[0053] Figure 2 This is a schematic diagram of a document generation device based on a multi-source alignment matrix, provided as an embodiment of this application. (Combined with...) Figure 2 As shown in the embodiments of this application, the document generation apparatus 200 based on a multi-source alignment matrix may include: The matrix acquisition module 201 is used to acquire a multi-source alignment matrix, wherein the rows of the multi-source alignment matrix correspond to multiple requirement items, the columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under the multiple evidence sources. The result determination module 202 is used to compare the proportion of the evidence level corresponding to each requirement item in the multi-source alignment matrix that is of the first type of evidence level with a first proportion threshold, and determine the comparison result. Matrix update module 203 is used to mark the requirement items in the multi-source alignment matrix that correspond to the second type of evidence level as pending confirmation, so as to obtain the updated multi-source alignment matrix; The document generation module 204 is used to generate a document based on the updated multi-source alignment matrix when the comparison result meets the preset compliance conditions. The document includes a main body and a list of items to be confirmed. The main body includes the design content corresponding to the multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
[0054] Optionally, the result determination module 202 is specifically used for: Traverse each row of the multi-source alignment matrix and count the number of required items whose evidence level is the first type of evidence level to obtain the first number; Based on the first quantity and the total number of the requirement items in the multi-source alignment matrix, determine the proportion of the evidence level in the multi-source alignment matrix that is of the first type of evidence level; The ratio is compared with the first ratio threshold to determine the comparison result.
[0055] Optionally, the plurality of evidence sources include source code evidence sources, historical reference evidence sources, and demand inference evidence sources; The source code evidence is the source code related to the multiple requirement items; The historical reference evidence source is historical reference information related to the multiple requirement items; The source of evidence for demand inference is inference information related to the multiple demand items.
[0056] Optionally, the document generation apparatus 200 based on the multi-source alignment matrix may include: The intent extraction module is used to extract the architectural intent from the historical reference information; The list generation module is used to determine the implementation strategies corresponding to the multiple requirement items based on the architecture intent, and to obtain a decision list; The document generation module 204 is specifically used for: The document is generated based on the updated multi-source alignment matrix and the decision list.
[0057] Before obtaining the multi-source alignment matrix, the document generation apparatus 200 based on the multi-source alignment matrix may include: The item generation module is used to obtain and parse the requirement document to obtain the multiple requirement items; The source code level confirmation module is used to compare each of the aforementioned requirement items with the source code evidence source. If the source code evidence source contains the corresponding source code, the source code evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. The historical level determination module is used to compare each of the aforementioned requirement items with the historical reference evidence source. If the historical reference evidence source contains corresponding historical reference information, the historical reference evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. The demand level determination module is used to compare each demand item with the demand inference evidence source. If there is corresponding inference information in the demand inference evidence source, the demand inference evidence level corresponding to each demand item is marked as valid; otherwise, it is marked as invalid. The matrix construction module is used to construct the multi-source alignment matrix based on each of the aforementioned requirement items, the source code evidence level, the historical reference evidence level, and the requirement inference evidence level.
[0058] Optionally, the first type of evidence level is either the source code evidence level or the historical reference evidence level. The second type of evidence level is invalid for the source code evidence level, the historical reference evidence level, and the demand inference evidence level.
[0059] Optionally, the preset compliance condition is that the proportion is greater than or equal to the first proportion threshold.
[0060] Furthermore, embodiments of this application also provide an electronic device, including: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the document generation method based on the multi-source alignment matrix described above.
[0061] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program, which, when executed by a terminal device, implements any of the implementation steps of the above-described document generation method based on a multi-source alignment matrix.
[0062] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on describing the differences from other embodiments. The same or similar parts between the various embodiments can be referred to mutually.
[0063] The system disclosed in the embodiments is described in a relatively simple manner because it corresponds to the method disclosed in the embodiments. For relevant details, please refer to the method section.
[0064] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0065] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating documents based on a multi-source alignment matrix, characterized in that, The method includes: Obtain a multi-source alignment matrix, wherein rows of the multi-source alignment matrix correspond to multiple requirement items, columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under the multiple evidence sources; The proportion of the evidence level corresponding to each requirement item in the multi-source alignment matrix that is of the first type of evidence level is compared with a first proportion threshold to determine the comparison result. Mark the requirement item corresponding to the second type of evidence level in the multi-source alignment matrix as pending confirmation to obtain the updated multi-source alignment matrix; If the comparison result meets the preset compliance conditions, a document is generated based on the updated multi-source alignment matrix. The document includes a main body and a list of items to be confirmed. The main body includes the design content corresponding to the multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
2. The method according to claim 1, characterized in that, The step of comparing the proportion of evidence levels of the first type in the multi-source alignment matrix with a first proportion threshold to determine the comparison result includes: Traverse each row of the multi-source alignment matrix and count the number of required items whose evidence level is the first type of evidence level to obtain the first number; Based on the first quantity and the total number of the requirement items in the multi-source alignment matrix, determine the proportion of the evidence level in the multi-source alignment matrix that is of the first type of evidence level; The ratio is compared with the first ratio threshold to determine the comparison result.
3. The method according to claim 1, characterized in that, The multiple sources of evidence include source code evidence, historical reference evidence, and demand inference evidence. The source code evidence is the source code related to the multiple requirement items; The historical reference evidence source is historical reference information related to the multiple requirement items; The source of evidence for demand inference is inference information related to the multiple demand items.
4. The method according to claim 3, characterized in that, The method further includes: Extract architectural intent from the historical reference information; Based on the aforementioned architectural intent, the implementation strategies corresponding to the multiple requirement items are determined, resulting in a decision list; The process of generating a document based on the updated multi-source alignment matrix includes: The document is generated based on the updated multi-source alignment matrix and the decision list.
5. The method according to claim 3, characterized in that, Before obtaining the multi-source alignment matrix, the method further includes: Obtain and parse the requirements document to obtain the multiple requirements items; Each of the aforementioned requirement items is compared with the source code evidence source. If the source code evidence source contains the corresponding source code, the source code evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. Each of the aforementioned requirement items is compared with the historical reference evidence source. If the historical reference evidence source contains corresponding historical reference information, the historical reference evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. Each of the aforementioned requirement items is compared with the requirement inference evidence source. If the requirement inference evidence source contains corresponding inference information, the requirement inference evidence level corresponding to each of the aforementioned requirement items is marked as valid; otherwise, it is marked as invalid. The multi-source alignment matrix is constructed based on each of the aforementioned requirement items, the source code evidence level, the historical reference evidence level, and the requirement inference evidence level.
6. The method according to claim 5, characterized in that, The first type of evidence level is either the source code evidence level or the historical reference evidence level. The second type of evidence level is invalid for the source code evidence level, the historical reference evidence level, and the demand inference evidence level.
7. The method according to claim 2, characterized in that, The preset compliance condition is that the proportion is greater than or equal to the first proportion threshold.
8. A document generation apparatus based on a multi-source alignment matrix, characterized in that, include: The matrix acquisition module is used to acquire a multi-source alignment matrix, wherein the rows of the multi-source alignment matrix correspond to multiple requirement items, the columns correspond to multiple evidence sources, and each matrix element is used to characterize the evidence level corresponding to each requirement item under the multiple evidence sources. The result determination module is used to compare the proportion of the evidence level corresponding to each requirement item in the multi-source alignment matrix that is of the first type of evidence level with a first proportion threshold, and determine the comparison result. The matrix update module is used to mark the requirement items in the multi-source alignment matrix that correspond to the second type of evidence level as pending confirmation, so as to obtain the updated multi-source alignment matrix. The document generation module is used to generate a document based on the updated multi-source alignment matrix when the comparison result meets the preset compliance conditions. The document includes a main body and a list of items to be confirmed. The main body includes the design content corresponding to the multiple requirement items, and each design content is marked with the corresponding evidence level. The list of items to be confirmed is a summary of requirement items marked as to be confirmed.
9. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform the steps of the document generation method based on a multi-source alignment matrix as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when executed by a terminal device, implements the steps of the document generation method based on a multi-source alignment matrix as described in any one of claims 1-7.