Multi-agent collaborative demand structuring and software cost estimation method
By employing a multi-agent collaborative approach, unstructured task specifications are processed automatically, addressing the issues of low efficiency, unstable quality, difficulty in ensuring traceability, and long quotation preparation cycles in existing technologies. This achieves efficient and accurate requirement structuring and cost estimation, meeting the high security and compliance requirements of military software engineering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SPACEFLIGHT TUOPUGAO SCI & TECH CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies lack comprehensive technical means to automatically understand the semantics of unstructured task specifications, transform them into a standard-compliant multi-level requirement structure, and automatically calculate compliant quotations. This results in low efficiency of requirement analysis, unstable quality, difficulty in ensuring traceability, long quotation preparation cycles, and poor accuracy, which cannot meet the high security and compliance requirements of military software engineering.
A multi-agent collaborative approach is adopted, including data acquisition and preprocessing, requirements understanding, document generation, and quotation calculation steps. Using deep convolutional neural networks, BiLSTM-CRF sequence labeling models, and BERT semantic analysis models, unstructured task books are automatically transformed into a five-level requirement structure of the GJB 5000B standard, generating compliant requirement specifications and quotation lists.
Significantly improves the efficiency of requirements analysis, reduces the requirement omission rate, achieves a standardized five-level requirements structure, establishes a complete traceability chain, improves the accuracy of quotations and document compliance, meets the requirements of high security and high compliance scenarios, and shortens the preparation cycle.
Smart Images

