System and method for generating battery pack structure based on large model

By using a large-model-based system, the battery pack structure design requirements are automatically analyzed, and Python code is generated and verified. This solves the problem of traditional battery pack design relying on human experience and achieves efficient and intelligent battery pack structure generation and verification.

CN121722366APending Publication Date: 2026-03-24深圳市海雷新能源股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-09
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional battery pack structure design relies on human experience, resulting in long design cycles, high communication costs, low levels of intelligence, inability to quickly respond to changing design requirements, and the generated code lacks professional standards, requiring multiple manual debugging sessions.

Method used

The system employs a large model-based approach, including an input module, a parsing module, a knowledge base, an MCP module, and an execution and verification module. It generates battery pack structures through natural language input, parses requirements using the large model processing module, and generates and verifies Python code from the FreeCAD library using the knowledge base and MCP module, thereby achieving automated design and intelligent verification.

Benefits of technology

It has achieved automation and intelligence in battery pack structure design, improved the accuracy, professionalism and efficiency of the design, reduced the design cycle, ensured the reliability and compliance of the generated code, and supported user iterative optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722366A_ABST
    Figure CN121722366A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of artificial intelligence aided design and battery structure engineering, and particularly relates to a system for generating a battery pack structure based on a large model, which comprises an input module, a large model processing module, a knowledge base, an MCP module, an execution and verification module and an output module. The method comprises the steps of receiving a design requirement of natural language input of a user; analyzing the demand by using the large model and generating a task list; retrieving standardized codes and design specifications in the knowledge base based on the task list; a Python code of the FreeCAD library is generated and executed through an MCP module; verifying an execution result and iteratively modifying until the result is correct; and finally generating and outputting a battery pack structure file. The end-to-end automation of the battery pack structure design is realized, the design efficiency and quality are obviously improved, and the labor cost and the technical threshold are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence-aided design and battery structure engineering, specifically a system and method for generating battery pack structures based on large models. Background Technology

[0002] With the rapid development of new energy vehicles and energy storage systems, the demand for battery pack structural design is increasing. Traditional battery pack design methods mainly rely on engineers manually modeling using CAD software (such as FreeCAD and SolidWorks), which results in long design cycles, dependence on human experience, and difficulty in quickly responding to changing design requirements.

[0003] While some companies have attempted to implement parametric design by writing Python scripts, issues remain, including high script development barriers, lack of natural language interaction, insufficient domain knowledge embedding, and inability to automatically verify design constraints. In recent years, although some research has attempted to generate CAD code using large language models, these efforts still suffer from shortcomings such as incomplete generated code, lack of integration with professional design standards, and the need for multiple rounds of manual debugging.

[0004] The following problems exist in particular: 1. Technicians must be proficient in 3D modeling tools; 2. Structural engineers need to spend a lot of time understanding the requirements, resulting in high communication costs; 3. When requirements change, modifying the design takes a long time; 4. Existing AI-assisted design tools have limited intelligence and still require gradual interaction. Therefore, a system and method for generating battery pack structures based on a large model are proposed to address the above problems. Summary of the Invention

[0005] To address the shortcomings of existing technologies in battery pack structure design, such as reliance on manual experience, low automation, long design cycles, inability to respond to rapidly changing demands, and lack of intelligent verification mechanisms, this invention proposes a system and method for generating battery pack structures based on large models.

[0006] The technical solution adopted by this invention to solve its technical problem is: a system for generating battery pack structures based on a large model, comprising: The input module is used to receive battery pack structure design requirements input by the user in natural language.

[0007] The large model processing module is used to parse the natural language design requirements, extract key parameters, and generate a task list.

[0008] The knowledge base stores standardized component codes, complete battery pack structure codes, design specifications, and additional redundancy information related to battery pack structure design. It is used to respond to retrieval requests from the large model processing module and return relevant knowledge.

[0009] The MCP module generates Python code for the FreeCAD library based on the task list generated by the large model processing module and the relevant knowledge returned by the knowledge base, and then executes the code.

[0010] The execution and verification module is used to verify the execution results of the Python code of the FreeCAD library. If an execution error occurs, the error information is fed back to the MCP module for code modification. If the execution is correct, the generation of the structure file is triggered.

[0011] The output module returns the generated battery pack structure file and allows users to restart the design process when they need to add additional requirements.

[0012] Preferably, the knowledge base is a retrieval-enhanced generation (RAG) system based on a vector database, which stores standardized structural codes for cylindrical cells, prismatic cells, pouch cells, and battery management systems, as well as additional redundant information such as waterproof structures.

[0013] Preferably, the MCP module is built on the FastMCP framework, uses the HTTP transmission protocol for data interaction, and uses the Pydantic data model to verify request parameters and ensure type security.

