Water conservancy design calculation construction method and system based on large model

By combining the compilation of Excel and Word calculation sheets with the module unpacking technology of large language models, the hydraulic design calculation system based on large models solves the problems of low efficiency and misuse risk in hydraulic design calculation, realizes an efficient and visualized calculation system, and supports rapid adjustment and maintenance.

CN121542439APending Publication Date: 2026-02-17CHINA WATER RESOURCES BEIFANG INVESTIGATION DESIGN & RES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511650064.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing hydraulic design calculation methods are inefficient, error-prone, and lack systematicity. Program calculations are prone to "black box" operation and misuse risks, and designers lack intuitive judgment on the calculation results.

Method used

A hydraulic design calculation system based on a large model is adopted. The system is developed by compiling Excel calculation tables and Word calculation books, combining C# logic and WPF interface development. The system also utilizes a large language model for module unpacking and retrieval, integrates the RAG database, and supports collaborative development by designers and developers.

Benefits of technology

It enables efficient and visualized hydraulic design calculations, reduces the risk of misuse, improves calculation efficiency and system generalization ability, supports rapid adjustment and maintenance, and reduces system maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542439A_ABST
    Figure CN121542439A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of water conservancy design calculation, and provides a water conservancy design calculation construction method and system based on a large model, and the method comprises the steps: combing an Exce l calculation table and a Word calculation document according to a water conservancy design specification, packaging the Exce l calculation table and the Word calculation document into a calculation module, and forming a program system; cleaning and structuring the calculation document, and constructing a retrieval enhancement generation (RAG) database; defining a word bag library and a synonym library to enhance the retrieval capability; constructing an LCEL chain through LangChai n, and accessing the LCEL chain to a system; user query is processed, and retrieval recall is achieved through keyword extraction and metadata matching; and the system returns a large model induction answer to be linked with the calculation module. According to the method, the advantages of manual calculation and program calculation are fused, semi-manual and semi-program water conservancy design calculation is achieved, the calculation efficiency and interpretability are improved, and the misuse risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hydraulic design calculation, specifically a method and system for constructing hydraulic design calculation based on a large model. Background Technology

[0002] In the hydraulic engineering design industry, calculations typically employ two basic methods: hydraulic engineering calculations and programmed calculations. Modern hydraulic engineering design usually combines both. Manual calculations, relying on calculators, calculation manuals, and design specifications, allow for a deeper understanding of the physical meaning and applicable conditions of the calculations and facilitate error detection. However, manual calculations are extremely inefficient and prone to errors. Studying the impact of a parameter change on the overall result or comparing multiple schemes exponentially increases the workload, and consistency is poor, making verification difficult. In contrast, programmed calculations offer significantly improved efficiency, better visualization, easier parameter optimization and analysis, and are easier to integrate, archive, and combine. However, programmed calculations also bring a series of problems. "Black box" operation introduces significant risks; designers may focus only on the results, neglecting the process, losing independent thinking and judgment; calculations exceeding program boundary conditions can lead to serious errors; and long-term reliance on programs may cause engineers to lack intuitive judgment regarding calculation results.

[0003] Therefore, in view of the above situation, there is an urgent need to provide a method and system for constructing hydraulic design calculations based on large models to overcome the shortcomings in current practical applications. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for constructing hydraulic design calculations based on large models, effectively solving the problems mentioned in the background art.

[0005] This invention is implemented as follows: a method for constructing hydraulic design calculations based on a large model, comprising the following steps:

[0006] Step S1: Knowledge Preparation: Based on the water conservancy design specifications, sort out the calculation modules by category, compile Excel calculation tables and Word calculation books, and collect calculation cases for verification;

[0007] Step S2: Encapsulate the calculation module: Use C# to write the calculation logic, WPF to design the UI interface, and develop the calculation programs for each module based on the MVVM architecture to form a hydraulic design calculation system;

[0008] Step S3, Data Processing: Clean the Word calculation book document to generate a knowledge base; load the document and split it by Element, embed the module category, chapter name, and calculation case as metadata into the vector database to build the RAG database;

[0009] Step S4: Define the bag-of-words library;

[0010] Step S5: Create a RESTful API and link LCEL into the hydraulic design calculation system;

[0011] Step S6, User Query Processing: After a user enters a query into the system, keywords are extracted and mapped to the bag-of-words database. Through rich metadata filtering and structured prompt word processing, the tags are returned to the calculation module.

[0012] Step S7, Retrieval and Recall: The LCEL chain returns the answers and calculation module tags summarized by the large model, and the system generates calculation module links based on the tags.

