Power distribution system planning method and system based on large language model
Through the distribution system planning method based on the large language model, the large language model and visual recognition model are used to generate the initial plan, and the deep search model is combined for iterative optimization. This solves the problem of poor quality of distribution system planning schemes in the existing technology and achieves a higher quality and more adaptable planning scheme.
Patent Information
- Application Number
- CN202510908944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-10-03
AI Technical Summary
Existing distribution system planning methods lack a systematic, full-process solution, resulting in poor planning quality. In particular, they are unable to effectively cope with complexity and uncertainty when faced with large-scale access to distributed power sources and energy storage.
A method based on a large language model is adopted to obtain user text and image requirements, screen preset distribution network knowledge text paragraphs, generate an initial planning scheme, and generate a target planning scheme through iterative optimization. The scheme is optimized by combining visual recognition and deep search models.
The quality and adaptability of distribution system planning schemes have been significantly improved, which can better cope with the access of distributed power sources and energy storage, and improve the feasibility and economy of planning schemes.
Smart Images

Figure CN120746178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a distribution system planning method and system based on a large language model. Background Art
[0002] The distribution system, as the "last mile" of the power system, directly serves end users. It is a key element in ensuring the production and life of the general public, an important barrier to energy security, and a key node in energy transformation.
[0003] With the continuous advancement of the energy revolution and the rapid digital transformation of the power system, distribution system planning faces unprecedented challenges. This is because it not only needs to solve the problems of power supply reliability and economy that traditional planning needs to face, but also needs to cope with challenges such as large-scale access of distributed power sources and energy storage. The complexity and uncertainty of distribution system planning have increased significantly.
[0004] Most existing distribution system planning methods use genetic algorithms, fuzzy logic, or expert systems to obtain local optimal solutions in specific scenarios. However, these methods usually only design algorithms for an isolated link in the planning process (such as distributed generation site selection, grid topology optimization, or protection setting), lacking a systematic full-process solution, resulting in poor planning quality. Summary of the Invention
[0005] The present invention provides a distribution system planning method and system based on a large language model, which are used to solve the technical problem that the existing distribution system planning method leads to poor quality of planning solutions.
[0006] A first aspect of the present invention provides a distribution system planning method based on a large language model, comprising:
[0007] Obtaining a user text image requirement, and determining a task type corresponding to the user text image requirement based on the user text image requirement and a plurality of preset power distribution keywords;
[0008] A preset open source embedding model is used to screen multiple preset distribution network knowledge text paragraphs according to the task type to generate multiple target distribution network knowledge text paragraphs;
[0009] Generate an initial distribution system planning solution based on the user's text image requirements and multiple target distribution network knowledge text paragraphs using a large language model and a visual recognition model;
[0010] The initial power distribution system planning scheme is iteratively optimized based on a preset depth search model to generate a target power distribution system planning scheme.
[0011] Optionally, determining the task type corresponding to the user text image requirement according to the user text image requirement and a plurality of preset power distribution keywords includes:
[0012] Performing semantic vectorization on the user text request in the user text image demand, and outputting a semantic vector corresponding to the user text request;
[0013] Calculate the cosine similarity between the semantic vector and each of the preset power distribution keywords, and output the cosine similarity between the semantic vector and each of the preset power distribution keywords;
[0014] Selecting the preset power distribution keyword corresponding to the largest cosine similarity and performing confidence calculation on the semantic vector, and outputting the confidence;
[0015] Comparing the confidence level with a preset confidence threshold;
[0016] If the confidence level is greater than the preset confidence threshold, the preset power distribution keyword is used as the target task type.
[0017] Optionally, the using of a preset open source embedding model to screen a plurality of preset power distribution network knowledge text paragraphs according to the task type to generate a plurality of target power distribution network knowledge text paragraphs includes:
[0018] Preprocessing the plurality of preset distribution network knowledge text paragraphs to output a plurality of intermediate distribution network knowledge text paragraphs;
[0019] Vectorizing the plurality of intermediate distribution network knowledge text paragraphs and the task types using the preset open source embedding model, and outputting query vectors corresponding to the task types and text vectors corresponding to the respective intermediate distribution network knowledge text paragraphs;
[0020] Calculating similarity between the query vector and each of the text vectors, and outputting the similarity between the query vector and each of the text vectors;
[0021] The similarities are sorted in descending order, and the intermediate distribution network knowledge text paragraphs corresponding to the similarities of the first preset number of digits are selected as the target distribution network knowledge text paragraphs.
[0022] Optionally, the use of a large language model and a visual recognition model to generate an initial distribution system planning scheme according to the user's text image requirements and a plurality of target distribution network knowledge text paragraphs includes:
[0023] Taking the user image requirement in the user text image requirement as the input of the visual recognition model, and outputting the text element corresponding to the user image requirement;
[0024] Merging the text elements, the user text requirements in the user text image requirements, and a plurality of target power distribution network knowledge text paragraphs to output task text data;
[0025] The task text data is used as input of the large language model to output an initial power distribution system planning solution.
[0026] Optionally, the iteratively optimizing the initial power distribution system planning scheme based on a preset depth search model to generate a target power distribution system planning scheme includes:
[0027] Evaluating the initial power distribution system planning scheme using the preset depth search model to generate a scheme evaluation result;
[0028] Updating the large language model based on the solution evaluation result to determine a new large language model;
[0029] Using the task text data as input to the new large language model, outputting a new initial power distribution system planning solution, and counting the number of model updates in real time;
[0030] Comparing the model update count with a preset count threshold;
[0031] If the model update times reaches the preset times threshold, the new initial power distribution system planning scheme is used as the target power distribution system planning scheme.
[0032] Optionally, it also includes:
[0033] If the number of model updates does not reach the preset number threshold, the process jumps to the step of evaluating the initial power distribution system planning scheme using the preset depth search model and generating a scheme evaluation result until the number of model updates reaches the preset number threshold;
[0034] The new initial power distribution system planning scheme determined when the number of model updates reaches the preset number threshold is used as the target power distribution system planning scheme.
[0035] A second aspect of the present invention provides a distribution system planning system based on a large language model, comprising:
[0036] An acquisition module, configured to acquire a user text and image requirement, and determine a task type corresponding to the user text and image requirement based on the user text and image requirement and a plurality of preset power distribution keywords;
[0037] A screening module, configured to screen a plurality of preset power distribution network knowledge text paragraphs according to the task type using a preset open source embedding model to generate a plurality of target power distribution network knowledge text paragraphs;
[0038] A generation module, configured to generate an initial distribution system planning scheme based on the user's text image requirements and a plurality of target distribution network knowledge text paragraphs using a large language model and a visual recognition model;
[0039] The optimization module is used to iteratively optimize the initial power distribution system planning scheme based on a preset depth search model to generate a target power distribution system planning scheme.
[0040] A third aspect of the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the distribution system planning method based on a large language model as described in any one of the above items.
[0041] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the steps of the distribution system planning method based on a large language model as described in any one of the above.
[0042] A fifth aspect of the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer is caused to perform the steps of the distribution system planning method based on a large language model as described in any one of the above items.
[0043] It can be seen from the above technical solutions that the present invention has the following advantages:
[0044] The above scheme of the present invention provides a distribution system planning method based on a large language model. First, the user text image requirements are obtained, and the task type corresponding to the user text image requirements is determined according to the user text image requirements and multiple preset distribution keywords; then, a preset open source embedding model is used to screen multiple preset distribution network knowledge text paragraphs according to the task type to generate multiple target distribution network knowledge text paragraphs; a large language model and a visual recognition model are used to generate an initial distribution system planning scheme according to the user text image requirements and multiple target distribution network knowledge text paragraphs; finally, the initial distribution system planning scheme is iteratively optimized based on the preset deep search model to generate a target distribution system planning scheme; based on the above scheme, the present invention uses a large language model and a visual recognition model to generate an initial distribution system planning scheme according to the user text image requirements and multiple target distribution network knowledge text paragraphs, and combines the preset deep search model to iteratively optimize the initial distribution system planning scheme to generate a target distribution system planning scheme, thereby realizing a scheme optimization mechanism through large model iteration, which can significantly improve the quality of the planning scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A flowchart of a method for power distribution system planning based on a large language model provided in the first embodiment of the present invention;
[0047] Figure 2 This is an overall framework diagram of a distribution system planning method based on a large language model provided in the first embodiment of the present invention;
[0048] Figure 3 A flowchart of the search generation technology provided in the first embodiment of the present invention;
[0049] Figure 4 This is a structural block diagram of a distribution system planning system based on a large language model provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0050] The embodiments of the present invention provide a distribution system planning method and system based on a large language model, which are used to solve the technical problem that the existing distribution system planning method leads to poor quality of planning solutions.
[0051] In order to make the purpose, features, and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0052] See also Figure 1 , Figure 1 A flowchart of the steps of a distribution system planning method based on a large language model provided in Example 1 of the present invention.
[0053] The present invention provides a distribution system planning method based on a large language model, comprising:
[0054] Step 101: Obtain user text and image requirements, and determine the task type corresponding to the user text and image requirements based on the user text and image requirements and a plurality of preset power distribution keywords.
[0055] Please note that Figure 2The overall framework of this invention can be divided into five parts: 1) Question Classification Module: This module plays a pivotal role in mapping user natural language requirements and user image requirements (user text and image requirements) to each special planning sub-process. This module uses the large model to identify user intent and schedule different planning tasks, reducing model complexity. For example, the intelligent agent first receives planning requirements proposed by the user in natural language (such as "increase the new energy absorption capacity in demonstration area A by 20%" or "optimize the peak-to-valley difference of the 10kV feeder load in area B") and maps the user input to several preset sub-planning task types (such as power flow calculation, fault analysis, energy storage configuration, flexible interconnection design, etc.). This module can significantly reduce the prompt complexity of subsequent calls to the large model and also lay the foundation for multi-task parallel scheduling.
[0056] 2) Knowledge Base Retrieval Module: This module uses Retrieval-Augmented Generation (RAG) technology to organically integrate authoritative normative knowledge with the large model, improving the quality and credibility of planning solutions. This module constructs a dedicated structured knowledge base (i.e., a knowledge base consisting of all preset distribution network knowledge text paragraphs) for the national / industry standards, technical specifications, and typical cases that distribution system planning relies on. This module utilizes RAG technology, which combines vector retrieval with title-level indexing, to inject retrieved authoritative articles, design guidelines, and historical solution fragments into the Prompt of the large model through retrieval result scoring and fusion strategies, thereby improving the model's output accuracy in terms of professional terminology understanding and standard implementation. At the same time, the module labels the retrieval sources for credibility to ensure the compliance and auditability of the output recommendations.
[0057] 3) Large Model Dialogue Module: This module designs a thinking chain and constructs prompts based on the "Instruction + Few-Shot" paradigm. It uses XML (eXtensible Markup Language) for structured organization and builds prompt templates based on basic distribution system planning methods. Each time this module is called, it automatically populates content from the problem classification module and knowledge base retrieval module. Through multiple rounds of dialogue, it develops ideas, refines technical details, and verifies intermediate results, ultimately outputting a distribution system planning solution.
[0058] 4) Tool Call Module: When the distribution system planning solution is output through the Large Model Dialogue Module, the Tool Call Module is called to integrate the LLM with external tools. The Model Context Protocol (MCP) is used as a common interface specification, defining key information fields such as the intent identifier (mcp_intent), parameter structure (mcp_params), execution constraints (mcp_timeout, mcp_retry), and result encapsulation (mcp_output). Based on this protocol, the module can dynamically schedule, including but not limited to: browser automation scripts to obtain geographic information or online load statistics, maps, or GIS tool interfaces for line site selection and visualization analysis; and power system simulation software such as OpenDSS.
[0059] 5) Scheme Evaluation Module: This module proposes a dual-model closed-loop iterative performance optimization and tuning approach. Using these two models, the module iterates and fine-tunes the evaluation scheme, ultimately achieving a superior solution. Model A (the large language model) generates the initial planning proposal, while Model B (the pre-set deep search model) acts as the "evaluator," automatically scoring and diagnosing the proposal based on pre-set multi-dimensional indicators such as reliability, affordability, and new energy consumption. The evaluation results are fed back to Model A to modify prompts or parameters. After several iterations, the threshold requirements are met, significantly improving the inherent quality and feasibility of the proposal.
[0060] Specifically, step 101 may include the following sub-steps S11-S15:
[0061] Step S11: semantically vectorize the user text request in the user text image request, and output a semantic vector corresponding to the user text request;
[0062] Step S12: Calculate the cosine similarity between the semantic vector and each preset power distribution keyword, and output the cosine similarity between the semantic vector and each preset power distribution keyword;
[0063] Step S13: Select the preset power distribution keyword and semantic vector corresponding to the largest cosine similarity, perform confidence calculation, and output the confidence;
[0064] Step S14: comparing the confidence level with a preset confidence threshold;
[0065] Step S15: If the confidence level is greater than a preset confidence threshold, the preset power distribution keyword is used as the target task type.
[0066] It should be noted that the question classification module plays a pivotal role in mapping user needs (i.e., user text and image needs, including user text needs and user image needs, where user text needs refer to user natural language needs) to each special planning sub-process. Its design concept is similar to the Mixed Expert Models (MoE) in the concept of large models. The large model is used to identify user intent and schedule different planning tasks. Specifically, the module semantically vectorizes user text needs and matches them with domain-preset power distribution keywords. When the confidence level of the match between the user text need and a preset power distribution keyword exceeds a set threshold, the system immediately selects the corresponding process, i.e., uses the preset power distribution keyword as the task type of the user need. If the confidence level does not exceed the set threshold, manual intervention is required.
[0067] For example, if the intent is identified as "distributed power planning," the distributed power capacity assessment, grid stability analysis, and economic calculation submodules are activated; if the need for "intelligent soft switch planning" is identified, the corresponding strategy generation process is switched to. In this way, the problem classification module achieves seamless switching between different professional sub-processes while maintaining a unified calling interface for the entire system, greatly improving the model's adaptability and response efficiency to segmented scenarios, while ensuring the professional accuracy and controllability of the output results. In addition, it has excellent functional scalability and can plan for different user needs.
[0068] Step 102: Using a preset open source embedding model to screen multiple preset distribution network knowledge text paragraphs according to task types, and generate multiple target distribution network knowledge text paragraphs.
[0069] Specifically, step 102 may include the following sub-steps S21-S24:
[0070] Step S21: pre-process multiple preset distribution network knowledge text paragraphs and output multiple intermediate distribution network knowledge text paragraphs;
[0071] Step S22: vectorize multiple intermediate distribution network knowledge text paragraphs and task types using a preset open source embedding model, and output query vectors corresponding to the task types and text vectors corresponding to each intermediate distribution network knowledge text paragraph;
[0072] Step S23: Calculate similarity between the query vector and each text vector, and output the similarity between the query vector and each text vector;
[0073] Step S24 : sorting the similarities in descending order, and selecting the intermediate distribution network knowledge text paragraphs corresponding to the first preset number of digits of similarity as the target distribution network knowledge text paragraphs.
[0074] The preset distribution network knowledge text paragraphs are text paragraphs from a series of industry standards and documents such as "DL_T 5729-2023 Technical Guidelines for Distribution Network Planning and Design", "DL_T5729-2023 Technical Guidelines for Distribution Network Planning and Design", "DL / T 5118 Rural Power Grid Planning and Design Guidelines", "Technical Parameter Specifications for Distribution Equipment Inventory" and "10kV Distribution Network Construction Planning and Case Analysis".
[0075] Please note that Figure 3 The present invention selects a series of industry standards and documents including "DL_T 5729-2023 Technical Guidelines for Distribution Network Planning and Design", "DL_T 5729-2023 Technical Guidelines for Distribution Network Planning and Design", "DL / T 5118 Guidelines for Rural Power Grid Planning and Design", "Technical Parameter Specifications for Distribution Equipment Inventory" and "10kV Distribution Network Construction Planning and Case Analysis" to construct a knowledge base (a knowledge base composed of all preset distribution network knowledge text paragraphs), and performs refined preprocessing operations on all preset distribution network knowledge text paragraphs. The process includes text cleaning, format unification, and segmentation based on semantic text segmentation strategy, dividing the text into knowledge units with relatively complete semantics and moderate length (i.e., intermediate distribution network knowledge text paragraphs).
[0076] Furthermore, the open source embedding model nomic-embed-text (preset open source embedding model) was selected to perform vectorized conversion of knowledge units and task types (the nomic-embed-text model has outstanding training performance on both Chinese and English corpora and can accurately identify the deep semantics of terms), mapping text units into high-dimensional vectors to form a knowledge base.
[0077] Furthermore, to efficiently retrieve existing vectorized knowledge, the FAISS (Facebook AI Similarity Search) vector database technology is introduced during knowledge retrieval. This technology builds a high-density vector nearest neighbor index, optimizing similarity searches between large-scale vectors to milliseconds. When a user submits a specific distribution planning requirement (a text-based image requirement), the task type is vectorized using a nomic-embed-text model to generate a query vector. The retrieval module then uses this query vector to search the vector database for highly similar vectors. This involves calculating similarity between the query vector and each text vector, outputting the similarity between the query vector and each text vector, and recalling the top-k knowledge base text passages (target distribution network knowledge passages) most relevant to the query. These recalled passages are ranked according to their relevance to the query and then merged with the original input (the user text requirement) and text elements to form an enhanced input (task text data) supported by external evidence. This enhanced input is then submitted as a prompt to the large model (large language model). By referring to the knowledge retrieved from the knowledge base, LLM can generate more accurate and professional distribution system planning solutions.
[0078] Step 103: Use a large language model and a visual recognition model to generate an initial distribution system planning scheme based on the user's text image requirements and multiple target distribution network knowledge text paragraphs.
[0079] Specifically, step 103 may include the following sub-steps S31-S33:
[0080] Step S31: using the user image requirement in the user text image requirement as the input of the visual recognition model, and outputting the text elements corresponding to the user image requirement;
[0081] Step S32: Merge the text elements, the user text requirements in the user text image requirements, and multiple target power distribution network knowledge text paragraphs to output task text data;
[0082] Step S33: Use the task text data as input to the large language model and output an initial distribution system planning solution.
[0083] The large language model is the GLM-Z1 (General Language Model - Zero-shot Inference 1) model, and the visual recognition model is the GLM-4V (General Language Model - 4th Version Vision) model. The present invention selects GLM-Z1 as the basic inference engine of the large model dialogue module and GLM-4V as the visual recognition engine.
[0084] It should be noted that the thinking chain design based on the large language model outputs the initial distribution system planning scheme according to the task text data. Among them, the thinking chain design: understands user needs (the model obtains and refines the goals, constraints and priorities proposed by the user through the dialogue module, and converts them into internally operational demand descriptions) → analyzes existing conditions (the system automatically calls the knowledge base retrieval and data acquisition interface to comprehensively sort out the existing network topology, equipment parameters, historical loads and operating boundary conditions and other factors to lay a data foundation for scheme generation) → proposes a planning scheme (based on the dual grasp of needs and conditions, the large model proposes a preliminary scheme, including network reconstruction strategy, capacity configuration recommendations and operating condition division, etc.) → evaluates the feasibility of the scheme (by calling other models to conduct a multi-dimensional evaluation of the safety, economy and reliability of the planning results) → makes rectifications to the evaluated scheme (the system adjusts the scheme that does not meet the indicators until all indicators are met) → outputs planning suggestions (the optimized scheme is summarized into a structured planning suggestion report).
[0085] Furthermore, for the task text data: 1) Understand User Needs: Carefully review the distribution system planning requirements provided by the user, including key information such as load types, power supply range, and reliability requirements. Ensure you fully understand the user's objectives and constraints. 2) Analyze Existing Conditions: Based on the user's data, including the existing grid structure, equipment parameters, and geographic information, analyze the strengths and weaknesses of the current distribution system. Focus on key indicators such as load distribution, power supply radius, and equipment capacity. 3) Based on the analysis results, propose a reasonable distribution system planning scheme. The scheme should include the distribution network topology (e.g., radial, ring, etc.), equipment selection (e.g., transformers, switchgear), load distribution strategy, and reliability improvement measures (e.g., backup power supply, automation equipment, etc.). 4) Propose Planning Scheme: Conduct a technical and economic evaluation of the proposed scheme, including investment cost, operating efficiency, and reliability indicators. Ensure that the scheme meets user needs while offering a high cost-effectiveness. 5) Evaluate Scheme Feasibility: Conduct a technical and economic evaluation of the scheme, including investment cost, operating efficiency, and reliability indicators. Ensure that the scheme meets user needs while offering a high cost-effectiveness. 6) Output planning suggestions: Present the final plan to the user in clear and concise language. Avoid using technical terms to ensure that users can easily understand it. The output should not contain any XML tags.
[0086] Notably, the tool invocation module integrates the Large Language Model (LLM) with external tools. When generating solutions using the large language model (LLM) in the large model dialogue module, the LLM considers the solution according to a pre-defined chain of thought. During this process, the LLM determines whether and which tools are needed. If so, the tool invocation module executes the corresponding tool invocation. Specifically, by designing a tool invocation module based on the Model Context Protocol (MCP), leveraging the MCP's standardized interface, it enables flexible scheduling and integration of various external tools. MCP defines a standardized data structure and interaction paradigm, encompassing key fields such as "call intent" (mcp_intent), structured "parameter passing" (mcp_params), "execution constraints" (such as timeout thresholds and concurrency control strategies), and standardized "result encapsulation" (mcp_output). When the LLM needs to invoke an external tool while generating a distribution system plan, it simply embeds a context snippet conforming to the MCP specification into the tool's output text. The tool calling module can automatically parse this context fragment, accurately identify the calling intent, and complete the precise docking of external components.
[0087] For example, the MCP can interact with network resources, such as acquiring geographic information data and accessing online map services, providing critical data support for distribution line routing and terrain assessment. Furthermore, the module can integrate with power system simulation software (such as OpenDSS) through API calls. This enables the agent to automatically perform key power system analyses, including power flow calculations, short-circuit current analysis, and protection coordination simulation, providing quantitative evidence for the technical feasibility of planning solutions.
[0088] Among them, the tool call module also supports loading Python programs, MATLAB scripts or external API interfaces edited by users to execute customized functions.
[0089] Step 104: Iteratively optimize the initial power distribution system planning scheme based on a preset depth search model to generate a target power distribution system planning scheme.
[0090] Specifically, step 104 may include the following sub-steps S41-S45:
[0091] Step S41: Evaluate the initial power distribution system planning scheme using a preset depth search model to generate a scheme evaluation result;
[0092] Step S42: updating the large language model based on the solution evaluation result to determine a new large language model;
[0093] Step S43: Use the task text data as input to the new large language model, output a new initial distribution system planning scheme, and count the number of model updates in real time;
[0094] Step S44: Compare the model update times with a preset times threshold;
[0095] Step S45: If the number of model updates reaches a preset threshold, the new initial power distribution system planning scheme is used as the target power distribution system planning scheme.
[0096] The default depth search model is the deepseek model.
[0097] It should be noted that the present invention proposes a performance optimization and tuning method based on dual-model closed-loop iteration, in which model A (large language model) is used as the "main generator" to generate planning schemes with the assistance of modules such as knowledge base retrieval, tool calling and problem classification; then the independent model B acts as the "judge" to objectively judge the scheme output by model A from multiple aspects such as rationality, economy, feasibility and potential risks, and then injects the judgment results of model B (preset deep search model) into the context of model A with the help of a memory enhancement mechanism, that is, to optimize the thinking connection design of the large language model, thereby guiding it to optimize the structure, adjust parameters and supplement omissions in a targeted manner in the next round of iteration, until the cycle is repeated a sufficient number of times, and output the final distribution system planning scheme (that is, the target distribution system planning scheme).
[0098] Optionally, it also includes:
[0099] If the number of model updates does not reach the preset threshold, the process jumps to the step of evaluating the initial distribution system planning scheme using the preset depth search model and generating a scheme evaluation result until the number of model updates reaches the preset threshold.
[0100] The new initial power distribution system planning scheme determined when the number of model updates reaches a preset number threshold is used as the target power distribution system planning scheme.
[0101] It should be noted that if the number of model updates does not reach the preset threshold, the process jumps to step S41 until the number of model updates reaches the preset threshold; the new initial distribution system planning scheme determined when the number of model updates reaches the preset threshold is used as the target distribution system planning scheme.
[0102] In this embodiment, through a closed-loop "generate-evaluate-regenerate" architecture, the intelligent agent continuously accumulates targeted improvement experience during the iterative process, gradually optimizing the solution. Compared with single-model end-to-end generation, this method's greatest advantage lies in decoupling evaluation from generation, allowing the objective evaluation of model B to effectively compensate for any deviations in professionalism or textual expression in model A. Furthermore, a memory-enhancing mechanism ensures the continued influence of historical feedback in subsequent iterations, significantly improving solution quality and generation efficiency.
[0103] As a comparison of technical effects, we can refer to existing technologies. Distribution system planning methods have evolved from traditional deterministic single-objective, single-method planning to uncertain, multi-objective intelligent planning. The application of artificial intelligence technology in distribution system planning has also made long-term progress. However, existing research still has some shortcomings: First, traditional artificial intelligence methods generally target a single link or specific problem in planning and lack a systematic, full-process solution; second, most existing models rely on high-quality historical data and have high requirements for data quality and integrity; third, the application of LLM and artificial intelligence technology in the field of distribution system planning is still in its infancy. How to fully utilize the knowledge reasoning and decision support capabilities of large models to effectively plan distribution systems remains a difficult problem that needs to be solved.
[0104] In response to the above problems, the present invention proposes a distribution system planning method based on a large language model, aiming to solve the problems of information fragmentation and lack of adaptability in traditional planning, thereby improving the feasibility and economy of the planning scheme. Specifically, the overall framework of the present invention is divided into five modules: large model dialogue, knowledge base retrieval, problem classification, tool calling and scheme evaluation, to achieve modular processing of distribution system planning tasks. In the large model dialogue module, a thinking chain reasoning process is designed to construct a structured prompt word template based on XML tags; in the knowledge base retrieval module, retrieval enhancement generation technology is used to achieve rapid professional knowledge retrieval; the problem classification module draws on the idea of hybrid expert model to achieve intelligent diversion of different planning tasks; the tool calling module is based on the model context protocol standard to achieve efficient integration of LLM and external tools. A scheme optimization and evaluation mechanism based on dual-model closed-loop iteration is proposed, which significantly improves the quality of the planning scheme through the "generation-judgment-regeneration" optimization process.
[0105] In an embodiment of the present invention, the present invention provides a distribution system planning method based on a large language model. First, the user text image requirement is obtained, and the task type corresponding to the user text image requirement is determined according to the user text image requirement and multiple preset distribution keywords; then, a preset open source embedding model is used to screen multiple preset distribution network knowledge text paragraphs according to the task type to generate multiple target distribution network knowledge text paragraphs; a large language model and a visual recognition model are used to generate an initial distribution system planning scheme according to the user text image requirement and multiple target distribution network knowledge text paragraphs; finally, the initial distribution system planning scheme is iteratively optimized based on the preset deep search model to generate a target distribution system planning scheme; based on the above scheme, the present invention uses a large language model and a visual recognition model to generate an initial distribution system planning scheme according to the user text image requirement and multiple target distribution network knowledge text paragraphs, and combines the preset deep search model to iteratively optimize the initial distribution system planning scheme to generate a target distribution system planning scheme, thereby realizing a scheme optimization mechanism through large model iteration, which can significantly improve the quality of the planning scheme.
[0106] See also Figure 4 , Figure 4 This is a structural block diagram of a distribution system planning system based on a large language model provided in Example 2 of the present invention.
[0107] The present invention provides a distribution system planning system based on a large language model, comprising:
[0108] The acquisition module 401 is used to obtain the user's text and image requirements, and determine the task type corresponding to the user's text and image requirements based on the user's text and image requirements and multiple preset power distribution keywords;
[0109] A screening module 402 is configured to screen a plurality of preset power distribution network knowledge text paragraphs according to a task type using a preset open source embedding model to generate a plurality of target power distribution network knowledge text paragraphs;
[0110] A generation module 403 is configured to generate an initial distribution system planning scheme based on user text and image requirements and multiple target distribution network knowledge text paragraphs using a large language model and a visual recognition model;
[0111] The optimization module 404 is configured to iteratively optimize the initial power distribution system planning scheme based on a preset depth search model to generate a target power distribution system planning scheme.
[0112] Furthermore, the acquisition module 401 is specifically configured to:
[0113] Perform semantic vectorization on the user text request in the user text image demand, and output the semantic vector corresponding to the user text request;
[0114] Calculate the cosine similarity between the semantic vector and each preset power distribution keyword, and output the cosine similarity between the semantic vector and each preset power distribution keyword;
[0115] Select the preset power distribution keyword and semantic vector corresponding to the largest cosine similarity, perform confidence calculation, and output the confidence score;
[0116] Compare the confidence level with the preset confidence threshold;
[0117] If the confidence level is greater than the preset confidence threshold, the preset power distribution keyword is used as the target task type.
[0118] Furthermore, the screening module 402 is specifically configured to:
[0119] Preprocessing a plurality of preset distribution network knowledge text paragraphs, and outputting a plurality of intermediate distribution network knowledge text paragraphs;
[0120] A preset open-source embedding model is used to vectorize multiple intermediate distribution network knowledge text paragraphs and task types, outputting query vectors corresponding to task types and text vectors corresponding to each intermediate distribution network knowledge text paragraph.
[0121] Calculate the similarity between the query vector and each text vector, and output the similarity between the query vector and each text vector;
[0122] The similarities are sorted in descending order, and the intermediate distribution network knowledge text paragraphs corresponding to the similarities of the first preset number of digits are selected as the target distribution network knowledge text paragraphs.
[0123] Furthermore, the generating module 403 is specifically configured to:
[0124] The user image requirement in the user text image requirement is used as the input of the visual recognition model, and the text elements corresponding to the user image requirement are output;
[0125] Merge text elements, user text requirements in user text image requirements, and multiple target distribution network knowledge text paragraphs to output task text data;
[0126] The task text data is used as the input of the large language model, and the initial distribution system planning scheme is output.
[0127] Furthermore, the optimization module 404 is specifically configured to:
[0128] Use a preset depth search model to evaluate the initial distribution system planning scheme and generate scheme evaluation results;
[0129] Update the large language model based on the solution evaluation results and determine a new large language model;
[0130] The task text data is used as the input of a new large language model, which outputs a new initial distribution system planning scheme and counts the number of model updates in real time.
[0131] Comparing the number of model updates with a preset threshold;
[0132] If the number of model updates reaches a preset threshold, the new initial distribution system planning scheme is used as the target distribution system planning scheme.
[0133] In an optional system embodiment, the system further includes:
[0134] The first module is configured to jump to the step of evaluating the initial distribution system planning scheme using a preset depth search model and generating a scheme evaluation result if the number of model updates does not reach a preset number threshold, until the number of model updates reaches a preset number threshold;
[0135] The second module is configured to use a new initial power distribution system planning scheme determined when the number of model updates reaches a preset number threshold as a target power distribution system planning scheme.
[0136] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] An embodiment of the present invention also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory; when the computer program is executed by the processor, the processor executes the steps of the distribution system planning method based on a large language model as described in any of the above embodiments.
[0138] An embodiment of the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the distribution system planning method based on a large language model as in any of the above embodiments are implemented.
[0139] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the distribution system planning method based on a large language model as in any of the above embodiments.
[0140] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0141] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0142] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A distribution system planning method based on a large language model, characterized in that: include: Obtaining a user text image requirement, and determining a task type corresponding to the user text image requirement based on the user text image requirement and a plurality of preset power distribution keywords; A preset open source embedding model is used to screen multiple preset distribution network knowledge text paragraphs according to the task type to generate multiple target distribution network knowledge text paragraphs; Generate an initial distribution system planning solution based on the user's text image requirements and multiple target distribution network knowledge text paragraphs using a large language model and a visual recognition model; The initial power distribution system planning scheme is iteratively optimized based on a preset depth search model to generate a target power distribution system planning scheme.
2. The power distribution system planning method based on a large language model according to claim 1, characterized in that: The determining, based on the user text image requirement and a plurality of preset power distribution keywords, a task type corresponding to the user text image requirement includes: Performing semantic vectorization on the user text request in the user text image demand, and outputting a semantic vector corresponding to the user text request; Calculate the cosine similarity between the semantic vector and each of the preset power distribution keywords, and output the cosine similarity between the semantic vector and each of the preset power distribution keywords; Selecting the preset power distribution keyword corresponding to the largest cosine similarity and performing confidence calculation on the semantic vector, and outputting the confidence; Comparing the confidence level with a preset confidence threshold; If the confidence level is greater than the preset confidence threshold, the preset power distribution keyword is used as the target task type.
3. The power distribution system planning method based on a large language model according to claim 1, characterized in that: The method uses a preset open source embedding model to screen multiple preset distribution network knowledge text paragraphs according to the task type to generate multiple target distribution network knowledge text paragraphs, including: Preprocessing the plurality of preset distribution network knowledge text paragraphs to output a plurality of intermediate distribution network knowledge text paragraphs; Vectorizing the plurality of intermediate distribution network knowledge text paragraphs and the task types using the preset open source embedding model, and outputting query vectors corresponding to the task types and text vectors corresponding to the respective intermediate distribution network knowledge text paragraphs; Calculating similarity between the query vector and each of the text vectors, and outputting the similarity between the query vector and each of the text vectors; The similarities are sorted in descending order, and the intermediate distribution network knowledge text paragraphs corresponding to the similarities of the first preset number of digits are selected as the target distribution network knowledge text paragraphs.
4. The power distribution system planning method based on a large language model according to claim 1, characterized in that: The method of using a large language model and a visual recognition model to generate an initial distribution system planning scheme according to the user's text image requirements and a plurality of target distribution network knowledge text paragraphs includes: Taking the user image requirement in the user text image requirement as the input of the visual recognition model, and outputting the text element corresponding to the user image requirement; Merging the text elements, the user text requirements in the user text image requirements, and a plurality of target power distribution network knowledge text paragraphs to output task text data; The task text data is used as input of the large language model to output an initial power distribution system planning solution.
5. The power distribution system planning method based on a large language model according to claim 1, characterized in that: The iterative optimization of the initial power distribution system planning scheme based on the preset depth search model to generate a target power distribution system planning scheme includes: Evaluating the initial power distribution system planning scheme using the preset depth search model to generate a scheme evaluation result; Updating the large language model based on the solution evaluation result to determine a new large language model; Using the task text data as input to the new large language model, outputting a new initial power distribution system planning solution, and counting the number of model updates in real time; Comparing the model update count with a preset count threshold; If the model update times reaches the preset times threshold, the new initial power distribution system planning scheme is used as the target power distribution system planning scheme.
6. The power distribution system planning method based on a large language model according to claim 5, characterized in that: Also includes: If the number of model updates does not reach the preset number threshold, the process jumps to the step of evaluating the initial power distribution system planning scheme using the preset depth search model and generating a scheme evaluation result until the number of model updates reaches the preset number threshold; The new initial power distribution system planning scheme determined when the number of model updates reaches the preset number threshold is used as the target power distribution system planning scheme.
7. A distribution system planning system based on a large language model, characterized in that: include: An acquisition module, configured to acquire a user text and image requirement, and determine a task type corresponding to the user text and image requirement based on the user text and image requirement and a plurality of preset power distribution keywords; A screening module, configured to screen a plurality of preset power distribution network knowledge text paragraphs according to the task type using a preset open source embedding model to generate a plurality of target power distribution network knowledge text paragraphs; A generation module, configured to generate an initial distribution system planning scheme based on the user's text image requirements and a plurality of target distribution network knowledge text paragraphs using a large language model and a visual recognition model; The optimization module is used to iteratively optimize the initial power distribution system planning scheme based on a preset depth search model to generate a target power distribution system planning scheme.
8. A computer device, characterized in that: It includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the distribution system planning method based on a large language model as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the distribution system planning method based on the large language model as described in any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer is caused to execute the distribution system planning method based on a large language model as described in any one of claims 1 to 6.