[0014] Preferably, the code execution function of the MCP module integrates FreeCAD's Python interpreter and merges code writing and execution into atomic operations to achieve complete tracing of the execution chain.

[0015] Preferably, the large model processing module integrates the LangChain framework and ChatOpenAI as a language model engine, and records intermediate steps, decision-making basis and tool call results during task execution through the agent_scratchpad module.

[0016] This invention also provides a method for generating battery pack structures based on large models, comprising the following steps: Receive battery pack structure design requirements from users in natural language input.

[0017] The natural language design requirements are analyzed using a large model, key parameters are extracted, and a task list is generated.

[0018] Based on the task list, retrieve standardized codes, design specifications, and additional redundancy conditions related to battery pack structure design from the knowledge base.

[0019] The MCP module generates Python code for the FreeCAD library based on the retrieved information.

[0020] Execute the Python code of the FreeCAD library and verify the execution result.

[0021] If an error occurs, modify the code according to the error message and re-execute until it succeeds.

[0022] Generate the battery pack structure file and return it to the user. If the user has additional requirements, repeat the above steps.

[0023] Preferably, in the knowledge base retrieval step, code snippets, design templates, and best practices that match the task list are obtained from a vector database using RAG technology.

[0024] Preferably, when the MCP module generates Python code for the FreeCAD library, it supports custom filenames or automatically generates unique filenames containing UUID and process ID, and the code is encoded in UTF-8.

[0025] Preferably, the battery pack structure file is in standard CAD format, and after generation, it supports front-end preview, allowing users to submit supplementary requirements based on the preview results.

[0026] The advantages of this invention are: 1. This invention, through a structural design that combines natural language input and intelligent parsing, achieves the automatic conversion of user intent into design parameters. This solves the problems of traditional CAD design, which relies on manual interpretation of requirements, has high communication costs, and is prone to ambiguity, thereby improving the accuracy and efficiency of requirements analysis. 2. This invention achieves intelligent retrieval and context enhancement of battery pack design knowledge through a collaborative structural design of a large model and a domain knowledge base (RAG), solving the problems of generated code lacking professional standards and being out of touch with actual applications, and improving the professionalism and compliance of design output.

[0027] 3. This invention achieves automatic generation, secure execution, and link tracing of FreeCADPython code through the atomic code generation and execution structure design of the MCP module, solving the problems of high script writing threshold, complex execution environment, and difficult debugging, and improving the reliability of code generation and execution efficiency.

[0028] 4. This invention achieves intelligent verification of structural strength, thermal management performance, and compliance with specifications by automating the verification of the structural design through the execution and verification module. This solves the problem of traditional design relying on manual inspection and easily overlooking key constraints, thereby improving the quality and safety of the design output.

[0029] 5. This invention, through a closed-loop iterative and user feedback-based structural design, achieves automatic optimization based on error feedback and user supplementary requirements, solving the problems of long design modification cycles and high iteration costs, and improving design flexibility and user satisfaction. Attached Figure Description

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

[0031] Figure 1 This is a schematic diagram illustrating the working principle of the system of the present invention; Figure 2 This is a flowchart illustrating the method for generating battery pack structures based on a large model according to the present invention. Figure 3 This is a flowchart of the code generation and execution process based on MCP of the present invention; Figure 4 This is a schematic diagram illustrating the battery pack structure file generation and user interaction process of the present invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.

[0033] The following is in conjunction with the appendix Figure 1-4 This application will be described in further detail. This application discloses a system and method for generating battery pack structures based on large models. For example... Figure 1 The diagram shown illustrates the working principle of the system, demonstrating the collaborative relationships and data flow between modules. A system for generating battery pack structures based on a large model includes: The input module is used to receive battery pack structure design requirements input by the user in natural language.

[0034] Users input natural language descriptions through the front-end interface, such as: "Design a battery pack containing 120 cells arranged in a 6×20 matrix, with a cooling channel width of 15mm." The system supports input in multiple languages, including Chinese and English.

[0035] The large model processing module is used to parse the natural language design requirements, extract key parameters, and generate a task list.

[0036] The LangChain framework and ChatOpenAI are integrated as the language model engine. The agent_scratchpad module records the intermediate steps, decision-making basis and tool call results during task execution, ensuring that the generated task list is accurate and reliable.

[0037] The knowledge base stores standardized component codes, complete battery pack structure codes, design specifications, and additional redundancy information related to battery pack structure design. It is used to respond to retrieval requests from the large model processing module and return relevant knowledge.

[0038] The knowledge base uses a vector database to build a retrieval-enhanced generation (RAG) system, storing content including: Standardized cell structure codes (cylindrical, square, pouch), BMS layout templates, redundancy warnings for waterproofing and shockproofing, as well as design specifications and best practice examples.