[0013] As a further aspect of the present invention: In step S1, the calculation module is compiled according to a unified paradigm, including an Excel calculation table and a Word calculation book, and verified through calculation examples.

[0014] As a further aspect of the present invention: in step S2, the step of forming the hydraulic design calculation system is as follows:

[0015] The system uses dependency injection to uniformly schedule all modules, with Aspose.cell operating Excel for calculations, OpenXml operating Word for writing calculation reports, and JSON files recording and transmitting calculation cases to form a hydraulic design calculation system.

[0016] As a further aspect of the present invention: in step S3, document cleaning includes deleting headers, footers, images, formulas, and tables, retaining only the three sections: calculation instructions, calculation basis, and calculation method.

[0017] As a further aspect of the present invention: in step S3, the document is split by Element, and the module category, chapter name and calculation case are embedded as metadata into the vector database.

[0018] As a further aspect of the present invention: in step S4, the bag-of-words database includes the keys of metadata, and the retrieval capability is enhanced by a thesaurus.

[0019] As a further aspect of the present invention: In step S5, a RESTful API is created through LangChain's LangServer.

[0020] As a further aspect of the present invention: In step S6, the user query returns the calculation module label through keyword extraction, bag-of-words mapping, metadata filtering, and structured prompt word processing.

[0021] As a further aspect of the present invention: In step S7, the LCEL chain returns the answer and calculation module label of the large model induction, and the system generates a calculation module link based on the label, specifically as follows:

[0022] The large model summarizes and generalizes the retrieved answers to generate the final answer.

[0023] After metadata screening, the calculation module tags are obtained. The hydraulic design calculation system uses these tags to generate calculation module links.

[0024] This invention also provides a hydraulic design calculation construction system based on a large model, used to implement the above-mentioned hydraulic design calculation construction method based on a large model, including a knowledge preparation module, a calculation module encapsulation module, a data processing module, a bag-of-words definition module, an API creation and linking module, a user query processing module, and a retrieval and recall module;

[0025] The knowledge preparation module is used to sort out the main calculation modules by category according to the water conservancy design specifications, compile Excel calculation tables and Word calculation books, and collect calculation cases for verification.

[0026] The calculation module is encapsulated in C#, the calculation logic is written in WPF, the UI interface is designed in WPF, and the calculation programs of each module are developed based on the MVVM architecture to form a water conservancy design calculation system.

[0027] The data processing module cleans the Word calculation book document and generates a knowledge base; loads the document and splits it by element; embeds the module category, chapter name, and calculation case as metadata into the vector database to construct the RAG database.

[0028] The bag-of-words definition module is used to define a bag-of-words database containing metadata keys and to supplement the thesaurus to improve retrieval capabilities;

[0029] The API creation link module creates a RESTful API through LangChain's LangServer, linking LCEL into the hydraulic design calculation system;

[0030] The user query processing module is used to pass input information into the LCEL chain, extract keywords and map them to the bag-of-words database to match metadata keys, filter relevant content through rich metadata and pass in structured prompt words, and return the calculation module label;

[0031] The retrieval and recall module is used to enable the LCEL chain to return the final answer and calculation module tags of the large model summary. The hydraulic design calculation system generates calculation module links based on the tags.

[0032] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0033] The proposed method and system for constructing hydraulic design calculations based on large models integrates the advantages of manual and programmatic calculations through a "semi-manual, semi-programmatic" approach. In the knowledge preparation stage, Excel calculation tables and Word calculation books are created, preserving the clear presentation of calculation logic and basis found in manual calculations, facilitating designers' understanding of the calculation process. In the calculation module encapsulation stage, program development is used to automate and improve the efficiency of calculations.

[0034] Meanwhile, this method decouples the computational core from the program framework, allowing designers and developers to participate in program development simultaneously. Designers can create Excel calculation tables and Word calculation sheets based on their professional understanding of hydraulic design calculations, while developers are responsible for program encapsulation and system construction, fully leveraging the professional advantages of both. By using large-scale model (RAG) technology as a supplement to the calculation program, the calculation modules are unpacked, allowing designers to obtain detailed calculation information, avoiding the risks of "black box" operation and reducing the possibility of errors due to misuse of the program. Furthermore, the calculation sheets, calculation tables, and RAG support timely adjustments. When hydraulic design specifications are updated or calculation requirements change, the calculation sheets and calculation tables can be quickly modified, and the RAG database can be updated, significantly reducing system maintenance costs.

[0035] Compared to existing calculation tools developed by individuals within the water conservancy design industry, the system constructed in this invention is systematic and has strong generalization capabilities, covering multiple scenarios of water conservancy design calculations rather than being limited to specific scenarios. At the same time, the system includes explanatory text related to the calculations, such as the calculation basis and scope of application, providing users with sufficient guidance and reducing the risk of user misuse. Attached Figure Description

