Electric power market power calculation method based on artificial intelligence
By combining the market power analysis platform with MCP services and the large language model platform, and utilizing the RAG knowledge base and large language model to calculate the power market power, the limitations of traditional methods in data utilization and interaction under dynamic regulatory rules have been solved, enabling efficient processing and dynamic adaptation of complex problems.
Patent Information
- Application Number
- CN202511515721.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-03-17
AI Technical Summary
Traditional power market analysis methods are ill-suited to handling dynamic and complex issues. In the face of frequent changes in regulatory rules, rigid development models struggle to respond quickly to demands, data utilization and interaction are limited, and the ability to handle complex problems is insufficient.
An AI-based power market power calculation method is adopted. The market power analysis platform connects the MCP service and the large language model platform. The RAG knowledge base and the large language model platform are used for keyword matching and tool invocation to achieve natural language interaction and knowledge fusion, and work together to adapt to changing needs.
It has improved the data utilization and interaction capabilities for calculating and analyzing market power in the electricity market, enhanced the ability to handle complex problems, and met the dynamic regulatory needs of the electricity market.
Smart Images

Figure CN121684971A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based method for calculating market power in the electricity market. Background Technology
[0002] Market power risk prevention is an important guarantee for the stable and reliable operation of the power industry. Its main contents include market outcome indicators, market behavior indicators, and market operation indicators.
[0003] Currently, most power market power analysis systems are developed based on the Java technology stack. Leveraging the performance of compiled languages and the advantages of the Spring ecosystem, they perform stably in numerical calculation scenarios with fixed rules and can be efficiently integrated into existing enterprise systems to complete the calculation of core indicators. However, traditional power market power analysis methods struggle to handle dynamic and complex problems. Faced with frequent changes in regulatory rules, their rigid development model cannot quickly respond to demands, limiting knowledge integration and dynamic analysis. Summary of the Invention
[0004] In view of this, the present invention provides an artificial intelligence-based method for calculating the market power of the electricity market. The main purpose is to solve the problems of traditional electricity market power analysis methods, such as limitations in data utilization and interaction, insufficient ability to handle complex problems, and difficulty in adapting to dynamic regulatory needs.
[0005] According to one aspect of the present invention, an artificial intelligence-based method for calculating market power in the electricity market is provided, applied to a market power analysis platform, the market power analysis platform being connected to an MCP service and a large language model platform, the method comprising: The system receives user queries related to market power analysis and performs keyword matching between the queries and a pre-built RAG knowledge base to obtain knowledge base retrieval results. Obtain the list of available tools in the MCP service, and integrate the list of available tools, the query statement, and the knowledge base retrieval results and send them to the large language model platform, so that the large language model platform can determine the target computing tool to be called and return a structured calling instruction; The system receives the structured call instruction returned by the large language model platform, and initiates a tool call request to the MCP service based on the structured call instruction, so that the MCP service calls and executes relevant market power analysis calculation operations based on the API interface provided by the target computing tool, and returns the call execution result; The system receives the execution result of the call, integrates the execution result with the query statement, and sends it to the large language model platform so that the large language model platform can generate a response to the query statement.
[0006] Furthermore, the large language model platform is built from a base model through fine-tuning, and the construction process includes: The base model is fine-tuned to obtain a fine-tuned base model that meets the evaluation conditions; The fine-tuned base model is format-converted and loaded into the large language model platform so that the large language model platform can provide natural language processing services.
[0007] Furthermore, the RAG knowledge base is pre-built based on knowledge documents related to power market forces, and the construction process includes: The document related to power market forces is obtained and preprocessed to obtain several text blocks; the preprocessing includes parsing, cleaning, and segmentation. The semantic information in the text block is converted into a semantic vector through an embedded model; An index is created for each of the semantic vectors, and the indexed semantic vectors are stored in the RAG knowledge base.
[0008] Furthermore, the MCP service provides at least five tools: a core calculation tool that can execute SQL query statements, a data discovery tool that searches for database table names based on Chinese annotations, a calculation support tool that obtains the structural information of specified table fields, a service stability tool that obtains database row-level locks, and a market power analysis calculation tool.
[0009] Furthermore, the step of initiating a tool invocation request to the MCP service based on the structured invocation instruction, so that the MCP service can invoke and execute calculation operations related to market power analysis based on the API interface provided by the target calculation tool, includes: The structured invocation instructions are parsed to obtain the target tool type, specific calculation parameters, permission identifier, and data format requirements; The parsed instructions are converted into a calling format compatible with the MCP service; The MCP service, based on the converted request, calls the target calculation tool through a preset API interface, so that the target calculation tool performs calculations related to market power analysis based on the specific calculation parameters.
[0010] Furthermore, the method also includes: Based on actual business needs, prompt content is constructed on the interactive interface of the market power analysis platform. The prompt content includes at least one of the following: tool usage rules, table structure and dependencies, and market power index analysis and calculation methods.
[0011] Furthermore, the method also includes: After the MCP service call is completed, a structured document is automatically generated through the data summary hook and injected into the RAG knowledge base; the structured document contains information including the success rate and response time of the MCP tool; Receive user feedback on the response content and convert the feedback information into structured knowledge and inject it into the RAG knowledge base; By combining the feedback information, the success rate of the MCP tool, and the response time, the recall and reordering accuracy, tool invocation decision-making, and semantic understanding and response generation capabilities are optimized.
[0012] According to another aspect of the present invention, a market power determination device for an electricity market is provided, comprising: The receiving and retrieval module is used to receive user queries related to market power analysis, and match the queries with keywords in a pre-built RAG knowledge base to obtain knowledge base retrieval results. The first response module is used to obtain a list of available tools in the MCP service, and to integrate the list of available tools, the query statement and the knowledge base retrieval results and send them to the large language model platform, so that the large language model platform can determine the target computing tool to be called and return a structured calling instruction; The MCP service module is used to receive the structured call instruction returned by the large language model platform, and initiate a tool call request to the MCP service based on the structured call instruction, so that the MCP service can call and execute relevant market power analysis calculation operations based on the API interface provided by the target computing tool, and return the call execution result; The second response module is used to receive the call execution result, integrate the call execution result with the query statement, and send it to the large language model platform so that the large language model platform can generate a response to the query statement.
[0013] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform operations corresponding to the above-described artificial intelligence-based electricity market power calculation method.
[0014] According to another aspect of the present invention, an electronic device is provided, including a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform operations corresponding to the above-described artificial intelligence-based electricity market power calculation method.
[0015] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages: This invention provides an artificial intelligence-based method for calculating market power in the electricity market. Compared with existing technologies, this invention receives user queries related to market power analysis and performs keyword matching between the queries and a pre-built RAG knowledge base to obtain knowledge base retrieval results. It then obtains a list of available tools from the MCP service and integrates the list of available tools, the queries, and the knowledge base retrieval results, sending them to the large language model platform. This allows the large language model platform to determine the target calculation tool to be invoked and return a structured invocation instruction. Finally, it receives the structured invocation instruction returned by the large language model platform and initiates a tool invocation request to the MCP service based on the structured invocation instruction, enabling the MCP service to... The system calls and executes market power analysis calculations based on the API interface provided by the target calculation tool, and returns the execution results. It receives these results, integrates them with the query statement, and sends them to the large language model platform. This allows the large language model platform to generate a response to the query statement, enabling collaborative work between the market power analysis platform, the large language model platform, the RAG knowledge base, and the MCP service. Through natural language interaction, it adapts to changing needs; through knowledge fusion, it assists in complex analysis; and through tool coordination, it achieves complementary advantages. This enables the calculation and analysis of market power in the electricity market, improving data utilization and interaction while enhancing the ability to handle complex problems, thus meeting the dynamic regulatory needs of the electricity market.
[0016] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 The diagram illustrates a flowchart of an artificial intelligence-based method for calculating market power in the electricity market, as provided in an embodiment of the present invention. Figure 2 A flowchart illustrating a RAG knowledge base construction process provided by an embodiment of the present invention is shown; Figure 3 This diagram illustrates the workflow of an MCP service provided by an embodiment of the present invention. Figure 4 The diagram illustrates a flowchart of an interaction method for a market power analysis platform provided in an embodiment of the present invention. Figure 5 The diagram illustrates a process for dynamic knowledge injection according to an embodiment of the present invention. Detailed Implementation
[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0019] This invention provides an artificial intelligence-based method for calculating market power in the electricity market. This method is applied to a market power analysis platform that connects to an MCP service and a large language model platform, such as... Figure 1 As shown, the method includes: 101. Receive user queries related to market power analysis, and match the queries with keywords in a pre-built RAG knowledge base to obtain knowledge base retrieval results; In this embodiment of the invention, the execution terminal where the market power analysis platform is located is the current execution terminal (hereinafter referred to as the current execution terminal). The current execution terminal receives query statements from users regarding market power analysis, such as "analyze the current HHI index of power generation groups" or "calculate the Top-m index of power generation groups in East China in Q1 2024," etc. This embodiment of the invention does not impose specific limitations. After receiving the user's query statement, the current execution terminal performs keyword matching between the query statement and a pre-built RAG knowledge base to obtain the knowledge base retrieval results. The RAG knowledge base is pre-built based on knowledge documents related to electricity market power, facilitating data utilization and data interaction, such as... Figure 2 As shown, its construction process includes: (1) Obtain the knowledge document related to the power market and preprocess the knowledge document related to the power market to obtain several text blocks; the preprocessing includes parsing, cleaning and segmentation; since the text blocks obtained in this embodiment of the invention are relatively complete in semantics after parsing, cleaning and precise segmentation, and the data volume of a single text block is within a preset size range, this embodiment of the invention does not make specific limitations.
[0020] (2) The semantic information in the text block is converted into a semantic vector through an embedded model. The embedded model receives the text block as input and converts the semantic information of the text block into a fixed-dimensional numerical vector through the neural network structure inside the model. The core function of the embedded model is to convert the text block into a computer-understandable semantic vector, realize the numerical representation of the text, and thus support efficient semantic retrieval. Considering the knowledge characteristics of the power market scenario (such as dense professional terminology and rigorous rule logic), commonly used embedded models include BERT series models, Word2Vec models, ER models, TAXIS models, etc., and this embodiment of the invention does not make specific limitations.
[0021] (3) Create an index for each of the semantic vectors and store the indexed semantic vectors in the RAG knowledge base. The RAG knowledge base achieves efficient retrieval of semantic vectors through the constructed indexes, so that the retrieval response time does not exceed the preset time.
[0022] 102. Obtain the list of available tools in the MCP service, and integrate the list of available tools, the query statement and the knowledge base retrieval results and send them to the large language model platform, so that the large language model platform can determine the target computing tool to be called and return a structured calling instruction; In this embodiment of the invention, the current execution end obtains a list of available tools in the MCP service. The MCP service provides at least five tools: a core calculation tool that can execute SQL queries, a data discovery tool that searches for database table names based on Chinese annotations, a calculation support tool that obtains the structural information of specified table fields, a service stability tool that obtains database row-level locks, and a market power analysis calculation tool. The market power analysis calculation tool is a pre-trained and deployed calculation tool with the ability to calculate market power-related indicators, including market outcome indicators, market behavior indicators, and market operation indicators. This embodiment of the invention does not impose specific limitations on this tool.
[0023] After obtaining the list of available tools from the MCP service, the current execution end needs to integrate the list of available tools, the user's query statement, and the knowledge base retrieval results obtained from the RAG knowledge base before sending them to the large language model platform. The large language model platform is built from a base model through fine-tuning, and the construction process includes: (1) Fine-tune the base model to obtain a fine-tuned base model that meets the evaluation conditions; for example, make relevant fine-tuning settings on the fine-tuning tool page developed on the current execution end and start fine-tuning. When the loss decreases too slowly, try to increase the learning rate. If the loss is still decreasing after training, increase the number of training rounds to ensure fitting, etc. After fine-tuning, evaluate the fine-tuning effect. If the fine-tuning effect is ideal, export the fine-tuned model. This embodiment of the invention does not make specific limitations. Among them, the base model is an AI model that has been pre-trained on large-scale data and has multi-task processing capabilities. It can understand and generate natural language, process multimodal data such as images and videos, and provide a foundation for various specific task models. It is usually built based on deep neural networks. The Transformer architecture is widely used in large language models. Taking language base models such as GPT-3 and GLM-4-Plus as examples, they learn language knowledge and semantic expressions through pre-training on massive text data, and understand and generate natural language. This embodiment of the invention does not make specific limitations on the base model.
[0024] (2) The fine-tuned base model is format-converted and loaded into the large language model platform so that the large language model platform can provide natural language processing services. The large language model platform provides a port for invocation and can also deploy local database access, data analysis services, etc. based on the HTTP + SSE transmission scheme. This embodiment of the invention does not make specific limitations.
[0025] In this embodiment of the invention, when the finely tuned base model in the large language model platform is invoked, natural language processing is performed based on the uploaded list of available tools, query statements, and knowledge base retrieval results to determine the target computing tool to be invoked. The target computing tool is used to calculate at least one of market outcome indicators, market behavior indicators, market operation indicators, etc., and this embodiment of the invention does not impose specific limitations. The target computing tool can also be deployed on a third party and invoked through a third-party API, such as... Figure 3 As shown, the indicators are used to assist in calculating market power-related indicators, and the embodiments of the present invention are not specifically limited.
[0026] 103. Receive the structured call instruction returned by the large language model platform, and initiate a tool call request to the MCP service based on the structured call instruction, so that the MCP service calls and executes relevant market power analysis calculation operations based on the API interface provided by the target computing tool, and returns the call execution result; In this embodiment of the invention, the current execution terminal receives a structured invocation instruction returned by the large language model platform. This structured invocation instruction carries various information for indicator calculation, such as the target tool type, specific calculation parameters, permission identifiers, and data format requirements. This embodiment does not impose specific limitations on these information. After receiving the structured invocation instruction from the large language model platform, the current execution terminal needs to initiate a tool invocation request to the MCP service based on the structured invocation instruction. This allows the MCP service to invoke and execute relevant market power analysis calculations based on the API interface provided by the target calculation tool, including: (1) The structured call instruction is parsed to obtain the target tool type, specific calculation parameters, permission identifier, and data format requirements; wherein, the target tool type is such as a core calculation tool, a data discovery tool, etc., which is not specifically limited in this embodiment of the invention. Specific calculation parameters are such as market power index type, time range, regional range, etc., which are not specifically limited in this embodiment of the invention. For example, for "calculate the Top-m index of power generation groups in East China in Q1 2024", the parsing shows that a core calculation tool needs to be called, with parameters such as time range [2024-01-01, 2024-03-31], regional code "East China", and index code "Top-m", which are not specifically limited in this embodiment of the invention.
[0027] (2) Convert the parsed instructions into a calling format compatible with the MCP service, including: Tool routing identifier: Matches the corresponding service endpoint based on the tool type; Encryption processing: Asymmetric encryption is used for the permission identifier to prevent parameter transmission leakage; Parameter standardization: Map the indicator names described in natural language, such as “market concentration”, to the database field name “HHI”, and verify the consistency of data types, such as converting the date format to “YYYY-MM-DD”, etc. The embodiments of this invention do not impose specific limitations.
[0028] (3) The MCP service calls the target calculation tool through a preset API interface based on the converted request, so that the target calculation tool performs calculation operations related to market power analysis based on the specific calculation parameters, and returns the call execution result after the calculation operation is completed.
[0029] The execution result is obtained through the MCP service, which includes converting the data format into a structured object that can be parsed by the large language model (including indicator name, calculation result, data source, error range, etc.); verifying the integrity of the data by checking the mapping relationship between the returned fields and the requested indicator, etc. The embodiments of the present invention do not impose specific limitations.
[0030] It should be noted that in this embodiment, the MCP service can also be configured with a task monitoring thread to track the tool call status in real time. If an execution timeout occurs (e.g., no result is returned after more than 30 seconds), a retry mechanism is automatically triggered. If a database lock conflict is detected (e.g., multiple tasks accessing the same table simultaneously), the service stabilization tool is invoked to acquire a row-level lock and the task is scheduled for execution according to a priority queue. Furthermore, intermediate data generated during the calculation process can be temporarily cached to reduce the overhead of redundant calculations.
[0031] 104. Receive the execution result of the call, and integrate the execution result with the query statement and send it to the large language model platform so that the large language model platform can generate a response to the query statement.
[0032] In this embodiment of the invention, the current execution terminal receives the call execution result returned by the MCP service, integrates the call execution result with the query statement, and sends it to the large language model platform, so that the large language model platform generates a response to the query statement. The current execution terminal receives the response content returned by the large language model platform and presents the response content to the user. This embodiment of the invention realizes a closed loop from natural language instructions to specific computational execution, ensuring both the flexible decision-making capability of the large language model and the reliability and accuracy of the computation process through the standardized adaptation of the MCP service.
[0033] Furthermore, as a refinement and extension of the specific implementation methods described above, in order to deeply integrate the general semantic capabilities of the large language model with the specialized scenario of power market force calculation, another artificial intelligence-based method for calculating power market force is provided, such as... Figure 4 As shown, the method further includes: Based on actual business needs, prompt content is constructed on the interactive interface of the market power analysis platform. The prompt content includes at least one of the following: tool usage rules, table structure and dependencies, and market power index analysis and calculation methods.
[0034] In this embodiment of the invention, the prompt word serves as the core medium connecting the large language model and the power calculation scenario in the electricity market, and its role is mainly reflected in the following three aspects: (1) Standardize tool calling logic: The "tool usage rules" contained in the prompt words provide clear operational guidance for the large language model, ensuring that the model can correctly select tools in the MCP service (such as core computing tools, data discovery tools, etc.). For example, when a user asks for "market concentration in a certain region", the prompt words will guide the model to call the SQL query tool and follow the rule of "verify permissions before executing the query" to avoid tool abuse or parameter errors, and ensure the compliance and accuracy of the calculation process.
[0035] (2) Connecting Data and Business Logic: The description of "table structure and dependencies" in the prompt allows the large language model to understand the underlying architecture of the power market database, such as the related fields between the "unit declaration data table" and the "market settlement result table," as well as the basic data sources required for the calculation of the "Top-m index." This enables the model to accurately locate the required data, avoid invalid queries, and provide data structure support for complex indicator calculations (such as multi-table association analysis), ensuring logical consistency from data extraction to indicator generation.
[0036] (3) Anchoring to professional calculation standards: The prompts for "Market Power Index Analysis and Calculation Method" inject professional rules of the power market (such as the HHI index calculation formula and market power judgment threshold) into the model to ensure that the generated calculation logic conforms to industry standards. For example, when calculating "market dominance", the prompts will clearly state that the model must refer to the indicator weight allocation rules in the "Power Market Supervision Measures" to avoid calculation errors caused by general semantic misunderstandings, and to make the results have regulatory applicability and business credibility.
[0037] In this embodiment of the invention, the prompt words, through standardized input constraints, deeply bind the general semantic capabilities of the large language model with the professional scenario of power market calculation, which not only leverages the model's flexible reasoning advantages but also ensures the standardization of the calculation process, the correlation of data, and the professionalism of the results.
[0038] Furthermore, as a refinement and extension of the specific implementation methods described above, in order to ensure the dynamic injection of knowledge, another artificial intelligence-based method for calculating market power in the electricity market is provided, such as... Figure 5 As shown, the method further includes: After the MCP service call is completed, a structured document is automatically generated through the data summary hook and injected into the RAG knowledge base; the structured document contains information including the success rate and response time of the MCP tool; Receive user feedback on the response content and convert the feedback information into structured knowledge and inject it into the RAG knowledge base; By combining the feedback information, the success rate of the MCP tool, and the response time, the recall and reordering accuracy, tool invocation decision-making, and semantic understanding and response generation capabilities are optimized.
[0039] In this embodiment, the current execution end realizes dynamic knowledge injection and real-time learning by timely incorporating new regulatory rules, market data, and user feedback, which enables the market power analysis platform to continuously optimize its analytical capabilities and accuracy, and can meet the dynamic changes in the electricity market.
[0040] This invention provides an artificial intelligence-based method for calculating market power in the electricity market. Compared with existing technologies, this invention receives user queries related to market power analysis and performs keyword matching between the queries and a pre-built RAG knowledge base to obtain knowledge base retrieval results. It then obtains a list of available tools from the MCP service and integrates the list of available tools, the queries, and the knowledge base retrieval results, sending them to the large language model platform. This allows the large language model platform to determine the target calculation tool to be invoked and return a structured invocation instruction. Finally, it receives the structured invocation instruction returned by the large language model platform and initiates a tool invocation request to the MCP service based on the structured invocation instruction, enabling the MCP service to... The system calls and executes market power analysis calculations based on the API interface provided by the target calculation tool, and returns the execution results. It receives the execution results, integrates them with the query statement, and sends them to the large language model platform. This allows the large language model platform to generate a response to the query statement, enabling collaborative work between the market power analysis platform, the large language model platform, the RAG knowledge base, and the MCP service. It adapts to changing needs through natural language interaction, assists in complex analysis through knowledge fusion, and achieves complementary advantages through tool coordination. This enables the calculation and analysis of market power in the electricity market, improving data utilization and interaction while enhancing the ability to handle complex problems, thus meeting the dynamic regulatory needs of the electricity market.
[0041] As a response to the above Figure 1 The implementation of the method shown in this embodiment of the invention provides an artificial intelligence-based electricity market power calculation device, applied to a market power analysis platform. The market power analysis platform connects to the MCP service and a large language model platform. The device includes: The receiving and retrieval module is used to receive user queries related to market power analysis, and match the queries with keywords in a pre-built RAG knowledge base to obtain knowledge base retrieval results. The first response module is used to obtain a list of available tools in the MCP service, and to integrate the list of available tools, the query statement and the knowledge base retrieval results and send them to the large language model platform, so that the large language model platform can determine the target computing tool to be called and return a structured calling instruction; The MCP service module is used to receive the structured call instruction returned by the large language model platform, and initiate a tool call request to the MCP service based on the structured call instruction, so that the MCP service can call and execute relevant market power analysis calculation operations based on the API interface provided by the target computing tool, and return the call execution result; The second response module is used to receive the call execution result, integrate the call execution result with the query statement, and send it to the large language model platform so that the large language model platform can generate a response to the query statement.
[0042] Furthermore, the device also includes a model fine-tuning and deployment module, which is used to fine-tune the base model and build a large language model platform. The construction process includes: The base model is fine-tuned to obtain a fine-tuned base model that meets the evaluation conditions; The fine-tuned base model is format-converted and loaded into the large language model platform so that the large language model platform can provide natural language processing services.
[0043] Furthermore, the device also includes a knowledge base construction module, which is used to pre-build a RAG knowledge base based on power market-related knowledge documents. The construction process includes: The document related to power market forces is obtained and preprocessed to obtain several text blocks; the preprocessing includes parsing, cleaning, and segmentation. The semantic information in the text block is converted into a semantic vector through an embedded model; An index is created for each of the semantic vectors, and the indexed semantic vectors are stored in the RAG knowledge base.
[0044] Furthermore, the MCP service provides at least five tools: a core calculation tool that can execute SQL query statements, a data discovery tool that searches for database table names based on Chinese annotations, a calculation support tool that obtains the structural information of specified table fields, a service stability tool that obtains database row-level locks, and a market power analysis calculation tool.
[0045] Furthermore, the MCP service module is also used for: The structured invocation instructions are parsed to obtain the target tool type, specific calculation parameters, permission identifier, and data format requirements; The parsed instructions are converted into a calling format compatible with the MCP service; The MCP service, based on the converted request, calls the target calculation tool through a preset API interface, so that the target calculation tool performs calculations related to market power analysis based on the specific calculation parameters.
[0046] Furthermore, the device also includes a prompt word construction module, which is used to construct prompt word content on the interactive interface of the market power analysis platform according to actual business needs. The prompt word content includes at least one of tool usage rules, table structure and dependencies, and market power index analysis calculation methods.
[0047] Furthermore, the device also includes a dynamic injection and optimization module, which is used for: After the MCP service call is completed, a structured document is automatically generated through the data summary hook and injected into the RAG knowledge base; the structured document contains information including the success rate and response time of the MCP tool; Receive user feedback on the response content and convert the feedback information into structured knowledge and inject it into the RAG knowledge base; By combining the feedback information, the success rate of the MCP tool, and the response time, the recall and reordering accuracy, tool invocation decision-making, and semantic understanding and response generation capabilities are optimized.
[0048] This invention provides an artificial intelligence-based power market power calculation device. Compared with existing technologies, this invention receives user queries related to market power analysis and performs keyword matching between the queries and a pre-built RAG knowledge base to obtain knowledge base retrieval results. It then obtains a list of available tools from the MCP service, integrates the list of available tools, the queries, and the knowledge base retrieval results, and sends them to the large language model platform. This allows the large language model platform to determine the target calculation tool to be invoked and return a structured invocation instruction. Finally, it receives the structured invocation instruction returned by the large language model platform and initiates a tool invocation request to the MCP service based on the structured invocation instruction, enabling the MCP service to... The system calls and executes market power analysis calculations based on the API interface provided by the target calculation tool, and returns the execution results. It receives the execution results, integrates them with the query statement, and sends them to the large language model platform. This allows the large language model platform to generate a response to the query statement, enabling collaborative work between the market power analysis platform, the large language model platform, the RAG knowledge base, and the MCP service. It adapts to changing needs through natural language interaction, assists in complex analysis through knowledge fusion, and achieves complementary advantages through tool coordination. This enables the calculation and analysis of market power in the electricity market, improving data utilization and interaction while enhancing the ability to handle complex problems, thus meeting the dynamic regulatory needs of the electricity market.
[0049] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being able to execute the artificial intelligence-based electricity market power calculation method in any of the above method embodiments.
[0050] The present invention provides a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.
[0051] The electronic device may include a processor, a communications interface, memory, and a communications bus.
[0052] The processor, communication interface, and memory communicate with each other via a communication bus.
[0053] A communication interface is used to communicate with other network elements, such as clients or other servers.
[0054] The processor is used to execute programs, specifically the steps of the aforementioned artificial intelligence-based electricity market power calculation method.
[0055] Specifically, the program may include program code, which includes computer operation instructions.
[0056] The processor may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The electronic device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0057] Memory is used to store programs. Memory may include high-speed RAM, and may also include non-volatile memory, such as at least one disk drive.
[0058] Specifically, the program can be used to cause the processor to perform the following operations: The system receives user queries related to market power analysis and performs keyword matching between the queries and a pre-built RAG knowledge base to obtain knowledge base retrieval results. Obtain the list of available tools in the MCP service, and integrate the list of available tools, the query statement, and the knowledge base retrieval results and send them to the large language model platform, so that the large language model platform can determine the target computing tool to be called and return a structured calling instruction; The system receives the structured call instruction returned by the large language model platform, and initiates a tool call request to the MCP service based on the structured call instruction, so that the MCP service calls and executes relevant market power analysis calculation operations based on the API interface provided by the target computing tool, and returns the call execution result; The system receives the execution result of the call, integrates the execution result with the query statement, and sends it to the large language model platform so that the large language model platform can generate a response to the query statement.
[0059] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0060] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An artificial intelligence-based power market market force calculation method, characterized in that, The method is applied to a market force analysis platform connected with an MCP service and a large language model platform, and comprises the following steps: Receiving a query sentence about market force analysis proposed by a user, and performing keyword matching between the query sentence and a pre-constructed RAG knowledge base to obtain a knowledge base retrieval result; Obtaining a list of available tools in the MCP service, and sending the list of available tools, the query sentence and the knowledge base retrieval result to the large language model platform after integration, so that the large language model platform determines a target computing tool to be called and returns a structured calling instruction; Receiving the structured calling instruction returned by the large language model platform, and initiating a tool calling request to the MCP service based on the structured calling instruction, so that the MCP service calls and executes a computing operation related to market force analysis based on an API interface provided by the target computing tool, and returns a calling execution result; Receiving the calling execution result, and sending the calling execution result to the large language model platform after integration with the query sentence, so that the large language model platform generates reply content to reply to the query sentence.
2. The method of claim 1, wherein, The large language model platform is constructed by fine-tuning a base model, and the construction process comprises the following steps: Fine-tuning the base model to obtain a fine-tuned base model that meets an evaluation condition; Performing format conversion processing on the fine-tuned base model to load the large language model platform, so that the large language model platform provides natural language processing services.
3. The method of claim 1, wherein, The RAG knowledge base is pre-constructed based on power market force related knowledge documents, and the construction process comprises the following steps: Obtaining the power market force related knowledge documents, and pre-processing the power market force related knowledge documents to obtain a plurality of text blocks; the preprocessing comprises parsing processing, cleaning processing and segmentation processing; Converting semantic information in the text blocks into semantic vectors through an embedded model; Indexing each semantic vector, and storing the semantic vectors with indexes in the RAG knowledge base.
4. The method of claim 1, wherein, The MCP service provides at least five tools, which are a core computing tool that can execute SQL query sentences, a data discovery tool that searches database table names according to Chinese annotations, a computing support tool that obtains specified table field structure information, a service stability tool that obtains database row-level locks, and a market force analysis computing tool.
5. The method of claim 1, wherein, The method further comprises the following steps: Performing parsing processing on the structured calling instruction to obtain a target tool type, specific computing parameters, a permission identifier and data format requirements; Converting the parsed instruction into a calling format compatible with the MCP service; The MCP service calls the target computing tool through a preset API interface based on the converted request, so that the target computing tool executes a computing operation related to market force analysis based on the specific computing parameters.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises the following steps: According to actual business requirements, prompt word content is constructed in the interactive interface of the market force analysis platform, and the prompt word content includes at least one of tool use rules, table structure and dependency relationship, and market force index analysis and calculation methods.
7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: After the MCP service call is completed, a structured document is automatically generated through a data summary hook, and the structured document is injected into an RAG knowledge base; information contained in the structured document includes success rate and response time consumption of the MCP tool; Receiving feedback information of the user on the reply content, and converting the feedback information into structured knowledge and injecting the structured knowledge into the RAG knowledge base; In combination with the feedback information, the success rate of the MCP tool and the response time consumption, recall and reordering accuracy, tool calling decision, and semantic understanding and answer generation capability are optimized.
8. An artificial intelligence-based electric power market market force calculation device characterized by comprising: The application is applied to a market force analysis platform connected with an MCP service and a large language model platform, and the device includes: A receiving and retrieving module is configured to receive a query sentence about market force analysis proposed by a user, and perform keyword matching on the query sentence and a pre-constructed RAG knowledge base to obtain a knowledge base retrieval result; A first reply module is configured to obtain a list of available tools in the MCP service, integrate the list of available tools, the query sentence and the knowledge base retrieval result, and send the integrated list to the large language model platform, so that the large language model platform determines a target calculation tool to be called and returns a structured calling instruction; An MCP service module is configured to receive the structured calling instruction returned by the large language model platform, initiate a tool calling request to the MCP service based on the structured calling instruction, so that the MCP service calls and executes a calculation operation about market force analysis based on an API interface provided by the target calculation tool, and returns a calling execution result; A second reply module is configured to receive the calling execution result, integrate the calling execution result and the query sentence, and send the integrated result to the large language model platform, so that the large language model platform generates reply content for replying to the query sentence.
9. A storage medium having at least one executable instruction stored therein, the executable instruction performing operations corresponding to the artificial intelligence-based power market market force calculation method of any one of claims 1-7.
10. An electronic device comprising a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface completing communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction makes the processor execute operations corresponding to the artificial intelligence-based power market market force calculation method of any one of claims 1-7.
Citation Information
Patent Citations
Automatic building design modeling method and system combining LLM and MCP
CN120409302A
Power transaction strategy method based on large model technology
CN120543281A
Service request processing method and device, equipment, medium and program product
CN120639860A
Intelligent simulation evaluation system and method of mixed knowledge retrieval enhancement and model context protocol
CN120806129A