[0039] The MCP module generates Python code for the FreeCAD library based on the task list generated by the large model processing module and the relevant knowledge returned by the knowledge base, and then executes the code.

[0040] Built on the FastMCP framework, it supports HTTP transmission and Pydantic data verification, and has the following features: Generate Python code for the FreeCAD library.

[0041] Supports custom filenames or automatically generated unique filenames (UUID + process ID).

[0042] Code writing and execution are combined into atomic operations, with timeout control supported (default 30 seconds).

[0043] Provides complete execution chain tracing and logging.

[0044] The execution and verification module is used to verify the execution results of the Python code of the FreeCAD library. If an execution error occurs, the error information is fed back to the MCP module for code modification. If the execution is correct, the generation of the structure file is triggered.

[0045] Integrate the FreeCADPython interpreter to execute the generated code.

[0046] The output module returns the generated battery pack structure file and allows users to restart the design process when they need to add additional requirements.

[0047] Generates standard CAD format files (e.g., .FCStd), supporting front-end preview and download. Users can submit supplementary requirements based on the preview results, and the system automatically restarts the design process.

[0048] The knowledge base is a retrieval-enhanced generation system based on a vector database. The stored content includes standardized structural codes for cylindrical cells, square cells, pouch cells, and battery management systems, as well as waterproof structural information.

[0049] The MCP module is built on the FastMCP framework, uses the HTTP transport protocol for data interaction, and uses the Pydantic data model to verify request parameters and ensure type security.

[0050] The code execution function of the MCP module integrates FreeCAD's Python interpreter, has a timeout mechanism, and merges code writing and execution into atomic operations to achieve execution chain tracing.

[0051] The term "Large Language Model" (LLM) broadly refers to deep learning models with a large number of parameters, capable of understanding and generating natural language, and possessing a certain degree of logical reasoning ability. Specific types include, but are not limited to, generative pre-trained transform models (such as the GPT series models), models based on bidirectional encoder representation techniques (such as the BERT series models), and other large-scale natural language processing models with different architectures. In the specific implementation of this invention, a generative dialogue model (such as deepseek, KIMI, QWEN) is preferably used as the language model engine to better complete natural language requirement parsing, task planning, and code generation tasks. This model is integrated into the system through an application programming interface (API) or local deployment.

[0052] The large model processing module integrates the LangChain framework and ChatOpenAI as the language model engine, and records the intermediate steps, decision-making basis and tool call results during the task execution process through the agent_scratchpad module.

[0053] like Figure 2 The diagram shown is a schematic representation of the main flow of the method of the present invention, which includes the following steps: User input: Users submit natural language descriptions through the front end, and the system receives battery pack structure design requirements input by users in natural language form.

[0054] Requirements Analysis: Extract key parameters (such as the number of battery cells, arrangement, cooling channel size, etc.) from the large model, use the large model to parse the natural language design requirements, extract key parameters and generate a task list.

[0055] Knowledge retrieval: Relevant code snippets and design templates are retrieved from the knowledge base using RAG technology. Based on the task list, standardized code, design specifications, and additional redundancy conditions related to battery pack structure design are retrieved from the knowledge base.

[0056] Code generation: The MCP module generates Python code for the FreeCAD library based on the retrieved information.

[0057] Code execution: Execute the Python code of the FreeCAD library and verify the execution results.

[0058] Result verification: If an error occurs, modify the code according to the error message and re-execute until it succeeds.

[0059] Results return: Users can preview, download, or provide modification suggestions. The battery pack structure file is generated and returned to the user. If the user has additional requirements, the above steps are repeated.

[0060] In the knowledge base retrieval step, code snippets, design templates, and best practices that match the task list are obtained from the vector database using RAG technology.

[0061] A knowledge base can use a graph database or a relational database instead of a vector database.

[0062] When the MCP module generates Python code for the FreeCAD library, it supports custom filenames or automatically generates unique filenames containing UUID and process ID, and the code uses UTF-8 encoding.

[0063] The battery pack structure file is in standard CAD format and supports front-end preview after generation. Users can submit supplementary requirements based on the preview results.

[0064] like Figure 1 As shown, users input design requirements via natural language, which are then analyzed by the large model, which in turn retrieves information from the knowledge base to enhance the context. Subsequently, the process enters the MCP module to generate an executable Python code file. The FreeCAD Python environment executes this code, and the large model verifies the execution results.

[0065] If an error occurs, an error message is returned and the code is regenerated; if the execution is successful, the final structure file is generated and provided to the user for preview.

[0066] like Figure 2 As shown, the process begins with the user's natural language input, and after requirements analysis, knowledge base retrieval and enhancement, it enters the MCP module for code generation and execution.