[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 This is a flowchart illustrating the system application and data transmission process.

[0038] Figure 2 This is a knowledge structure diagram. Detailed Implementation

[0039] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] Computational systems require developers to possess both strong development skills and computational comprehension. While many individually developed computational tools in the hydraulic engineering industry demonstrate remarkable effectiveness in certain scenarios, limited manpower often limits their application to specific situations, lacking systematicity and generalization capabilities. Furthermore, the absence of descriptive text regarding boundary conditions and applicability is a significant problem, easily leading to misuse and serious consequences. The method proposed in this invention decouples the computational core from the program framework, allowing designers and developers to participate simultaneously in program development. It also utilizes large-scale model (RAG) technology as a supplement to the computational program, achieving an unpacking effect for computational modules. Moreover, the calculation sheets, tables, and RAG support timely adjustments, significantly reducing maintenance costs.

[0041] The present invention will be further explained below with reference to specific embodiments.

[0042] Please see Figure 1 and Figure 2 The present invention provides a method for constructing hydraulic design calculations based on a large model, the method comprising the following steps:

[0043] Step S1: Knowledge Preparation: Based on the water conservancy design specifications, organize the main calculation modules according to categories. For each calculation module, compile Excel calculation tables and Word calculation books according to a unified paradigm, and collect calculation cases for verification;

[0044] Step S2: Encapsulate the calculation modules: The calculation logic is written in C#, the UI is designed using WPF, and the calculation programs for each module are developed based on the MVVM architecture. Dependency injection technology is used to uniformly schedule each module. Aspose.cel manipulates Excel for calculations, OpenXml manipulates Word for writing calculation reports, and JSON files are used to record and transmit calculation cases, forming a hydraulic design calculation system.

[0045] Step S3: Data Processing: Clean the Word calculation document: remove headers and footers; retain only the three chapters: calculation instructions, calculation basis, and calculation method; remove images, formulas, tables, etc. from the document, and generate a knowledge base. Then load the document, split it into "Elements", and embed the module categories, chapter names, and calculation examples as metadata into a vector database to form a RAG database;

[0046] Step S4: Define the bag-of-words database: The bag-of-words database includes the keys of the metadata and improves retrieval capabilities by supplementing it with a thesaurus;

[0047] Step S5: Create a RESTful API through LangChain's LangServer and link LCEL into the hydraulic design calculation system;

[0048] Step S6: User query processing: Input information is passed into the LCEL chain through the hydraulic design calculation system. First, the keywords defined in the thesaurus are extracted from the input. Then, the keywords are mapped to the bag-of-words library to match the metadata keys. Subsequently, relevant content is filtered and screened through rich metadata and passed into the structured prompt words in sequence. At the same time, the calculation module label is returned.

[0049] Step S7: Retrieval and Recall: The LCEL chain returns two parts of the hydraulic design calculation system: 1) The large model summarizes and generalizes the retrieved answers to generate the final answer. 2) The calculation module tags obtained after metadata screening; the hydraulic design calculation system generates calculation module links based on these tags.

[0050] In this embodiment, the present invention proposes a hydraulic design calculation method that integrates manual calculation and program calculation, aiming to fully leverage the convenience of program calculation while not completely eliminating the advantages of manual calculation, such as flexibility and ease of verification. The core invention is to encapsulate the program into a hydraulic design calculation program with Excel as the core calculation tool, and then unpack it using a large language model to ultimately generate a "semi-manual, semi-programmed" hydraulic design calculation system.

[0051] This invention also provides a hydraulic design calculation construction system based on a large model, used to implement the above-mentioned hydraulic design calculation construction method based on a large model, including a knowledge preparation module, a calculation module encapsulation module, a data processing module, a bag-of-words definition module, an API creation and linking module, a user query processing module, and a retrieval and recall module;

[0052] The knowledge preparation module is used to sort out the main calculation modules by category according to the water conservancy design specifications, compile Excel calculation tables and Word calculation books, and collect calculation cases for verification.

[0053] The calculation module is encapsulated in C#, the calculation logic is written in WPF, the UI interface is designed in WPF, and the calculation programs of each module are developed based on the MVVM architecture to form a water conservancy design calculation system.

[0054] The data processing module cleans the Word calculation book document and generates a knowledge base; loads the document and splits it by element; embeds the module category, chapter name, and calculation case as metadata into the vector database to construct the RAG database.

[0055] The bag-of-words definition module is used to define a bag-of-words database containing metadata keys and to supplement the thesaurus to improve retrieval capabilities;