Figure CN122390775A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and software engineering, specifically relating to a method for structuring requirements and estimating software costs for multi-agent collaboration. Background Technology
[0002] Existing software project documentation still relies on manual requirements analysis, requiring system engineers to manually write requirements specifications by referring to the template in Appendix B of GJB5000B. This process is prone to omissions in functional point decomposition and lacks traceability. Furthermore, the preparation of the "Software Document No. 4" quotation takes 5 to 10 working days, consuming over 30% of the project timeline and significantly lagging behind the design, development, and manufacturing schedule. The writing process is cumbersome and prone to formatting errors and omissions. Traditional template tools cannot dynamically link project data, requiring manual input, which is ill-suited to frequent requirement changes. Existing tools such as DOORS and JIRA do not support the mandatory structure and review process of GJB 5000B, lack AI-driven compliance generation capabilities, and are prone to version confusion, revision record management difficulties, and non-compliance with strict GJB standards during multi-team collaboration.
[0003] Currently, the technical solutions adopted in the industry mainly include the following types.
[0004] Option 1: Rely on manual reading of the unstructured project task book line by line, and have engineers convert it into a software requirements specification that conforms to the GJB 5000B standard based on their personal experience. The whole process is highly dependent on personal knowledge accumulation and professional judgment.
[0005] Option 2: Use existing requirement management tools such as DOORS and JIRA to enter and manage requirement items, and classify and track requirements through the requirement management functions of the tools.
[0006] Option 3: Manually maintain the requirements traceability matrix, manually establish traceability relationships between the requirements specification, preliminary design specification, and test specification, and fill in the correspondence between requirement number, design number, and test number for each item.
[0007] Option 4: Estimate the number and complexity of features based on human experience, and have senior engineers manually prepare software cost estimates, referencing historical project data for comparative estimation.
[0008] Option 5: Manually prepare the document's formatting, chapter numbering, acceptance criteria, and other compliance information, and ensure that the document meets the format and content requirements of the GJB 5000B standard through manual review.
[0009] Option 6: Use a general-purpose large language model and artificial intelligence-assisted tools to assist in requirements analysis and document generation, and submit the task description text to a general artificial intelligence platform to obtain analysis results.
[0010] However, the aforementioned existing technical solutions have the following prominent drawbacks.
[0011] Defect 1: Inefficient and inconsistent quality of requirements analysis. Manually analyzing a medium-sized unstructured work order typically requires five to fifteen person-days, and the quality of the results is highly dependent on the individual engineer's experience and expertise. Studies show that the omission rate in manual requirements analysis is as high as 22%, and the analysis results from different engineers on the same work order vary significantly, leading to inconsistent quality of the requirements specification document.
[0012] Defect 2: Lack of a unified standard for requirement structuring. Existing requirement management tools such as DOORS and JIRA adopt a flat management model, which only supports simple grouping and tag management of requirement items. They cannot support the five-level requirement hierarchy structure of configuration items, categories, modules, sub-modules, and function points required by the GJB 5000B standard, and they cannot realize automatic association and structured mapping between different levels.
[0013] Defect 3: Traceability is difficult to guarantee. Manually maintaining the requirements tracking matrix is labor-intensive and cumbersome, and is prone to problems such as broken traceability chains, skipped numbering, and incorrect correspondence between requirements and design or testing. Once requirements change, the rate of omissions in manually updating the tracking matrix is extremely high, leading to frequent rework during review.
[0014] Defect 4: Long and inaccurate quotation preparation period. Traditional manual quotation preparation typically takes three to seven days, accounting for more than 30% of the project preparation period. Because the determination of functional complexity relies heavily on individual subjective experience, different estimators can arrive at significantly different conclusions regarding the complexity of the same functional point, resulting in quotation deviations often exceeding plus or minus 30%, severely impacting the project's economic feasibility assessment.
[0015] Defect 5: Document compliance is difficult to guarantee. Manually prepared requirements specifications generally suffer from problems such as non-standard formatting, chaotic chapter numbering, lack of quantifiable indicators for acceptance criteria, and incomplete metadata. According to statistics, the first-time pass rate of manually prepared versions of military software requirements specifications is only about 50%, and a large number of reworks seriously affect project progress.
[0016] Defect 6: Existing AI tools cannot meet military standards. General-purpose large language models lack a deep understanding of the GJB5000B standard system and cannot automatically generate a five-level hierarchical structure, standardized numbering system, and compliant quotation list that conform to military specifications. Furthermore, general-purpose AI tools are typically deployed in public cloud environments, which cannot meet the stringent data security and confidentiality requirements of military software engineering.
[0017] In summary, existing technologies lack a comprehensive approach capable of automatically understanding the semantics of unstructured task specifications, transforming them into a standard-compliant multi-level requirement structure, and automatically calculating compliant quotes. Specifically, existing technologies lack the following four key capabilities: First, they lack the professional semantic understanding capability for highly compliant and secure software terminology, making it impossible to accurately identify hierarchical relationships such as configuration items, categories, and modules; second, they lack a technical mechanism for automatically mapping natural language requirements to GJB 5000B templates; third, they lack a technical solution for automatically determining the complexity of functional points and calculating costs; and fourth, they lack the capability for automated compliance verification throughout the entire process. Therefore, there is an urgent need for an automated technical solution that integrates requirement understanding, document generation, and cost estimation. Summary of the Invention
[0018] To address the aforementioned issues, this invention proposes a multi-agent collaborative method for demand structuring and software cost estimation. This method automates the traditional manual demand analysis process, which requires five to fifteen person-days for cost estimation in Document No. 4 software, significantly reducing the demand omission rate and eliminating quality instability caused by differences in engineer experience during manual analysis.
[0019] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for structuring requirements and estimating software costs in a multi-agent collaborative manner, applicable to cost estimation of Document No. 4 software, includes the following steps: S1. Data acquisition and preprocessing steps: Obtain unstructured task book documents, perform format parsing and plain text extraction on the unstructured task book documents, and map non-standard terms into standardized terms through terminology standardization processing. S2. Requirements Understanding Steps: Collaborative reasoning and hierarchical structure inference are performed on the preprocessed plain text to transform the unstructured task book into five-level structured requirement data containing configuration items, categories, modules, sub-modules, and functional points; functional point entity recognition and extraction are performed on the extracted plain text; traceability identifiers and quantitative acceptance standards are generated based on the extracted functional point entities; the five-level structured requirement data is stored in JSON format as a unified input for downstream document generation and quotation calculation. S3. Document generation steps: Based on the template-driven document generation method, the five-level requirement structured data is mapped to the GJB 5000B Appendix B standard template stored in XML format. Template instantiation, hierarchical number generation, content filling and formatting, and compliance verification are performed to output a standardized requirement specification. S4. Quotation Calculation Steps: A two-level judgment method combining keyword matching and semantic classification of the BERT semantic analysis model is adopted to determine the complexity of each functional point in the five-level demand structured data, calculate labor costs, additional fees and taxes according to the complexity level, and generate a quotation list that conforms to the cost calculation specification. S5. Output Packaging Step: Version-identify and package the requirements specification and the quotation list for output.
[0020] A further step in the solution is that steps S3 and S4 are executed synchronously and in parallel.
[0021] The solution further includes: in step S1, the unstructured task book document includes documents in PDF and Word formats; For the unstructured task book document in PDF format, a layout analysis model based on deep convolutional neural networks is used for text recognition. The layout analysis model uses ResNet-50 as the backbone network to construct a multi-scale feature extraction network. It detects the title region, body text region and table region in the document through the region proposal network, and determines the title level based on the font size, bold attribute and indentation distance, so as to preserve the paragraph structure and title level information while extracting the text content. For the unstructured task book document in Word format, its OOXML internal structure is parsed, the main text paragraph content and built-in style attributes are extracted to infer the heading level, and the header, footer, comments and annotation information are removed. The identified and extracted text is uniformly converted into UTF-8 encoded plain text format; By using a pre-built software terminology mapping dictionary and implementing the longest matching algorithm based on the Trie tree data structure, the text is scanned sentence by sentence, and the non-standard terms are uniformly replaced with standardized terms.
[0022] The solution further includes: the software terminology mapping dictionary contains more than 5,000 professional terms and their standardized mapping rules, covering equipment system terms, software engineering terms, security and confidentiality terms, and quality management terms.
[0023] The solution further includes: In step S2, the functional point entity recognition and extraction specifically includes: The preprocessed text is segmented into sentences and converted into word vector sequences, which are then input into the BiLSTM-CRF sequence labeling model. The sequence labeling model includes BiLSTM layers and CRF layers. The BiLSTM layer consists of a forward LSTM and a backward LSTM. The forward LSTM reads the sequence from left to right to extract forward context features, and the backward LSTM reads the sequence from right to left to extract backward context features. The outputs of the two directions are concatenated at each time step to form a feature vector containing complete context information. The feature vector is mapped to the label space through a fully connected layer and then input into the CRF layer. The CRF layer maintains the label transition probability matrix and decodes and outputs the label sequence with the optimal probability under global label transition constraints using the Viterbi algorithm. The labels adopt the BIO annotation scheme, and the entity types include interface operation class, data processing class, system management class, and interface communication class. Semantic parsing is performed on the identified functional entities to automatically generate structured data containing functional descriptions, quantitative acceptance criteria, priorities, and traceability identifiers; Wherein: the sequence labeling model is a model that has been pre-trained in a domain-adaptive manner on a training set containing 100,000 software requirement texts manually labeled by domain experts.
[0024] The solution further includes, in step S2, the generation of the quantitative acceptance criteria specifically includes: A regular expression rule matching component is used to define regular expression patterns for time-based, precision-based, frequency-based, and capacity-based quantitative indicators. The acceptance standard text is scanned, and the indicator values and units are extracted from the regular expression capture groups. For the acceptance criteria text of quantitative indicators that the regular expression rule matching component failed to extract, the BERT semantic analysis model was used for semantic analysis: the acceptance criteria text was input into the BERT encoder, the 768-dimensional semantic vector corresponding to the [CLS] tag was taken, and it was sent to the quantitative indicator recommendation multi-class head to output the probability distribution of each indicator category. For the indicator category whose probability exceeds the confidence threshold, the corresponding default indicator value recommendation table was queried to generate the recommended quantitative indicators. The results of regular expression rule matching and BERT semantic analysis are merged and stored in a structured data format that includes indicator type, indicator value, and unit.
[0025] The solution further includes: In step S3, the template-driven document generation method specifically includes: Parse the GJB 5000B Appendix B template file in XML format, the XML template containing... <metadata>Metadata placeholder fields and <sections>Chapter tree, functional requirements for chapter usage <repeat-for>The tag definition is a dynamically expanding loop template based on a five-level requirement structure; Based on the actual hierarchical depth in the structured JSON data of the five-level requirements, <repeat-for>The loop template is dynamically expanded, cloning the corresponding chapter template node for each level node to generate a document framework object that matches the number of required items; Maintain independent atomic counters for each level, and generate consecutive numbers in depth-first order for configuration item level, category level, module level, submodule level and function point level; Iterate through all ${field_name} format placeholders in the document framework, retrieve the corresponding field values from the fifth-level requirement structured JSON data by field name, and fill the functional description, quantitative acceptance criteria, and traceability number into the corresponding positions in the document; Precisely set body text font, font size, line spacing, and page margin layout parameters by manipulating the OOXML interface; The following six compliance verification rules are executed: acceptance standard quantification check, numbering continuity check, traceability integrity check, hierarchical format check, metadata integrity check, and font format compliance check. When any one of the verifications fails, the problem location is automatically marked and a correction prompt is generated. The verification results are output in the form of a structured report.
[0026] The solution further includes: In step S4, the complexity determination, specifically calculating labor costs according to complexity level, includes: A three-tiered keyword database is maintained: Complex function point keywords include encryption, authentication, interface integration, concurrent processing, audit logs, multithreading, distributed computing, real-time performance, protocol parsing, and data fusion, corresponding to the first person-day coefficient; function point keywords include query, export, import, statistical analysis, report generation, access control, data validation, and batch processing, corresponding to the second person-day coefficient; simple function point keywords include display, input, edit, delete, list display, page navigation, and message prompts, corresponding to the third person-day coefficient. This three-tiered keyword database is stored in a hash table. Each function point description text is matched word-by-word, and the level with the most hits is taken as the keyword matching result. The BERT semantic analysis model is used to assist in the judgment: the function point description text is input into the encoder of the BERT semantic analysis model, the 768-dimensional semantic vector corresponding to the [CLS] tag is taken, and it is fed into the three-class fully connected layer of the BERT semantic analysis model. The probability distribution of three levels, complex, general and simple, is output. The level with the highest probability is taken as the semantic judgment result. Fusion strategy: When the two-level judgment results are consistent, adopt them directly; when they are inconsistent, the semantic analysis result of the BERT semantic analysis model shall prevail. The labor cost is calculated using the formula "Labor cost = Number of function points at each complexity level × Corresponding man-day coefficient × Sum of hourly rate". The hourly rate is set to RMB 800 per person-day by default. Based on the aforementioned labor costs, the software licensing fee is calculated at 10% of the labor costs, the implementation and deployment fee is calculated at 15% of the labor costs, and the taxes are calculated at 6% of the total amount, generating the quotation list that includes a detailed list of function points and a summary table of cost composition.
[0027] The beneficial effects of the present invention are as follows: The present invention has the following beneficial effects: Effect 1: Significantly improves the efficiency of requirements analysis. This invention automates the process of manual requirements analysis, which traditionally requires five to fifteen person-days for cost estimation using Document No. 4 software, by automating the process. This significantly reduces the requirement omission rate and eliminates the quality instability caused by differences in engineer experience in manual analysis.
[0028] Effect 2: Achieving a standardized five-level requirement structure. This invention automatically transforms unstructured task specifications into a five-level hierarchical structure conforming to the GJB5000B standard, consisting of configuration items, categories, modules, sub-modules, and function points. This solves the problem that existing flat requirement management tools cannot support hierarchical relationships, thus achieving standardization and normalization of the requirement structure.
[0029] Effect 3: Automatically establishes a complete traceability chain. This invention automatically generates a unique traceability identifier for each functional point, establishes a triple association relationship between requirement number, design number, and test number, stores it in a graph structure, supports forward and reverse traceability, and meets the three-level traceability requirements of GJB 5000B.
[0030] Effect 4: Improved quotation accuracy and shortened preparation cycle. This invention automatically determines the complexity of functional points based on a three-level keyword database matching and BERT semantic three-classification model, and automatically generates quotations by combining standardized pricing rules, eliminating human subjective bias and significantly shortening the quotation preparation cycle.
[0031] Effect 5: Automatic document compliance verification. This invention incorporates a GJB 5000B compliance rule library, executing six verification rules in real time during document generation: quantitative acceptance standard check, number continuity check, traceability integrity check, hierarchical format check, metadata integrity check, and font format compliance check. This significantly improves the first-pass rate of document review from approximately 50% to nearly 100%.
[0032] Effect Six: Meets the requirements of high-security and high-compliance scenarios. The system of this invention is deployed in a confidential intranet environment, physically isolated from the Internet. All core models run on local private servers, and transmission is encrypted using national cryptographic algorithms. It supports offline operation, version control, and non-deletable audit logs, meeting the information security requirements of military software engineering.
[0033] Effect 7: Three intelligent agents operate independently and work collaboratively. This invention adopts a microservice architecture, with the requirement understanding agent, document generation agent, and quotation calculation agent as independent microservice modules. They communicate asynchronously through a unified five-level requirement structure intermediate data format. The document generation agent and quotation calculation agent support parallel processing, resulting in strong system scalability.
[0034] Effect 8: Supports online learning and iterative optimization. The system of this invention can receive user feedback and continuously optimize the analysis accuracy and generation quality of the intelligent agent, achieving continuous improvement and iterative upgrades of the system.
[0035] The invention will be further explained in detail below with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0037] A method for structuring requirements and estimating software costs in a multi-agent collaborative manner, applicable to cost estimation of Document No. 4 software, includes the following steps: S1. Data acquisition and preprocessing steps: Obtain unstructured task book documents, perform format parsing and plain text extraction on the unstructured task book documents, and map non-standard terms into standardized terms through terminology standardization processing. S2. Requirements Understanding Steps: Perform parallel collaborative reasoning and hierarchical structure inference on the preprocessed plain text (a well-known large language model based on the Transformer architecture can be used to perform parallel collaborative reasoning and hierarchical structure inference on the preprocessed text), transforming the unstructured task book into five-level structured requirement data containing configuration items, categories, modules, sub-modules, and functional points; perform functional point entity recognition and extraction on the extracted plain text (a BiLSTM-CRF sequence labeling model combining bidirectional long short-term memory networks and conditional random fields can be used to perform functional point entity recognition and extraction on the preprocessed text); generate traceability identifiers and quantitative acceptance standards based on the extracted functional point entities; the five-level requirement structured data is stored in JSON format as a unified input for downstream document generation and quotation calculation; S3. Document generation steps: Based on the template-driven document generation method, the five-level requirement structured data is mapped to the GJB 5000B Appendix B standard template stored in XML format. Template instantiation, hierarchical number generation, content filling and formatting, and compliance verification are performed to output a standardized requirement specification. S4. Quotation Calculation Steps: A two-level judgment method combining keyword matching and semantic classification of the BERT semantic analysis model is adopted to determine the complexity of each functional point in the five-level demand structured data, calculate labor costs, additional fees and taxes according to the complexity level, and generate a quotation list that conforms to the cost calculation specification. S5. Output Packaging Step: Version-identify and package the requirements specification and the quotation list for output.
[0038] Steps S3 and S4 are executed synchronously and in parallel.
[0039] In step S1, the unstructured task book document includes documents in PDF and Word formats; For the unstructured task book document in PDF format, a layout analysis model based on deep convolutional neural networks is used for text recognition. The layout analysis model uses ResNet-50 as the backbone network to construct a multi-scale feature extraction network. It detects the title region, body text region and table region in the document through the region proposal network, and determines the title level based on the font size, bold attribute and indentation distance, so as to preserve the paragraph structure and title level information while extracting the text content. For the unstructured task book document in Word format, its OOXML internal structure is parsed, the main text paragraph content and built-in style attributes are extracted to infer the heading level, and interfering information such as headers, footers, comments and annotations are removed; The identified and extracted text is uniformly converted into UTF-8 encoded plain text format; By using a pre-built software terminology mapping dictionary and implementing the longest matching algorithm based on the Trie tree data structure, the text is scanned sentence by sentence to uniformly replace the non-standard terms with standardized terms. The software terminology mapping dictionary contains more than 5,000 professional terms and their standardized mapping rules, covering categories such as equipment system terms, software engineering terms, security and confidentiality terms, and quality management terms.
[0040] In step S2, the functional point entity identification and extraction specifically includes: The preprocessed text is segmented into sentences and converted into word vector sequences, which are then input into the BiLSTM-CRF sequence labeling model. The sequence labeling model includes a BiLSTM layer, a hidden layer, two stacked layers, and a CRF layer. The BiLSTM layer consists of a forward LSTM and a backward LSTM. The forward LSTM reads the sequence from left to right to extract forward context features, and the backward LSTM reads the sequence from right to left to extract backward context features. The outputs of the two directions are concatenated at each time step to form a feature vector containing complete context information. The BiLSTM layer and hidden layer have a dimension of 256, are stacked in two layers, and have a Dropout rate of 0.3. The feature vector is mapped to the label space through a fully connected layer and then input into the CRF layer. The CRF layer maintains the label transition probability matrix and decodes and outputs the label sequence with the optimal probability under global label transition constraints using the Viterbi algorithm. The labels adopt the BIO annotation scheme, and the entity types include interface operation class, data processing class, system management class, and interface communication class. Semantic parsing is performed on the identified functional entities to automatically generate structured data containing functional descriptions, quantitative acceptance criteria, priorities, and traceability identifiers; Wherein: the sequence labeling model is a model that has been pre-trained on a training set containing 100,000 software requirement texts manually labeled by domain experts, with a model labeling consistency Kappa coefficient greater than 0.85, training using the Adam optimizer, initial learning rate of 0.001, batch size of 32, training for 50 rounds, and validation set F1 score of not less than 0.92.
[0041] The traceability identifier adopts the XQ-year-date-four-digit serial number format. A globally unique atomic counter ensures that the number is not repeated or skipped. The corresponding design number (SJ-year-date-four-digit serial number format) and test number (CS-year-date-four-digit serial number format) are reserved simultaneously. The three sets of numbers share the same four-digit serial number. The association relationship is stored in a directed graph structure, which supports forward and reverse traceability.
[0042] In step S2, the generation of the quantitative acceptance criteria specifically includes: A regular expression rule matching component is used to define regular expression patterns for time-based, precision-based, frequency-based, and capacity-based quantitative indicators. The acceptance standard text is scanned, and the indicator values and units are extracted from the regular expression capture groups. For the acceptance criteria text of quantitative indicators that the regular expression rule matching component failed to extract, the BERT semantic analysis model was used for semantic analysis: the acceptance criteria text was input into the BERT encoder, the 768-dimensional semantic vector corresponding to the [CLS] tag was taken, and it was sent to the quantitative indicator recommendation multi-class head to output the probability distribution of each indicator category. For the indicator category whose probability exceeds the confidence threshold, the corresponding default indicator value recommendation table was queried to generate the recommended quantitative indicators. The results of regular expression rule matching and BERT semantic analysis are merged and stored in a structured data format that includes indicator type, indicator value, and unit.
[0043] In step S3, the template-driven document generation method specifically includes: Parse the GJB 5000B Appendix B template file in XML format, the XML template containing... <metadata>Metadata placeholder fields and <sections>Chapter tree, functional requirements for chapter usage <repeat-for>The tag definition is a dynamically expanding loop template based on a five-level requirement structure; Based on the actual hierarchical depth in the structured JSON data of the five-level requirements, <repeat-for>The loop template is dynamically expanded, cloning the corresponding chapter template node for each level node to generate a document framework object that matches the number of required items; Maintain independent atomic counters for each level, and generate consecutive numbers in depth priority order for configuration item level ("Chapter X" format), category level ("XY" format), module level ("XYZ" format), submodule level ("XYZW" format) and function point level ("XYZWN" format); Iterate through all ${field_name} format placeholders in the document framework, retrieve the corresponding field values from the fifth-level requirement structured JSON data by field name, and fill the functional description, quantitative acceptance criteria, and traceability number into the corresponding positions in the document; By manipulating the OOXML interface, you can precisely set the body text font (Fangsong_GB2312), font size (size 3, 16 points), line spacing (fixed value 28 points), page margins (top 3.7 cm, bottom 3.5 cm, left 2.8 cm, right 2.6 cm), and other layout parameters. The following six compliance verification rules are executed: acceptance standard quantification check, numbering continuity check, traceability integrity check, hierarchical format check, metadata integrity check, and font format compliance check. When any one of the verifications fails, the problem location is automatically marked and a correction prompt is generated. The verification results are output in the form of a structured report.
[0044] In step S4, the complexity determination, specifically calculating labor costs according to complexity level, includes: A three-tiered keyword database is maintained: Keywords for complex functions include encryption, authentication, interface integration, concurrent processing, audit logs, multithreading, distributed computing, real-time performance, protocol parsing, and data fusion, corresponding to a first-person-day coefficient (3.0); keywords for general functions include querying, exporting, importing, statistical analysis, report generation, access control, data validation, and batch processing, corresponding to a second-person-day coefficient (1.8); keywords for simple functions include displaying, inputting, editing, deleting, list displaying, page navigation, and message prompting, corresponding to a third-person-day coefficient (1.0). This three-tiered keyword database is stored in a hash table. Each function description text is matched word-by-word, and the level with the most hits is taken as the keyword matching result. The BERT semantic analysis model is used to assist in the judgment: the function point description text is input into the encoder of the BERT semantic analysis model, the 768-dimensional semantic vector corresponding to the [CLS] tag is taken, and it is fed into the three-class fully connected layer of the BERT semantic analysis model. The probability distribution of three levels, complex, general and simple, is output. The level with the highest probability is taken as the semantic judgment result. Fusion strategy: When the two-level judgment results are consistent, adopt them directly; when they are inconsistent, the semantic analysis result of the BERT semantic analysis model shall prevail. The labor cost is calculated using the formula "Labor cost = Number of function points at each complexity level × Corresponding man-day coefficient × Sum of hourly rate". The hourly rate is set to RMB 800 per person-day by default. Based on the aforementioned labor costs, the software licensing fee is calculated at 10% of the labor costs, the implementation and deployment fee is calculated at 15% of the labor costs, and the taxes are calculated at 6% of the total (labor costs + software licensing fees + implementation and deployment fees), generating the quotation list that includes a detailed list of function points and a summary table of cost composition.
[0045] This embodiment, for executing the software cost estimation method, includes: a data acquisition module, a demand understanding agent module, a document generation agent module, a quotation calculation agent module, and a document output module; in: The data acquisition module is used to acquire and preprocess unstructured task book documents. The data acquisition module includes a format parsing unit, a text extraction unit, and a terminology standardization unit. The format parsing unit uses a layout analysis model based on a deep convolutional neural network to perform text recognition and preserve paragraph structure for PDF documents, and parses the OOXML structure of Word documents to extract the main text and identify the heading levels. The terminology standardization unit uses a Trie tree data structure to implement the longest matching algorithm to perform terminology mapping. The requirement understanding intelligent agent module is used to transform the unstructured task book document into five-level requirement structured data. The requirement understanding intelligent agent includes a text preprocessing module, a terminology standardization module, a hierarchical structure inference module, a function point extraction module, an acceptance criterion parsing module, and a traceability identifier generation module. The hierarchical structure inference module uses two large language models based on the Transformer architecture to perform parallel collaborative reasoning using prompt templates, and merges the outputs of the two models through a weighted voting fusion engine. The function point extraction module uses a BiLSTM-CRF sequence labeling model, extracting forward and backward contextual features through the BiLSTM layer and decoding the globally optimal label sequence through the Viterbi algorithm in the CRF layer. The acceptance criterion parsing module uses a two-level parsing method combining regular expression rule matching and BERT semantic analysis. The document generation intelligent agent module is used to map the five-level requirement structured data into a standardized requirement specification. The document generation intelligent agent includes a template management module, a numbering generation module, a content filling module, a format processing module, and a compliance verification module. The template management module is dynamically instantiated based on an XML format template library. The numbering generation module maintains the continuity of the five-level numbering through an atomic counter. The format processing module precisely controls the layout parameters by operating the OOXML interface. The quotation calculation agent module is used to automatically calculate costs and generate a quotation list based on the five-level demand structured data. The quotation calculation agent includes a complexity determination module, a cost calculation module, an expense calculation module, and a list generation module. The complexity determination module adopts a two-level determination method that combines three-level keyword database hash table matching with BERT semantic three-class classification model. The quotation calculation agent and the document generation agent consume the five-level demand structured data in parallel. The document output module is used to version-identify and package the standardized requirements specification and the quotation list. The demand understanding agent, the document generation agent, and the quotation calculation agent are independent microservice modules that communicate asynchronously through a unified five-level demand structure intermediate data format, supporting fault isolation and independent deployment.
[0046] In the aforementioned demand-understanding intelligent agent: The hierarchical structure inference module includes a configuration item identification submodule, a classification identification submodule, a module identification submodule, and a submodule identification submodule. The configuration item identification submodule performs matching and identification based on a pre-built equipment system keyword library. The classification identification submodule divides the business domain by calculating the word frequency overlap between functional description fragments and a predefined set of business domain feature words. The module identification submodule uses the cosine similarity between the semantic vectors of functional description fragments as a coupling index, aggregating fragments with coupling higher than a threshold into the same module. The submodule identification submodule identifies the smallest functional unit based on three testability criteria: input / output explicitness, independent testability, and component independence. In the function point extraction module, the BiLSTM-CRF model is trained on a training set containing 100,000 manually annotated military software requirement texts, and the validation set F1 value is not less than 0.92. The acceptance criteria parsing module first uses a regular expression rule matching component to extract explicit quantitative indicators, and then uses the BERT semantic analysis model to output quantitative indicator recommendations through [CLS] vector classification for unmatched text. The traceability identifier generation module uses the XQ-year-date-four-digit serial number format to generate a unique number for each function point, and stores the triple traceability relationship of requirements-design-test in a directed graph structure, supporting forward and reverse traceability.
[0047] In the document generation agent: The template management module has a built-in template library in Appendix B of GJB 5000B. The templates are stored in XML format and contain... <metadata>Metadata placeholders <sections>Chapter tree and dynamic expansion of chapters for functional requirements <repeat-for>The template uses a circular tag structure and includes seven chapters: introduction, general description, functional requirements, non-functional requirements, interface requirements, verification and validation, and appendix. The number generation module maintains independent atomic counters for each level, and generates consecutive numbers at the configuration item level, category level, module level, submodule level and function point level in depth-first order. After generation, a continuity verification algorithm is executed to check for skipped numbers and duplicate numbers. The compliance verification module performs six verification rules: acceptance standard quantitative check, number continuity check, traceability integrity check, hierarchical format check, metadata integrity check, and font format compliance check. The format processing module outputs documents conforming to military format specifications through the OOXML interface. The formatting parameters include the body text font Fangsong_GB2312, font size 3 (16 points), fixed line spacing of 28 points, and page margins of 3.7 cm top, 3.5 cm bottom, 2.8 cm left, and 2.6 cm right.
[0048] In the quote calculation agent: The complexity determination module maintains a three-level keyword library stored in a hash table. It matches each level of keywords word by word in the description text of each function point and counts the number of hits. The level with the most hits is taken as the keyword matching determination result. The BERT model, which has been fine-tuned with complexity-annotated data, encodes the description text of the function points into a 768-dimensional semantic vector and feeds it into a three-class fully connected layer to output the probability distribution as the semantic determination result. When the results of the two levels are inconsistent, the semantic analysis result shall prevail. The cost calculation module calculates labor costs according to the formula "labor cost = number of function points at each complexity level × corresponding man-day coefficient × sum of hourly rate". The hourly rate can be adjusted through the configuration module. The cost calculation module automatically calculates the software license fee (10% of labor costs), implementation and deployment fee (15% of labor costs), and value-added tax (6% of total costs) according to preset ratios. The list generation module outputs a complete quotation list, including a cover, a detailed list of functions, a summary table of cost composition, a signature column, and an official seal position, through the OOXML interface. It supports both Word and PDF output formats. < / sections> < / metadata> < / sections> < / metadata> < / sections> < / metadata>
Claims
1. A method for structuring requirements and estimating software costs in a multi-agent collaborative manner, applicable to cost estimation of Document No. 4 software, characterized in that, Includes the following steps: S1. Data acquisition and preprocessing steps: Obtain unstructured task book documents, perform format parsing and plain text extraction on the unstructured task book documents, and map non-standard terms into standardized terms through terminology standardization processing. S2, Requirements Understanding Steps: Perform collaborative reasoning and hierarchical structure inference on the preprocessed plain text to transform the unstructured task book into five-level structured requirement data containing configuration items, categories, modules, sub-modules, and function points; perform function point entity identification and extraction on the extracted plain text; generate traceability identifiers and quantitative acceptance standards based on the extracted function point entities; The five-level demand structured data is stored in JSON format and serves as a unified input for downstream document generation and quotation calculation; S3. Document generation steps: Based on the template-driven document generation method, the five-level requirement structured data is mapped to the GJB 5000B Appendix B standard template stored in XML format. Template instantiation, hierarchical number generation, content filling and formatting, and compliance verification are performed to output a standardized requirement specification. S4. Quotation Calculation Steps: A two-level judgment method combining keyword matching and semantic classification of the BERT semantic analysis model is adopted to determine the complexity of each functional point in the five-level demand structured data, calculate labor costs, additional fees and taxes according to the complexity level, and generate a quotation list that conforms to the cost calculation specification. S5. Output Packaging Step: Version-identify and package the requirements specification and the quotation list for output.
2. The method according to claim 1, characterized in that, Steps S3 and S4 are executed synchronously and in parallel.
3. The method according to claim 1, characterized in that, In step S1, the unstructured task book document includes documents in PDF and Word formats; For the unstructured task book document in PDF format, a layout analysis model based on deep convolutional neural networks is used for text recognition. The layout analysis model uses ResNet-50 as the backbone network to construct a multi-scale feature extraction network. It detects the title region, body text region and table region in the document through the region proposal network, and determines the title level based on the font size, bold attribute and indentation distance, so as to preserve the paragraph structure and title level information while extracting the text content. For the unstructured task book document in Word format, its OOXML internal structure is parsed, the main text paragraph content and built-in style attributes are extracted to infer the heading level, and the header, footer, comments and annotation information are removed. The identified and extracted text is uniformly converted into UTF-8 encoded plain text format; By using a pre-built software terminology mapping dictionary and implementing the longest matching algorithm based on the Trie tree data structure, the text is scanned sentence by sentence, and the non-standard terms are uniformly replaced with standardized terms.
4. The method according to claim 1, characterized in that, The software terminology mapping dictionary contains more than 5,000 professional terms and their standardized mapping rules, covering equipment system terminology, software engineering terminology, security and confidentiality terminology, and quality management terminology.
5. The method according to claim 1, characterized in that, In step S2, the functional point entity identification and extraction specifically includes: The preprocessed text is segmented into sentences and converted into word vector sequences, which are then input into the BiLSTM-CRF sequence labeling model. The sequence labeling model includes BiLSTM layers and CRF layers. The BiLSTM layer consists of a forward LSTM and a backward LSTM. The forward LSTM reads the sequence from left to right to extract forward context features, and the backward LSTM reads the sequence from right to left to extract backward context features. The outputs of the two directions are concatenated at each time step to form a feature vector containing complete context information. The feature vector is mapped to the label space through a fully connected layer and then input into the CRF layer. The CRF layer maintains the label transition probability matrix and decodes and outputs the label sequence with the optimal probability under global label transition constraints using the Viterbi algorithm. The labels adopt the BIO annotation scheme, and the entity types include interface operation class, data processing class, system management class, and interface communication class. Semantic parsing is performed on the identified functional entities to automatically generate structured data containing functional descriptions, quantitative acceptance criteria, priorities, and traceability identifiers; Wherein: the sequence labeling model is a model that has been pre-trained in a domain-adaptive manner on a training set containing 100,000 software requirement texts manually labeled by domain experts.
6. The method according to claim 1, characterized in that, In step S2, the generation of the quantitative acceptance criteria specifically includes: A regular expression rule matching component is used to define regular expression patterns for time-based, precision-based, frequency-based, and capacity-based quantitative indicators. The acceptance standard text is scanned, and the indicator values and units are extracted from the regular expression capture groups. For the acceptance criteria text of quantitative indicators that the regular expression rule matching component failed to extract, the BERT semantic analysis model was used for semantic analysis: the acceptance criteria text was input into the BERT encoder, the 768-dimensional semantic vector corresponding to the [CLS] tag was taken, and it was sent to the quantitative indicator recommendation multi-class head to output the probability distribution of each indicator category. For the indicator category whose probability exceeds the confidence threshold, the corresponding default indicator value recommendation table was queried to generate the recommended quantitative indicators. The results of regular expression rule matching and BERT semantic analysis are merged and stored in a structured data format that includes indicator type, indicator value, and unit.
7. The method according to claim 1, characterized in that, In step S3, the template-driven document generation method specifically includes: Parse the GJB 5000B Appendix B template file in XML format, the XML template containing... <metadata>Metadata placeholder fields and <sections>Chapter tree, functional requirements for chapter usage <repeat-for> The tag definition is a dynamically expanding loop template based on a five-level requirement structure; < / sections> < / metadata> Based on the actual hierarchical depth in the structured JSON data of the five-level requirements, <repeat-for> The loop template is dynamically expanded, cloning the corresponding chapter template node for each level node to generate a document framework object that matches the number of required items; Maintain independent atomic counters for each level, and generate consecutive numbers in depth-first order for configuration item level, category level, module level, submodule level and function point level; Iterate through all ${field_name} format placeholders in the document framework, retrieve the corresponding field values from the fifth-level requirement structured JSON data by field name, and fill the functional description, quantitative acceptance criteria, and traceability number into the corresponding positions in the document; Precisely set body text font, font size, line spacing, and page margin layout parameters by manipulating the OOXML interface; The following six compliance verification rules are executed: acceptance standard quantification check, numbering continuity check, traceability integrity check, hierarchical format check, metadata integrity check, and font format compliance check. When any one of the verifications fails, the problem location is automatically marked and a correction prompt is generated. The verification results are output in the form of a structured report.
8. The method according to claim 1, characterized in that, In step S4, the complexity determination, specifically calculating labor costs according to complexity level, includes: A three-tiered keyword database is maintained: Complex function point keywords include encryption, authentication, interface integration, concurrent processing, audit logs, multithreading, distributed computing, real-time performance, protocol parsing, and data fusion, corresponding to the first person-day coefficient; function point keywords include query, export, import, statistical analysis, report generation, access control, data validation, and batch processing, corresponding to the second person-day coefficient; simple function point keywords include display, input, edit, delete, list display, page navigation, and message prompts, corresponding to the third person-day coefficient. This three-tiered keyword database is stored in a hash table. Each function point description text is matched word-by-word, and the level with the most hits is taken as the keyword matching result. The BERT semantic analysis model is used to assist in the judgment: the function point description text is input into the encoder of the BERT semantic analysis model, the 768-dimensional semantic vector corresponding to the [CLS] tag is taken, and it is fed into the three-class fully connected layer of the BERT semantic analysis model. The probability distribution of three levels, complex, general and simple, is output. The level with the highest probability is taken as the semantic judgment result. Fusion strategy: When the two-level judgment results are consistent, adopt them directly; when they are inconsistent, the semantic analysis result of the BERT semantic analysis model shall prevail. The labor cost is calculated using the formula "Labor cost = Number of function points at each complexity level × Corresponding man-day coefficient × Sum of hourly rate". The hourly rate is set to RMB 800 per person-day by default. Based on the aforementioned labor costs, the software licensing fee is calculated at 10% of the labor costs, the implementation and deployment fee is calculated at 15% of the labor costs, and the taxes are calculated at 6% of the total amount, generating the quotation list that includes a detailed list of function points and a summary table of cost composition.