[0067] The key is the setting of an execution result judgment node: if an execution error occurs, the system will automatically modify the code and regenerate the execution, forming a closed negative feedback loop until success; if the execution is correct, the final structure file will be generated and output.

[0068] like Figure 3 As shown, the core closed-loop process of code generation and execution within the MCP (ModelContextProtocol) module is revealed. The process begins with the MCP tool being called to generate code and write it to a file, and ends with the code being successfully executed and the structure file being output.

[0069] Its core lies in the closed-loop design of "execution-verification-feedback-retry": if the code execution fails or times out, the system will automatically parse the error, adjust the generation strategy, and regenerate the code until it succeeds.

[0070] This loop mechanism ensures the accuracy of the final output and is key to achieving high-success-rate automation.

[0071] like Figure 3 As shown, it is displayed in detail. Figure 2 The closed-loop process of code generation and execution within the MCP module specifically includes: The MCP module receives the task list and the retrieved knowledge.

[0072] Generate FreeCAD Python code and write it to a file.

[0073] Call the FreeCAD Python interpreter to execute the code file.

[0074] How to determine if the execution was successful or timed out? If the execution fails or times out, analyze the error message.

[0075] Adjust the code generation strategy based on the error message and return to regenerate the code.

[0076] If the execution is successful, the correct structure file will be output, and the process will end.

[0077] like Figure 4 As shown, the complete end-to-end process from initiating a request to finally obtaining the design result is presented from the user's perspective. After the user initiates a request, the system automatically executes all processes such as parsing, generating, executing, and verifying in the background, and presents the final result to the user in 3D form.

[0078] Users can download the model or initiate a new round of modifications and iterations based on the results, demonstrating the system's interactivity and practicality.

[0079] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. A system for generating battery pack structures based on large models, characterized in that, include: The input module is used to receive the battery pack structure design requirements input by the user in natural language. The large model processing module is used to parse the natural language design requirements, extract key parameters, and generate a task list; The knowledge base stores standardized component codes, complete battery pack structure codes, design specifications, and additional redundancy information related to battery pack structure design. It is used to respond to retrieval requests from the large model processing module and return relevant knowledge. The MCP module generates Python code for the FreeCAD library based on the task list generated by the large model processing module and the relevant knowledge returned by the knowledge base, and then executes the code. The execution and verification module is used to verify the execution results of the Python code of the FreeCAD library. If an execution error occurs, the error information is fed back to the MCP module for code modification. If the execution is correct, the generation of the structure file is triggered. The output module returns the generated battery pack structure file and allows users to restart the design process when they need to add additional requirements.

2. The system for generating battery pack structures based on a large model according to claim 1, characterized in that: The knowledge base is a vector database that stores information including standardized structural codes for cylindrical cells, prismatic cells, pouch cells, and battery management systems, as well as additional redundant conditions such as waterproof structures.

3. The system for generating battery pack structures based on a large model according to claim 1, characterized in that: The MCP module is built on the FastMCP framework, uses the HTTP transport protocol for data interaction, and uses the Pydantic data model to verify request parameters and ensure type security.

4. The system for generating battery pack structures based on a large model according to claim 1, characterized in that: The code execution function of the MCP module integrates FreeCAD's Python interpreter and merges code writing and execution into atomic operations to achieve complete tracing of the execution chain.

5. The system for generating battery pack structures based on a large model according to claim 1, characterized in that: The large model processing module integrates the LangChain framework and ChatOpenAI as the language model engine, and records the intermediate steps, decision-making basis and tool call results during the task execution process through the agent_scratchpad module.

6. A method for generating battery pack structures based on a large model, characterized in that, Includes the following steps: Receive battery pack structure design requirements input by users in natural language format; The natural language design requirements are analyzed using a large model, key parameters are extracted, and a task list is generated. Based on the task list, retrieve standardized codes, design specifications, and additional redundancy conditions related to battery pack structure design from the knowledge base; The MCP module generates Python code for the FreeCAD library based on the retrieved information. Execute the Python code of the FreeCAD library and verify the execution result; If an error occurs, modify the code according to the error message and re-execute until it succeeds. Generate the battery pack structure file and return it to the user. If the user has additional requirements, repeat the above steps.

7. The system for generating battery pack structures based on a large model according to claim 6, characterized in that: In the knowledge base retrieval step, code snippets, design templates, and best practices that match the task list are obtained from the vector database using RAG technology.

8. The system for generating battery pack structures based on a large model according to claim 6, characterized in that: When the MCP module generates Python code for the FreeCAD library, it supports custom filenames or automatically generates unique filenames containing UUID and process ID, and the code uses UTF-8 encoding.

9. The system for generating battery pack structures based on a large model according to claim 6, characterized in that: The battery pack structure file is in standard CAD format and supports front-end preview after generation. Users can submit supplementary requirements based on the preview results.