[0056] The API creation link module creates a RESTful API through LangChain's LangServer, linking LCEL into the hydraulic design calculation system;

[0057] The user query processing module is used to pass input information into the LCEL chain, extract keywords and map them to the bag-of-words database to match metadata keys, filter relevant content through rich metadata and pass in structured prompt words, and return the calculation module label;

[0058] The retrieval and recall module is used to enable the LCEL chain to return the final answer and calculation module tags of the large model summary. The hydraulic design calculation system generates calculation module links based on the tags.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for constructing hydraulic design calculations based on a large model, characterized in that, Includes the following steps: Step S1: Knowledge Preparation: Based on the water conservancy design specifications, sort out the calculation modules by category, compile Excel calculation tables and Word calculation books, and collect calculation cases for verification; Step S2: Encapsulate the calculation module: Use C# to write the calculation logic, WPF to design the UI interface, and develop the calculation programs for each module based on the MVVM architecture to form a hydraulic design calculation system; Step S3, Data Processing: Clean the Word calculation book document to generate a knowledge base; load the document and split it by Element, embed the module category, chapter name, and calculation case as metadata into the vector database to build the RAG database; Step S4: Define the bag-of-words library; Step S5: Create a RESTful API and link LCEL into the hydraulic design calculation system; Step S6, User Query Processing: After a user enters a query into the system, keywords are extracted and mapped to the bag-of-words database. Through rich metadata filtering and structured prompt word processing, the tags are returned to the calculation module. Step S7, Retrieval and Recall: The LCEL chain returns the answers and calculation module tags summarized by the large model, and the system generates calculation module links based on the tags.

2. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S1, the calculation module is compiled according to a unified paradigm, including an Excel calculation sheet and a Word calculation book, and is verified through calculation examples.

3. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S2, the steps for forming the hydraulic design calculation system are as follows: The system uses dependency injection technology to uniformly schedule all modules. Aspose.cel operates Excel for calculations, OpenXml operates Word for writing calculation reports, and JSON files are used to record and transmit calculation cases, forming a hydraulic design calculation system.

4. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S3, document cleaning includes deleting headers, footers, images, formulas, and tables, retaining only the three sections: calculation instructions, calculation basis, and calculation method.

5. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S3, the document is split by Element, and the module category, chapter name, and calculation case are embedded as metadata into the vector database.

6. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S4, the bag-of-words database includes the keys of the metadata and enhances retrieval capabilities through a thesaurus.

7. The hydraulic design calculation construction method based on a large model according to claim 1, characterized in that, In step S5, a RESTful API is created through LangChain's LangServer.

8. The method for constructing hydraulic design calculations based on a large model according to claim 1, characterized in that, In step S6, the user query returns the calculation module label through keyword extraction, bag-of-words mapping, metadata filtering, and structured prompt word processing.

9. The method for constructing hydraulic design calculations based on a large model according to claim 1, characterized in that, In step S7, the LCEL chain returns the answer and calculation module labels summarized by the large model. The system generates calculation module links based on the labels, specifically: The large model summarizes and generalizes the retrieved answers to generate the final answer. After metadata screening, the calculation module tags are obtained. The hydraulic design calculation system uses these tags to generate calculation module links.

10. A hydraulic design calculation system based on a large model, characterized in that, The method for constructing hydraulic design calculations based on large models as described in any one of claims 1-9 includes a knowledge preparation module, a calculation module encapsulation module, a data processing module, a bag-of-words definition module, an API creation and linking module, a user query processing module, and a retrieval and recall module. The knowledge preparation module is used to sort out the main calculation modules by category according to the water conservancy design specifications, compile Excel calculation tables and Word calculation books, and collect calculation cases for verification. The calculation module is encapsulated in C#, the calculation logic is written in WPF, the UI interface is designed in WPF, and the calculation programs of each module are developed based on the MVVM architecture to form a water conservancy design calculation system. The data processing module cleans the Word calculation book document and generates a knowledge base; loads the document and splits it by element; embeds the module category, chapter name, and calculation case as metadata into the vector database to construct the RAG database. The bag-of-words definition module is used to define a bag-of-words database containing metadata keys and to supplement the thesaurus to improve retrieval capabilities; The API creation link module creates a RESTful API through LangChain's LangServer, linking LCEL into the hydraulic design calculation system; The user query processing module is used to pass input information into the LCEL chain, extract keywords and map them to the bag-of-words database to match metadata keys, filter relevant content through rich metadata and pass in structured prompt words, and return the calculation module label; The retrieval and recall module is used to enable the LCEL chain to return the final answer and calculation module tags of the large model summary. The hydraulic design calculation system generates calculation module links based on the tags.